use of com.sequenceiq.consumption.flow.consumption.storage.event.StorageConsumptionCollectionHandlerEvent in project cloudbreak by hortonworks.
the class StorageConsumptionCollectionHandler method executeOperation.
@Override
public Selectable executeOperation(HandlerEvent<StorageConsumptionCollectionHandlerEvent> event) throws Exception {
StorageConsumptionCollectionHandlerEvent data = event.getData();
Consumption consumption = data.getContext().getConsumption();
String environmentCrn = consumption.getEnvironmentCrn();
LOGGER.debug("Getting credential for environment with CRN [{}].", environmentCrn);
Credential credential = credentialService.getCredentialByEnvCrn(environmentCrn);
credentialConverter.convert(credential);
Long resourceId = data.getResourceId();
String resourceCrn = data.getResourceCrn();
LOGGER.debug("Storage consumption collection started. resourceCrn: '{}'", resourceCrn);
return StorageConsumptionCollectionEvent.builder().withResourceCrn(resourceCrn).withResourceId(resourceId).withSelector(SEND_CONSUMPTION_EVENT_EVENT.selector()).build();
}
Aggregations