@Override
 public void triggerClusterDownscale(Object object) {
   UpdateAmbariHostsRequest request = (UpdateAmbariHostsRequest) object;
   ClusterScalingContext context = new ClusterScalingContext(request);
   reactor.notify(
       FlowPhases.CLUSTER_DOWNSCALE.name(),
       eventFactory.createEvent(context, FlowPhases.CLUSTER_DOWNSCALE.name()));
 }
 @Override
 public void triggerStackRemoveInstance(Object object) {
   RemoveInstanceRequest removeInstanceRequest = (RemoveInstanceRequest) object;
   StackInstanceUpdateContext context = new StackInstanceUpdateContext(removeInstanceRequest);
   reactor.notify(
       FlowPhases.REMOVE_INSTANCE.name(),
       eventFactory.createEvent(context, FlowPhases.REMOVE_INSTANCE.name()));
 }
 @Override
 public void triggerStackDownscale(Object object) {
   UpdateInstancesRequest updateRequest = (UpdateInstancesRequest) object;
   StackScalingContext context = new StackScalingContext(updateRequest);
   reactor.notify(
       FlowPhases.STACK_DOWNSCALE.name(),
       eventFactory.createEvent(context, FlowPhases.STACK_DOWNSCALE.name()));
 }
 @Override
 public void triggerUpdateAllowedSubnets(Object object) {
   UpdateAllowedSubnetsRequest updateAllowedSubnetsRequest = (UpdateAllowedSubnetsRequest) object;
   UpdateAllowedSubnetsContext context =
       new UpdateAllowedSubnetsContext(updateAllowedSubnetsRequest);
   reactor.notify(
       FlowPhases.UPDATE_ALLOWED_SUBNETS.name(),
       eventFactory.createEvent(context, FlowPhases.UPDATE_ALLOWED_SUBNETS.name()));
 }
 @Override
 public void triggerForcedTermination(Object object) {
   StackDeleteRequest deleteRequest = (StackForcedDeleteRequest) object;
   DefaultFlowContext context =
       new DefaultFlowContext(deleteRequest.getStackId(), deleteRequest.getCloudPlatform());
   reactor.notify(
       FlowPhases.FORCED_TERMINATION.name(),
       eventFactory.createEvent(context, FlowPhases.FORCED_TERMINATION.name()));
 }
 @Override
 public void triggerStackStop(Object object) {
   StackStatusUpdateRequest statusUpdateRequest = (StackStatusUpdateRequest) object;
   StackStatusUpdateContext context =
       new StackStatusUpdateContext(
           statusUpdateRequest.getStackId(), statusUpdateRequest.getCloudPlatform(), false);
   reactor.notify(
       FlowPhases.STACK_STOP.name(),
       eventFactory.createEvent(context, FlowPhases.STACK_STOP.name()));
 }
 @Override
 public void triggerClusterSync(Object object) {
   ClusterStatusUpdateRequest statusUpdateRequest = (ClusterStatusUpdateRequest) object;
   StackStatusUpdateContext context =
       new StackStatusUpdateContext(
           statusUpdateRequest.getStackId(), statusUpdateRequest.getCloudPlatform(), false);
   reactor.notify(
       FlowPhases.CLUSTER_SYNC.name(),
       eventFactory.createEvent(context, FlowPhases.CLUSTER_SYNC.name()));
 }
 @Override
 public void triggerClusterReInstall(Object object) {
   ProvisionRequest provisionRequest = (ProvisionRequest) object;
   ProvisioningContext context =
       new ProvisioningContext.Builder()
           .setDefaultParams(provisionRequest.getStackId(), provisionRequest.getCloudPlatform())
           .build();
   reactor.notify(
       FlowPhases.CLUSTER_RESET.name(),
       eventFactory.createEvent(context, FlowPhases.CLUSTER_RESET.name()));
 }
 @Override
 public void triggerNext(Class sourceHandlerClass, Object payload, boolean success) {
   String key =
       success
           ? transitionKeyService.successKey(sourceHandlerClass)
           : transitionKeyService.failureKey(sourceHandlerClass);
   if (isTriggerKey(key)) {
     Event event = eventFactory.createEvent(payload, key);
     reactor.notify(key, event);
   } else {
     LOGGER.debug("The handler {} has no transitions.", sourceHandlerClass);
   }
 }
Esempio n. 10
0
 @Override
 public void triggerClusterUserNamePasswordUpdate(Object object) {
   ClusterUserNamePasswordUpdateRequest request = (ClusterUserNamePasswordUpdateRequest) object;
   ClusterAuthenticationContext context =
       new ClusterAuthenticationContext(
           request.getStackId(),
           request.getCloudPlatform(),
           request.getNewUserName(),
           request.getNewPassword());
   reactor.notify(
       FlowPhases.CLUSTER_USERNAME_PASSWORD_UPDATE.name(),
       eventFactory.createEvent(context, FlowPhases.CLUSTER_USERNAME_PASSWORD_UPDATE.name()));
 }