use of com.sequenceiq.freeipa.flow.freeipa.cleanup.event.cert.RevokeCertsResponse in project cloudbreak by hortonworks.
the class FreeIpaDownscaleActions method removeDnsEntriesAction.
@Bean(name = "DOWNSCALE_REMOVE_DNS_ENTRIES_STATE")
public Action<?, ?> removeDnsEntriesAction() {
return new AbstractDownscaleAction<>(RevokeCertsResponse.class) {
@Override
protected void doExecute(StackContext context, RevokeCertsResponse payload, Map<Object, Object> variables) {
stackUpdater.updateStackStatus(context.getStack().getId(), getInProgressStatus(variables), "Remove DNS entries");
CleanupEvent cleanupEvent = buildCleanupEvent(context, getDownscaleHosts(variables));
RemoveDnsRequest request = new RemoveDnsRequest(cleanupEvent);
sendEvent(context, request);
}
};
}
use of com.sequenceiq.freeipa.flow.freeipa.cleanup.event.cert.RevokeCertsResponse in project cloudbreak by hortonworks.
the class RevokeCertsResponseToDownscaleFailureEventConverter method convert.
@Override
public DownscaleFailureEvent convert(Object payload) {
RevokeCertsResponse revokeCertsResponse = (RevokeCertsResponse) payload;
DownscaleFailureEvent event = new DownscaleFailureEvent(revokeCertsResponse.getResourceId(), "Cert revocation", revokeCertsResponse.getCertCleanupSuccess(), revokeCertsResponse.getCertCleanupFailed(), new Exception("Payload failed: " + payload));
return event;
}
use of com.sequenceiq.freeipa.flow.freeipa.cleanup.event.cert.RevokeCertsResponse in project cloudbreak by hortonworks.
the class FreeIpaCleanupActions method removeHostsAction.
@Bean(name = "REMOVE_HOSTS_STATE")
public Action<?, ?> removeHostsAction() {
return new AbstractFreeIpaCleanupAction<>(RevokeCertsResponse.class) {
@Override
protected void doExecute(FreeIpaContext context, RevokeCertsResponse payload, Map<Object, Object> variables) {
if (shouldSkipState(payload, variables) || payload.getHosts() == null || payload.getHosts().isEmpty()) {
LOGGER.info("Host is empty, skipping removing hosts");
RemoveHostsResponse response = new RemoveHostsResponse(payload, Collections.emptySet(), Collections.emptyMap());
sendEvent(context, response);
} else {
RemoveHostsRequest request = new RemoveHostsRequest(payload, context.getStack());
sendEvent(context, request);
}
}
};
}
use of com.sequenceiq.freeipa.flow.freeipa.cleanup.event.cert.RevokeCertsResponse in project cloudbreak by hortonworks.
the class RevokeCertsResponseToCleanupFailureEventConverter method convert.
@Override
public CleanupFailureEvent convert(Object payload) {
RevokeCertsResponse revokeCertsResponse = (RevokeCertsResponse) payload;
CleanupFailureEvent event = new CleanupFailureEvent(revokeCertsResponse, "Cert revocation", revokeCertsResponse.getCertCleanupFailed(), revokeCertsResponse.getCertCleanupSuccess());
return event;
}
use of com.sequenceiq.freeipa.flow.freeipa.cleanup.event.cert.RevokeCertsResponse in project cloudbreak by hortonworks.
the class FreeIpaCleanupActions method revokeCertsAction.
@Bean(name = "REVOKE_CERTS_STATE")
public Action<?, ?> revokeCertsAction() {
return new AbstractFreeIpaCleanupAction<>(CleanupEvent.class) {
@Override
protected void doExecute(FreeIpaContext context, CleanupEvent payload, Map<Object, Object> variables) {
if (shouldSkipState(payload, variables) || payload.getHosts() == null || payload.getHosts().isEmpty()) {
LOGGER.info("Host is empty, skipping revoking certificates");
RevokeCertsResponse response = new RevokeCertsResponse(payload, Collections.emptySet(), Collections.emptyMap());
sendEvent(context, response);
} else {
RevokeCertsRequest request = new RevokeCertsRequest(payload, context.getStack());
sendEvent(context, request);
}
}
};
}
Aggregations