minor cleanups

Original commit: elastic/x-pack-elasticsearch@44572eea2a
This commit is contained in:
Areek Zillur 2014-10-03 10:47:24 -04:00
parent bee849d5f4
commit 593b8ca18f
6 changed files with 11 additions and 42 deletions

View File

@ -48,6 +48,7 @@ public class TransportGetLicenseAction extends TransportMasterNodeReadOperationA
@Override @Override
protected ClusterBlockException checkBlock(GetLicenseRequest request, ClusterState state) { protected ClusterBlockException checkBlock(GetLicenseRequest request, ClusterState state) {
//TODO: do the right checkBlock
return state.blocks().indexBlockedException(ClusterBlockLevel.METADATA, ""); return state.blocks().indexBlockedException(ClusterBlockLevel.METADATA, "");
} }

View File

@ -28,16 +28,6 @@ public class PutLicenseRequest extends AcknowledgedRequest<PutLicenseRequest> {
@Override @Override
public ActionRequestValidationException validate() { public ActionRequestValidationException validate() {
return null; return null;
/*
ActionRequestValidationException validationException = null;
if (name == null) {
validationException = addValidationError("name is missing", validationException);
}
if (type == null) {
validationException = addValidationError("type is missing", validationException);
}
return validationException;
*/
} }
/** /**

View File

@ -11,12 +11,12 @@ import org.elasticsearch.client.ClusterAdminClient;
import org.elasticsearch.license.core.ESLicenses; import org.elasticsearch.license.core.ESLicenses;
/** /**
* Register repository request builder * Register license request builder
*/ */
public class PutLicenseRequestBuilder extends AcknowledgedRequestBuilder<PutLicenseRequest, PutLicenseResponse, PutLicenseRequestBuilder, ClusterAdminClient> { public class PutLicenseRequestBuilder extends AcknowledgedRequestBuilder<PutLicenseRequest, PutLicenseResponse, PutLicenseRequestBuilder, ClusterAdminClient> {
/** /**
* Constructs register repository request * Constructs register license request
* *
* @param clusterAdminClient cluster admin client * @param clusterAdminClient cluster admin client
*/ */

View File

@ -66,23 +66,6 @@ public class TransportPutLicenseAction extends TransportMasterNodeOperationActio
listener.onFailure(e); listener.onFailure(e);
} }
}); });
/*
repositoriesService.registerLicenses(new RepositoriesService.RegisterRepositoryRequest("put_repository [" + request.name() + "]", request.name(), request.type())
.settings(request.settings())
.masterNodeTimeout(request.masterNodeTimeout())
.ackTimeout(request.timeout()), new ActionListener<ClusterStateUpdateResponse>() {
@Override
public void onResponse(ClusterStateUpdateResponse response) {
listener.onResponse(new PutRepositoryResponse(response.isAcknowledged()));
}
@Override
public void onFailure(Throwable e) {
listener.onFailure(e);
}
});*/
} }
} }

View File

@ -21,7 +21,7 @@ import java.util.*;
import static org.elasticsearch.license.plugin.action.Utils.*; import static org.elasticsearch.license.plugin.action.Utils.*;
/** /**
* Contains metadata about registered snapshot licenses * Contains metadata about registered licenses
*/ */
public class LicensesMetaData implements MetaData.Custom, ESLicenses { public class LicensesMetaData implements MetaData.Custom, ESLicenses {
@ -32,7 +32,7 @@ public class LicensesMetaData implements MetaData.Custom, ESLicenses {
private final ImmutableMap<FeatureType, ESLicense> licenses; private final ImmutableMap<FeatureType, ESLicense> licenses;
/** /**
* Constructs new repository metadata * Constructs new licenses metadata
* *
* @param esLicenses list of esLicense * @param esLicenses list of esLicense
*/ */
@ -52,15 +52,6 @@ public class LicensesMetaData implements MetaData.Custom, ESLicenses {
return builder.build(); return builder.build();
} }
/**
* Returns list of currently registered licenses
*
* @return list of licenses
*/
//public ImmutableList<String> signatures() {
// return this.licenses;
//}
@Override @Override
public Collection<ESLicense> licenses() { public Collection<ESLicense> licenses() {
return licenses.values(); return licenses.values();
@ -82,7 +73,7 @@ public class LicensesMetaData implements MetaData.Custom, ESLicenses {
} }
/** /**
* Repository metadata factory * Licenses metadata factory
*/ */
public static class Factory implements MetaData.Custom.Factory<LicensesMetaData> { public static class Factory implements MetaData.Custom.Factory<LicensesMetaData> {

View File

@ -21,7 +21,11 @@ import org.elasticsearch.license.plugin.action.put.PutLicenseRequest;
import org.elasticsearch.license.plugin.cluster.LicensesMetaData; import org.elasticsearch.license.plugin.cluster.LicensesMetaData;
/** /**
* Service responsible for maintaining and providing access to snapshot repositories on nodes. * Service responsible for maintaining and providing access to licenses on nodes.
*
* TODO: Work in progress:
* - implement logic in clusterChanged
* - interface with LicenseManager
*/ */
public class LicensesService extends AbstractComponent implements ClusterStateListener { public class LicensesService extends AbstractComponent implements ClusterStateListener {