use of com.sequenceiq.cloudbreak.core.flow2.event.ClusterCredentialChangeTriggerEvent in project cloudbreak by hortonworks.
the class ReactorFlowManager method triggerClusterCredentialReplace.
public void triggerClusterCredentialReplace(Long stackId, String userName, String password) {
String selector = CLUSTER_CREDENTIALCHANGE_EVENT.event();
ClusterCredentialChangeTriggerEvent event = ClusterCredentialChangeTriggerEvent.replaceUserEvent(selector, stackId, userName, password);
notify(selector, event);
}
use of com.sequenceiq.cloudbreak.core.flow2.event.ClusterCredentialChangeTriggerEvent in project cloudbreak by hortonworks.
the class ClusterCredentialChangeActions method changingClusterCredential.
@Bean(name = "CLUSTER_CREDENTIALCHANGE_STATE")
public Action<?, ?> changingClusterCredential() {
return new AbstractClusterAction<ClusterCredentialChangeTriggerEvent>(ClusterCredentialChangeTriggerEvent.class) {
@Override
protected void doExecute(ClusterViewContext ctx, ClusterCredentialChangeTriggerEvent payload, Map<Object, Object> variables) {
clusterCredentialChangeService.credentialChange(ctx.getStackId());
ClusterCredentialChangeRequest request;
switch(payload.getType()) {
case REPLACE:
request = ClusterCredentialChangeRequest.replaceUserRequest(ctx.getStackId(), payload.getUser(), payload.getPassword());
break;
case UPDATE:
request = ClusterCredentialChangeRequest.changePasswordRequest(ctx.getStackId(), payload.getPassword());
break;
default:
throw new UnsupportedOperationException("Ambari credential update request not supported: " + payload.getType());
}
sendEvent(ctx.getFlowId(), request);
}
};
}
use of com.sequenceiq.cloudbreak.core.flow2.event.ClusterCredentialChangeTriggerEvent in project cloudbreak by hortonworks.
the class ReactorFlowManager method triggerClusterCredentialUpdate.
public void triggerClusterCredentialUpdate(Long stackId, String password) {
String selector = CLUSTER_CREDENTIALCHANGE_EVENT.event();
ClusterCredentialChangeTriggerEvent event = ClusterCredentialChangeTriggerEvent.changePasswordEvent(selector, stackId, password);
notify(selector, event);
}
Aggregations