use of com.sequenceiq.freeipa.flow.stack.StackContext in project cloudbreak by hortonworks.
the class FreeIpaUpscaleActions method collectingHostMetadataAction.
@Bean(name = "UPSCALE_COLLECTING_HOST_METADATA_STATE")
public Action<?, ?> collectingHostMetadataAction() {
return new AbstractUpscaleAction<>(BootstrapMachinesSuccess.class) {
@Override
protected void doExecute(StackContext context, BootstrapMachinesSuccess payload, Map<Object, Object> variables) {
Stack stack = context.getStack();
stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "Collecting host metadata");
HostMetadataSetupRequest request = new HostMetadataSetupRequest(stack.getId());
sendEvent(context, request.selector(), request);
}
};
}
use of com.sequenceiq.freeipa.flow.stack.StackContext in project cloudbreak by hortonworks.
the class FreeIpaDownscaleActions method updateDnsSoaRecordsAction.
@Bean(name = "DOWNSCALE_UPDATE_DNS_SOA_RECORDS_STATE")
public Action<?, ?> updateDnsSoaRecordsAction() {
return new AbstractDownscaleAction<>(RemoveDnsResponse.class) {
@Override
protected void doExecute(StackContext context, RemoveDnsResponse payload, Map<Object, Object> variables) {
stackUpdater.updateStackStatus(context.getStack().getId(), getInProgressStatus(variables), "Update DNS SOA records");
CleanupEvent cleanupEvent = buildCleanupEvent(context, getDownscaleHosts(variables));
UpdateDnsSoaRecordsRequest request = new UpdateDnsSoaRecordsRequest(cleanupEvent);
sendEvent(context, request);
}
};
}
use of com.sequenceiq.freeipa.flow.stack.StackContext in project cloudbreak by hortonworks.
the class FreeIpaDownscaleActions method revokeCertsAction.
@Bean(name = "DOWNSCALE_REVOKE_CERTS_STATE")
public Action<?, ?> revokeCertsAction() {
return new AbstractDownscaleAction<>(StackEvent.class) {
@Override
protected void doExecute(StackContext context, StackEvent payload, Map<Object, Object> variables) {
stackUpdater.updateStackStatus(context.getStack().getId(), getInProgressStatus(variables), "Revoking certificates");
CleanupEvent cleanupEvent = buildCleanupEvent(context, getDownscaleHosts(variables));
RevokeCertsRequest request = new RevokeCertsRequest(cleanupEvent, context.getStack());
sendEvent(context, request);
}
};
}
use of com.sequenceiq.freeipa.flow.stack.StackContext in project cloudbreak by hortonworks.
the class FreeIpaDownscaleActions method updateMetadataForDeletionRequestAction.
@Bean(name = "DOWNSCALE_UPDATE_METADATA_FOR_DELETION_REQUEST_STATE")
public Action<?, ?> updateMetadataForDeletionRequestAction() {
return new AbstractDownscaleAction<>(StackEvent.class) {
@Override
protected void doExecute(StackContext context, StackEvent payload, Map<Object, Object> variables) {
Stack stack = context.getStack();
stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "Updating metadata for deletion request");
List<String> repairInstanceIds = getInstanceIds(variables);
terminationService.requestDeletion(stack.getId(), repairInstanceIds);
sendEvent(context, UPDATE_METADATA_FOR_DELETION_REQUEST_FINISHED_EVENT.selector(), new StackEvent(stack.getId()));
}
};
}
use of com.sequenceiq.freeipa.flow.stack.StackContext in project cloudbreak by hortonworks.
the class FreeIpaDownscaleActions method downscaleCollectAdditionalHostnamesAction.
@Bean(name = "DOWNSCALE_COLLECT_ADDITIONAL_HOSTNAMES_STATE")
public Action<?, ?> downscaleCollectAdditionalHostnamesAction() {
return new AbstractDownscaleAction<>(ClusterProxyUpdateRegistrationSuccess.class) {
@Override
protected void doExecute(StackContext context, ClusterProxyUpdateRegistrationSuccess payload, Map<Object, Object> variables) throws Exception {
Stack stack = context.getStack();
stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "Collecting additional hostnames.");
CollectAdditionalHostnamesRequest request = new CollectAdditionalHostnamesRequest(stack.getId());
sendEvent(context, request.selector(), request);
}
};
}
Aggregations