Search in sources :

Example 6 with AuditEventName

use of com.sequenceiq.cloudbreak.audit.model.AuditEventName in project cloudbreak by hortonworks.

the class RecipesRestResourceAuditEventConverter method auditEventName.

@Override
public AuditEventName auditEventName(StructuredRestCallEvent structuredEvent) {
    String method = structuredEvent.getRestCall().getRestRequest().getMethod();
    AuditEventName eventName = null;
    String resourceEvent = structuredEvent.getOperation().getResourceEvent();
    if ("POST".equals(method) && resourceEvent == null) {
        eventName = AuditEventName.CREATE_RECIPE;
    } else if ("DELETE".equals(method)) {
        eventName = AuditEventName.DELETE_RECIPE;
    }
    return eventName;
}
Also used : AuditEventName(com.sequenceiq.cloudbreak.audit.model.AuditEventName)

Example 7 with AuditEventName

use of com.sequenceiq.cloudbreak.audit.model.AuditEventName in project cloudbreak by hortonworks.

the class DatahubRestResourceAuditEventConverter method auditEventName.

@Override
public AuditEventName auditEventName(StructuredRestCallEvent 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_DATAHUB_CLUSTER;
        } else {
            eventName = updateRest(resourceEvent);
        }
    } else if ("DELETE".equals(method)) {
        eventName = deletionRest(resourceEvent, structuredEvent.getOperation());
    }
    return eventName;
}
Also used : AuditEventName(com.sequenceiq.cloudbreak.audit.model.AuditEventName)

Example 8 with AuditEventName

use of com.sequenceiq.cloudbreak.audit.model.AuditEventName in project cloudbreak by hortonworks.

the class DatalakeRestResourceAuditEventConverter method auditEventName.

@Override
public AuditEventName auditEventName(StructuredRestCallEvent 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_DATALAKE_CLUSTER;
        } else {
            eventName = updateRest(resourceEvent);
        }
    } else if ("DELETE".equals(method)) {
        eventName = deletionRest(resourceEvent);
    }
    return eventName;
}
Also used : AuditEventName(com.sequenceiq.cloudbreak.audit.model.AuditEventName)

Example 9 with AuditEventName

use of com.sequenceiq.cloudbreak.audit.model.AuditEventName in project cloudbreak by hortonworks.

the class ClusterTemplatesRestResourceAuditEventConverter method auditEventName.

@Override
public AuditEventName auditEventName(StructuredRestCallEvent structuredEvent) {
    String method = structuredEvent.getRestCall().getRestRequest().getMethod();
    AuditEventName eventName = null;
    String resourceEvent = structuredEvent.getOperation().getResourceEvent();
    if ("POST".equals(method) && resourceEvent == null) {
        eventName = AuditEventName.CREATE_CLUSTER_TEMPLATE;
    } else if ("DELETE".equals(method)) {
        eventName = AuditEventName.DELETE_CLUSTER_TEMPLATE;
    }
    return eventName;
}
Also used : AuditEventName(com.sequenceiq.cloudbreak.audit.model.AuditEventName)

Example 10 with AuditEventName

use of com.sequenceiq.cloudbreak.audit.model.AuditEventName in project cloudbreak by hortonworks.

the class CredentialRestResourceAuditEventConverter 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) && resourceEvent == null) {
        eventName = AuditEventName.CREATE_CREDENTIAL;
    } else if ("PUT".equals(method) && resourceEvent == null) {
        eventName = AuditEventName.MODIFY_CREDENTIAL;
    } else if ("DELETE".equals(method)) {
        eventName = deletionRest(resourceEvent, structuredEvent.getOperation());
    }
    return eventName;
}
Also used : AuditEventName(com.sequenceiq.cloudbreak.audit.model.AuditEventName)

Aggregations

AuditEventName (com.sequenceiq.cloudbreak.audit.model.AuditEventName)15 FlowDetails (com.sequenceiq.cloudbreak.structuredevent.event.FlowDetails)2 Json (com.sequenceiq.cloudbreak.common.json.Json)1 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)1 HostGroup (com.sequenceiq.cloudbreak.domain.stack.cluster.host.HostGroup)1 FlowResourceAuditEventConverter (com.sequenceiq.cloudbreak.structuredevent.auditeventname.flow.FlowResourceAuditEventConverter)1 OperationDetails (com.sequenceiq.cloudbreak.structuredevent.event.legacy.OperationDetails)1 CDPFlowResourceAuditEventConverter (com.sequenceiq.cloudbreak.structuredevent.service.audit.auditeventname.flow.CDPFlowResourceAuditEventConverter)1