use of com.sequenceiq.cloudbreak.audit.model.AuditEventName in project cloudbreak by hortonworks.
the class EnvironmentRestResourceAuditEventConverter method auditEventName.
@Override
public AuditEventName auditEventName(CDPStructuredRestCallEvent structuredEvent) {
String method = structuredEvent.getRestCall().getRestRequest().getMethod();
AuditEventName eventName = null;
String resourceEvent = structuredEvent.getOperation().getResourceEvent();
if ("POST".equals(method) || "PUT".equals(method)) {
if (resourceEvent == null) {
eventName = AuditEventName.CREATE_ENVIRONMENT;
} else {
eventName = updateRest(resourceEvent);
}
} else if ("DELETE".equals(method)) {
eventName = deletionRest(resourceEvent, structuredEvent.getOperation());
}
return eventName;
}
use of com.sequenceiq.cloudbreak.audit.model.AuditEventName 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));
}
use of com.sequenceiq.cloudbreak.audit.model.AuditEventName in project cloudbreak by hortonworks.
the class RestLegacyEventDataExtractor method eventName.
@Override
public AuditEventName eventName(StructuredRestCallEvent structuredEvent) {
AuditEventName auditEventName = determineEventName(structuredEvent);
if (auditEventName != null) {
LOGGER.info("Determined event name: {}", auditEventName);
return auditEventName;
}
String resourceType = structuredEvent.getOperation().getResourceType();
String method = structuredEvent.getRestCall().getRestRequest().getMethod();
throw new UnsupportedOperationException(String.format("The `%s` with `%s` does not support for auditing", resourceType, method));
}
use of com.sequenceiq.cloudbreak.audit.model.AuditEventName in project cloudbreak by hortonworks.
the class LdapRestResourceAuditEventConverter method auditEventName.
@Override
public AuditEventName auditEventName(CDPStructuredRestCallEvent structuredEvent) {
String method = structuredEvent.getRestCall().getRestRequest().getMethod();
AuditEventName eventName = null;
String resourceEvent = structuredEvent.getOperation().getResourceEvent();
if ("POST".equals(method) || "PUT".equals(method)) {
if (resourceEvent == null) {
eventName = AuditEventName.CREATE_LDAP_CONFIG;
}
} else if ("DELETE".equals(method)) {
eventName = deletionRest(resourceEvent, structuredEvent.getOperation());
}
return eventName;
}
use of com.sequenceiq.cloudbreak.audit.model.AuditEventName in project cloudbreak by hortonworks.
the class FreeIpaRestResourceAuditEventConverter method auditEventName.
@Override
public AuditEventName auditEventName(CDPStructuredRestCallEvent structuredEvent) {
String method = structuredEvent.getRestCall().getRestRequest().getMethod();
AuditEventName eventName = null;
String resourceEvent = structuredEvent.getOperation().getResourceEvent();
if ("POST".equals(method) || "PUT".equals(method)) {
if (resourceEvent == null) {
eventName = AuditEventName.CREATE_FREEIPA;
} else {
eventName = updateRest(resourceEvent);
}
} else if ("DELETE".equals(method)) {
eventName = deletionRest(resourceEvent, structuredEvent.getOperation());
}
return eventName;
}
Aggregations