use of com.sequenceiq.cloudbreak.structuredevent.auditeventname.flow.FlowResourceAuditEventConverter in project cloudbreak by hortonworks.
the class FlowLegacyEventDataExtractor method shouldAudit.
@Override
public boolean shouldAudit(StructuredEvent structuredEvent) {
OperationDetails operation = structuredEvent.getOperation();
FlowResourceAuditEventConverter flowResourceAuditEventConverter = getConverter(operation.getResourceType());
if (flowResourceAuditEventConverter == null) {
return false;
}
boolean crn = Crn.isCrn(operation.getResourceCrn());
return crn && flowResourceAuditEventConverter.shouldAudit((StructuredFlowEvent) structuredEvent);
}
use of com.sequenceiq.cloudbreak.structuredevent.auditeventname.flow.FlowResourceAuditEventConverter in project cloudbreak by hortonworks.
the class FlowLegacyEventDataExtractor method eventName.
@Override
public AuditEventName eventName(StructuredFlowEvent structuredEvent) {
FlowDetails flow = structuredEvent.getFlow();
String flowEvent = flow.getFlowEvent();
AuditEventName eventName = null;
String resourceType = structuredEvent.getOperation().getResourceType();
FlowResourceAuditEventConverter 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));
}
Aggregations