Search in sources :

Example 1 with UploadUpscaleRecipesResult

use of com.sequenceiq.cloudbreak.reactor.api.event.recipe.UploadUpscaleRecipesResult in project cloudbreak by hortonworks.

the class ClusterUpscaleActions method configureKeytabsAction.

@Bean(name = "RECONFIGURE_KEYTABS_STATE")
public Action<?, ?> configureKeytabsAction() {
    return new AbstractClusterUpscaleAction<>(UploadUpscaleRecipesResult.class) {

        @Override
        protected void doExecute(ClusterUpscaleContext context, UploadUpscaleRecipesResult payload, Map<Object, Object> variables) {
            if (context.isSinglePrimaryGateway() && ClusterManagerType.CLOUDERA_MANAGER.equals(context.getClusterManagerType())) {
                KeytabConfigurationRequest keytabConfigurationRequest = new KeytabConfigurationRequest(context.getStackId());
                sendEvent(context, keytabConfigurationRequest.selector(), keytabConfigurationRequest);
            } else {
                KeytabConfigurationSuccess keytabConfigurationSuccess = new KeytabConfigurationSuccess(context.getStackId());
                sendEvent(context, keytabConfigurationSuccess.selector(), keytabConfigurationSuccess);
            }
        }
    };
}
Also used : KeytabConfigurationRequest(com.sequenceiq.cloudbreak.reactor.api.event.kerberos.KeytabConfigurationRequest) KeytabConfigurationSuccess(com.sequenceiq.cloudbreak.reactor.api.event.kerberos.KeytabConfigurationSuccess) Map(java.util.Map) HashMap(java.util.HashMap) UploadUpscaleRecipesResult(com.sequenceiq.cloudbreak.reactor.api.event.recipe.UploadUpscaleRecipesResult) Bean(org.springframework.context.annotation.Bean)

Example 2 with UploadUpscaleRecipesResult

use of com.sequenceiq.cloudbreak.reactor.api.event.recipe.UploadUpscaleRecipesResult in project cloudbreak by hortonworks.

the class UploadUpscaleRecipesHandler method accept.

@Override
public void accept(Event<UploadUpscaleRecipesRequest> event) {
    UploadUpscaleRecipesRequest request = event.getData();
    UploadUpscaleRecipesResult result;
    try {
        // TODO: because of CB-17116 - step removed - cleanup the code
        result = new UploadUpscaleRecipesResult(request);
    } catch (Exception e) {
        result = new UploadUpscaleRecipesResult(e.getMessage(), e, request);
    }
    eventBus.notify(result.selector(), new Event<>(event.getHeaders(), result));
}
Also used : UploadUpscaleRecipesRequest(com.sequenceiq.cloudbreak.reactor.api.event.recipe.UploadUpscaleRecipesRequest) UploadUpscaleRecipesResult(com.sequenceiq.cloudbreak.reactor.api.event.recipe.UploadUpscaleRecipesResult)

Aggregations

UploadUpscaleRecipesResult (com.sequenceiq.cloudbreak.reactor.api.event.recipe.UploadUpscaleRecipesResult)2 KeytabConfigurationRequest (com.sequenceiq.cloudbreak.reactor.api.event.kerberos.KeytabConfigurationRequest)1 KeytabConfigurationSuccess (com.sequenceiq.cloudbreak.reactor.api.event.kerberos.KeytabConfigurationSuccess)1 UploadUpscaleRecipesRequest (com.sequenceiq.cloudbreak.reactor.api.event.recipe.UploadUpscaleRecipesRequest)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Bean (org.springframework.context.annotation.Bean)1