use of com.sequenceiq.cloudbreak.structuredevent.service.audit.auditeventname.flow.CDPFlowResourceAuditEventConverter in project cloudbreak by hortonworks.
the class FlowCDPEventDataExtractor method eventName.
@Override
public AuditEventName eventName(CDPStructuredFlowEvent structuredEvent) {
FlowDetails flow = structuredEvent.getFlow();
String flowEvent = flow.getFlowEvent();
AuditEventName eventName = null;
String resourceType = structuredEvent.getOperation().getResourceType();
CDPFlowResourceAuditEventConverter flowResourceAuditEventConverter = getConverter(resourceType);
if (flowResourceAuditEventConverter != null) {
eventName = flowResourceAuditEventConverter.auditEventName(structuredEvent);
}
if (eventName != null) {
LOGGER.info("Flow event name: {}", eventName);
return eventName;
}
String flowState = flow.getFlowState();
String flowType = flow.getFlowType();
throw new UnsupportedOperationException(String.format("The %s, %s and %s does not support for auditing for %s", flowType, flowEvent, flowState, resourceType));
}
use of com.sequenceiq.cloudbreak.structuredevent.service.audit.auditeventname.flow.CDPFlowResourceAuditEventConverter in project cloudbreak by hortonworks.
the class FlowCDPEventDataExtractor method shouldAudit.
@Override
public boolean shouldAudit(CDPStructuredEvent structuredEvent) {
CDPOperationDetails operation = structuredEvent.getOperation();
CDPFlowResourceAuditEventConverter flowResourceAuditEventConverter = getConverter(operation.getResourceType());
if (flowResourceAuditEventConverter == null) {
return false;
}
boolean crn = Crn.isCrn(operation.getResourceCrn());
return crn && flowResourceAuditEventConverter.shouldAudit((CDPStructuredFlowEvent) structuredEvent);
}
Aggregations