minor cleanups
Original commit: elastic/x-pack-elasticsearch@44572eea2a
This commit is contained in:
parent
bee849d5f4
commit
593b8ca18f
|
@ -48,6 +48,7 @@ public class TransportGetLicenseAction extends TransportMasterNodeReadOperationA
|
|||
|
||||
@Override
|
||||
protected ClusterBlockException checkBlock(GetLicenseRequest request, ClusterState state) {
|
||||
//TODO: do the right checkBlock
|
||||
return state.blocks().indexBlockedException(ClusterBlockLevel.METADATA, "");
|
||||
}
|
||||
|
||||
|
|
|
@ -28,16 +28,6 @@ public class PutLicenseRequest extends AcknowledgedRequest<PutLicenseRequest> {
|
|||
@Override
|
||||
public ActionRequestValidationException validate() {
|
||||
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;
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,12 +11,12 @@ import org.elasticsearch.client.ClusterAdminClient;
|
|||
import org.elasticsearch.license.core.ESLicenses;
|
||||
|
||||
/**
|
||||
* Register repository request builder
|
||||
* Register license request builder
|
||||
*/
|
||||
public class PutLicenseRequestBuilder extends AcknowledgedRequestBuilder<PutLicenseRequest, PutLicenseResponse, PutLicenseRequestBuilder, ClusterAdminClient> {
|
||||
|
||||
/**
|
||||
* Constructs register repository request
|
||||
* Constructs register license request
|
||||
*
|
||||
* @param clusterAdminClient cluster admin client
|
||||
*/
|
||||
|
|
|
@ -66,23 +66,6 @@ public class TransportPutLicenseAction extends TransportMasterNodeOperationActio
|
|||
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);
|
||||
}
|
||||
});*/
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.*;
|
|||
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 {
|
||||
|
||||
|
@ -32,7 +32,7 @@ public class LicensesMetaData implements MetaData.Custom, ESLicenses {
|
|||
private final ImmutableMap<FeatureType, ESLicense> licenses;
|
||||
|
||||
/**
|
||||
* Constructs new repository metadata
|
||||
* Constructs new licenses metadata
|
||||
*
|
||||
* @param esLicenses list of esLicense
|
||||
*/
|
||||
|
@ -52,15 +52,6 @@ public class LicensesMetaData implements MetaData.Custom, ESLicenses {
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of currently registered licenses
|
||||
*
|
||||
* @return list of licenses
|
||||
*/
|
||||
//public ImmutableList<String> signatures() {
|
||||
// return this.licenses;
|
||||
//}
|
||||
|
||||
@Override
|
||||
public Collection<ESLicense> licenses() {
|
||||
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> {
|
||||
|
||||
|
|
|
@ -21,7 +21,11 @@ import org.elasticsearch.license.plugin.action.put.PutLicenseRequest;
|
|||
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 {
|
||||
|
||||
|
|
Loading…
Reference in New Issue