コード例 #1
0
 @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()));
 }
コード例 #2
0
 @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()));
 }
コード例 #3
0
 @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()));
 }
コード例 #4
0
 @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()));
 }
コード例 #5
0
 @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()));
 }
コード例 #6
0
 @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()));
 }
コード例 #7
0
 @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()));
 }
コード例 #8
0
 @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()));
 }
コード例 #9
0
 @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);
   }
 }
コード例 #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()));
 }