Search in sources :

Example 1 with CmSyncTriggerEvent

use of com.sequenceiq.cloudbreak.reactor.api.event.orchestration.CmSyncTriggerEvent in project cloudbreak by hortonworks.

the class CmSyncActions method cmSync.

@Bean(name = "CM_SYNC_STATE")
public Action<?, ?> cmSync() {
    return new AbstractCmSyncAction<>(CmSyncTriggerEvent.class) {

        @Override
        protected void doExecute(CmSyncContext context, CmSyncTriggerEvent payload, Map<Object, Object> variables) {
            CmSyncRequest cmSyncRequest = new CmSyncRequest(context.getStack().getId(), payload.getCandidateImageUuids(), context.getFlowTriggerUserCrn());
            sendEvent(context, cmSyncRequest.selector(), cmSyncRequest);
        }
    };
}
Also used : CmSyncRequest(com.sequenceiq.cloudbreak.reactor.api.event.resource.CmSyncRequest) CmSyncTriggerEvent(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.CmSyncTriggerEvent) Map(java.util.Map) Bean(org.springframework.context.annotation.Bean)

Aggregations

CmSyncTriggerEvent (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.CmSyncTriggerEvent)1 CmSyncRequest (com.sequenceiq.cloudbreak.reactor.api.event.resource.CmSyncRequest)1 Map (java.util.Map)1 Bean (org.springframework.context.annotation.Bean)1