Example usage for java.util EnumMap put

List of usage examples for java.util EnumMap put

Introduction

In this page you can find the example usage for java.util EnumMap put.

Prototype

public V put(K key, V value) 

Source Link

Document

Associates the specified value with the specified key in this map.

Usage

From source file:org.openecomp.sdc.be.servlets.AbstractValidationsServlet.java

protected void validateToscaTemplatePayloadName(Wrapper<Response> responseWrapper,
        UploadResourceInfo uploadResourceInfo, User user) {
    String toscaTemplatePayloadName = uploadResourceInfo.getPayloadName();
    boolean isValidSuffix = false;
    if (toscaTemplatePayloadName != null && !toscaTemplatePayloadName.isEmpty()) {
        for (String validSuffix : ImportUtils.Constants.TOSCA_YML_CSAR_VALID_SUFFIX) {
            isValidSuffix = isValidSuffix || toscaTemplatePayloadName.toLowerCase().endsWith(validSuffix);
        }//w w w  .j  a va2 s  .  c  o m
    }
    if (!isValidSuffix) {
        ResponseFormat responseFormat = getComponentsUtils()
                .getResponseFormat(ActionStatus.INVALID_TOSCA_FILE_EXTENSION);
        Response errorResponse = buildErrorResponse(responseFormat);
        EnumMap<AuditingFieldsKeysEnum, Object> additionalParam = new EnumMap<AuditingFieldsKeysEnum, Object>(
                AuditingFieldsKeysEnum.class);
        additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, uploadResourceInfo.getName());
        getComponentsUtils().auditResource(responseFormat, user, null, "", "",
                AuditingActionEnum.IMPORT_RESOURCE, additionalParam);
        responseWrapper.setInnerElement(errorResponse);
    }

}

From source file:org.openecomp.sdc.be.servlets.AbstractValidationsServlet.java

protected void validateMD5(Wrapper<Response> responseWrapper, User user, UploadResourceInfo resourceInfo,
        HttpServletRequest request, String resourceInfoJsonString) {
    boolean isValid;
    String recievedMD5 = request.getHeader(Constants.MD5_HEADER);
    if (recievedMD5 == null) {
        isValid = false;//from   w w w .  j a  v a2  s  .c  o  m
    } else {
        String calculateMD5 = GeneralUtility.calculateMD5ByString(resourceInfoJsonString);
        isValid = calculateMD5.equals(recievedMD5);
    }
    if (!isValid) {
        ResponseFormat responseFormat = getComponentsUtils()
                .getResponseFormat(ActionStatus.INVALID_RESOURCE_CHECKSUM);
        Response errorResponse = buildErrorResponse(responseFormat);
        EnumMap<AuditingFieldsKeysEnum, Object> additionalParam = new EnumMap<AuditingFieldsKeysEnum, Object>(
                AuditingFieldsKeysEnum.class);
        additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceInfo.getName());
        getComponentsUtils().auditResource(responseFormat, user, null, "", "",
                AuditingActionEnum.IMPORT_RESOURCE, additionalParam);
        responseWrapper.setInnerElement(errorResponse);
    }
}

From source file:org.openecomp.sdc.be.servlets.AbstractValidationsServlet.java

protected void validatePayloadIsNotService(Wrapper<Response> responseWrapper, User user,
        UploadResourceInfo uploadResourceInfo, String toscaPayload) {
    log.debug("checking payload is not a tosca service");
    String heatDecodedPayload = (GeneralUtility.isBase64Encoded(toscaPayload))
            ? new String(Base64.decodeBase64(toscaPayload))
            : toscaPayload;//from w w w  .  j  a v  a2s. c o m
    Map<String, Object> mappedToscaTemplate = (Map<String, Object>) new Yaml().load(heatDecodedPayload);
    Either<Object, ResultStatusEnum> toscaElement = ImportUtils.findToscaElement(mappedToscaTemplate,
            ToscaTagNamesEnum.TOPOLOGY_TEMPLATE, ToscaElementTypeEnum.ALL);

    if (toscaElement.isLeft()) {
        ResponseFormat responseFormat = getComponentsUtils()
                .getResponseFormat(ActionStatus.NOT_RESOURCE_TOSCA_TEMPLATE);
        Response errorResponse = buildErrorResponse(responseFormat);
        EnumMap<AuditingFieldsKeysEnum, Object> additionalParam = new EnumMap<AuditingFieldsKeysEnum, Object>(
                AuditingFieldsKeysEnum.class);
        additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, uploadResourceInfo.getName());
        getComponentsUtils().auditResource(responseFormat, user, null, "", "",
                AuditingActionEnum.IMPORT_RESOURCE, additionalParam);
        responseWrapper.setInnerElement(errorResponse);
    }

}

From source file:org.openecomp.sdc.be.servlets.AbstractValidationsServlet.java

protected void validatePayloadIsTopologyTemplate(Wrapper<Response> responseWrapper, User user,
        UploadResourceInfo uploadResourceInfo, String toscaPayload) {
    log.debug("checking payload is a tosca topology template");
    String heatDecodedPayload = (GeneralUtility.isBase64Encoded(toscaPayload))
            ? new String(Base64.decodeBase64(toscaPayload))
            : toscaPayload;//from   ww w. j  a va2 s. c om
    Map<String, Object> mappedToscaTemplate = (Map<String, Object>) new Yaml().load(heatDecodedPayload);
    Either<Object, ResultStatusEnum> toscaElement = ImportUtils.findToscaElement(mappedToscaTemplate,
            ToscaTagNamesEnum.TOPOLOGY_TEMPLATE, ToscaElementTypeEnum.ALL);

    if (toscaElement.isRight()) {
        ResponseFormat responseFormat = getComponentsUtils()
                .getResponseFormat(ActionStatus.NOT_TOPOLOGY_TOSCA_TEMPLATE);
        Response errorResponse = buildErrorResponse(responseFormat);
        EnumMap<AuditingFieldsKeysEnum, Object> additionalParam = new EnumMap<AuditingFieldsKeysEnum, Object>(
                AuditingFieldsKeysEnum.class);
        additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, uploadResourceInfo.getName());
        getComponentsUtils().auditResource(responseFormat, user, null, "", "",
                AuditingActionEnum.IMPORT_RESOURCE, additionalParam);
        responseWrapper.setInnerElement(errorResponse);
    }

}

From source file:org.openecomp.sdc.be.components.impl.ResourceImportManager.java

private void auditErrorImport(UploadResourceInfo resourceMetaData, User user,
        ResponseFormat errorResponseWrapper, boolean isNormative) {
    EnumMap<AuditingFieldsKeysEnum, Object> auditingFields = new EnumMap<>(AuditingFieldsKeysEnum.class);
    auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingActionEnum.IMPORT_RESOURCE.getName());
    auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceMetaData.getName());
    auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, ComponentTypeEnum.RESOURCE.getValue());
    auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_PREV_VERSION, "");
    auditingFields.put(AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, user.getUserId());
    auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_PREV_STATE, "");
    auditingFields.put(AuditingFieldsKeysEnum.AUDIT_INVARIANT_UUID, "");
    auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, errorResponseWrapper.getStatus());
    String message = "";
    if (errorResponseWrapper.getMessageId() != null) {
        message = errorResponseWrapper.getMessageId() + ": ";
    }//from   www. j av a  2  s.  co  m
    message += errorResponseWrapper.getFormattedMessage();
    auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, message);
    auditingFields.put(AuditingFieldsKeysEnum.AUDIT_MODIFIER_NAME,
            user.getFirstName() + " " + user.getLastName());

    String version, lifeCycleState;
    if (isNormative) {
        version = Constants.FIRST_CERTIFIED_VERSION_VERSION;
        lifeCycleState = LifecycleStateEnum.CERTIFIED.name();
    } else {
        version = "";
        lifeCycleState = LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.name();

    }
    auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_CURR_VERSION, version);
    auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_CURR_STATE, lifeCycleState);
    auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TOSCA_NODE_TYPE, "");

    getAuditingManager().auditEvent(auditingFields);
}

From source file:org.openecomp.sdc.be.servlets.AbstractValidationsServlet.java

protected void validatePayloadIsSingleResource(Wrapper<Response> responseWrapper,
        UploadResourceInfo uploadResourceInfo, User user, String toscaPayload) {
    log.debug("checking payload contains single resource");
    boolean isValid;
    String heatDecodedPayload = (GeneralUtility.isBase64Encoded(toscaPayload))
            ? new String(Base64.decodeBase64(toscaPayload))
            : toscaPayload;/*from w  ww  .  j  a va2s  . c o  m*/
    Map<String, Object> mappedToscaTemplate = (Map<String, Object>) new Yaml().load(heatDecodedPayload);
    Either<Map<String, Object>, ResultStatusEnum> toscaElement = ImportUtils
            .findFirstToscaMapElement(mappedToscaTemplate, ToscaTagNamesEnum.NODE_TYPES);
    if (toscaElement.isRight()) {
        isValid = false;
    } else {
        isValid = toscaElement.left().value().size() == 1;
    }

    if (!isValid) {
        ResponseFormat responseFormat = getComponentsUtils()
                .getResponseFormat(ActionStatus.NOT_SINGLE_RESOURCE);
        Response errorResponse = buildErrorResponse(responseFormat);
        EnumMap<AuditingFieldsKeysEnum, Object> additionalParam = new EnumMap<AuditingFieldsKeysEnum, Object>(
                AuditingFieldsKeysEnum.class);
        additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, uploadResourceInfo.getName());
        getComponentsUtils().auditResource(responseFormat, user, null, "", "",
                AuditingActionEnum.IMPORT_RESOURCE, additionalParam);
        responseWrapper.setInnerElement(errorResponse);
    }

}

From source file:org.openecomp.sdc.be.servlets.AbstractValidationsServlet.java

protected void validatePayloadIsTosca(Wrapper<Response> responseWrapper, UploadResourceInfo uploadResourceInfo,
        User user, String toscaPayload) {
    log.debug("checking payload is valid tosca");
    boolean isValid;
    String heatDecodedPayload = (GeneralUtility.isBase64Encoded(toscaPayload))
            ? new String(Base64.decodeBase64(toscaPayload))
            : toscaPayload;//from   ww w.  ja  v a  2  s .  co  m
    Map<String, Object> mappedToscaTemplate = (Map<String, Object>) new Yaml().load(heatDecodedPayload);
    Either<String, ResultStatusEnum> findFirstToscaStringElement = ImportUtils
            .findFirstToscaStringElement(mappedToscaTemplate, ToscaTagNamesEnum.TOSCA_VERSION);

    if (findFirstToscaStringElement.isRight()) {
        isValid = false;
    } else {
        String defenitionVersionFound = findFirstToscaStringElement.left().value();
        if (defenitionVersionFound == null || defenitionVersionFound.isEmpty()) {
            isValid = false;
        } else {
            isValid = ImportUtils.Constants.TOSCA_DEFINITION_VERSIONS.contains(defenitionVersionFound);
        }
    }

    if (!isValid) {
        ResponseFormat responseFormat = getComponentsUtils()
                .getResponseFormat(ActionStatus.INVALID_TOSCA_TEMPLATE);
        Response errorResponse = buildErrorResponse(responseFormat);
        EnumMap<AuditingFieldsKeysEnum, Object> additionalParam = new EnumMap<AuditingFieldsKeysEnum, Object>(
                AuditingFieldsKeysEnum.class);
        additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, uploadResourceInfo.getName());
        getComponentsUtils().auditResource(responseFormat, user, null, "", "",
                AuditingActionEnum.IMPORT_RESOURCE, additionalParam);
        responseWrapper.setInnerElement(errorResponse);
    }

}

From source file:org.openecomp.sdc.be.servlets.AbstractValidationsServlet.java

protected void validatePayloadNameSpace(Wrapper<Response> responseWrapper, UploadResourceInfo resourceInfo,
        User user, String toscaPayload) {
    boolean isValid;
    String nameSpace = "";

    String heatDecodedPayload = (GeneralUtility.isBase64Encoded(toscaPayload))
            ? new String(Base64.decodeBase64(toscaPayload))
            : toscaPayload;/*from  w  ww .j  av  a2 s.c om*/
    Map<String, Object> mappedToscaTemplate = (Map<String, Object>) new Yaml().load(heatDecodedPayload);
    Either<Map<String, Object>, ResultStatusEnum> toscaElement = ImportUtils
            .findFirstToscaMapElement(mappedToscaTemplate, ToscaTagNamesEnum.NODE_TYPES);
    if (toscaElement.isRight() || toscaElement.left().value().size() != 1) {
        isValid = false;
    } else {
        nameSpace = toscaElement.left().value().keySet().iterator().next();
        isValid = nameSpace.startsWith(Constants.USER_DEFINED_RESOURCE_NAMESPACE_PREFIX);
    }
    if (!isValid) {
        ResponseFormat responseFormat = getComponentsUtils()
                .getResponseFormat(ActionStatus.INVALID_RESOURCE_NAMESPACE);
        Response errorResponse = buildErrorResponse(responseFormat);
        EnumMap<AuditingFieldsKeysEnum, Object> additionalParam = new EnumMap<AuditingFieldsKeysEnum, Object>(
                AuditingFieldsKeysEnum.class);
        additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceInfo.getName());
        getComponentsUtils().auditResource(responseFormat, user, null, "", "",
                AuditingActionEnum.IMPORT_RESOURCE, additionalParam);
        responseWrapper.setInnerElement(errorResponse);
    } else {
        String str1 = nameSpace.substring(Constants.USER_DEFINED_RESOURCE_NAMESPACE_PREFIX.length());
        String[] findTypes = str1.split("\\.");
        if (ResourceTypeEnum.contains(findTypes[0].toUpperCase())) {
            String type = findTypes[0].toUpperCase();
            resourceInfo.setResourceType(type);
        } else {
            resourceInfo.setResourceType(ResourceTypeEnum.VFC.name());
        }
    }

}

From source file:org.openecomp.sdc.be.components.impl.ComponentBusinessLogic.java

protected Either<Boolean, ResponseFormat> validateUserRole(User user, Component component, List<Role> roles,
        AuditingActionEnum auditAction, String comment) {
    if (roles != null && roles.isEmpty()) {
        roles.add(Role.ADMIN);/*from   w  ww. j  ava  2s .c o  m*/
        roles.add(Role.DESIGNER);
    }
    Either<Boolean, ResponseFormat> validationResult = validateUserRole(user, roles);
    if (validationResult.isRight()) {
        ComponentTypeEnum componentType = component.getComponentType();
        EnumMap<AuditingFieldsKeysEnum, Object> additionalParams = new EnumMap<>(AuditingFieldsKeysEnum.class);
        if (componentType.equals(ComponentTypeEnum.SERVICE)) {
            additionalParams.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_COMMENT, comment);
            String distributionStatus = ((ServiceMetadataDataDefinition) component
                    .getComponentMetadataDefinition().getMetadataDataDefinition()).getDistributionStatus();
            additionalParams.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_DPREV_STATUS, distributionStatus);
            additionalParams.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_DCURR_STATUS, distributionStatus);
        }
        componentsUtils.auditComponent(validationResult.right().value(), user, component, "", "", auditAction,
                componentType, additionalParams);
    }
    return validationResult;
}

From source file:org.openecomp.sdc.asdctool.impl.DataMigration.java

/**
 * the method retrieves the fields from the given map and praprs them for
 * storage as an audit according to the table name
 * //from w w w .  j  a v  a 2  s .co  m
 * @param map
 *            the map from which we will retrive the fields enum values
 * @param table
 *            the table we are going to store the record in.
 * @return a enummap representing the audit record that is going to be
 *         created.
 */
private EnumMap<AuditingFieldsKeysEnum, Object> createAuditMap(Map<String, String> map, Table table) {
    EnumMap<AuditingFieldsKeysEnum, Object> auditingFields = new EnumMap<>(AuditingFieldsKeysEnum.class);
    switch (table) {
    case USER_ADMIN_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, map.get("SERVICE_INSTANCE_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_USER_AFTER, map.get("USER_AFTER"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_USER_BEFORE, map.get("USER_BEFORE"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, map.get("MODIFIER"));
        break;
    case USER_ACCESS_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, map.get("SERVICE_INSTANCE_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_USER_UID, map.get("USER"));
        break;
    case RESOURCE_ADMIN_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, map.get("SERVICE_INSTANCE_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_INVARIANT_UUID, map.get("INVARIANT_UUID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_CURR_VERSION, map.get("CURR_VERSION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_CURR_STATE, map.get("CURR_STATE"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_ID, map.get("DID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, map.get("MODIFIER"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_PREV_VERSION, map.get("PREV_VERSION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_PREV_STATE, map.get("PREV_STATE"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, map.get("RESOURCE_NAME"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, map.get("RESOURCE_TYPE"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_DPREV_STATUS, map.get("DPREV_STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_DCURR_STATUS, map.get("DCURR_STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TOSCA_NODE_TYPE, map.get("TOSCA_NODE_TYPE"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_COMMENT, map.get("COMMENT"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ARTIFACT_DATA, map.get("ARTIFACT_DATA"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_PREV_ARTIFACT_UUID, map.get("PREV_ARTIFACT_UUID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_CURR_ARTIFACT_UUID, map.get("CURR_ARTIFACT_UUID"));
        break;
    case DISTRIBUTION_DOWNLOAD_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, map.get("SERVICE_INSTANCE_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_RESOURCE_URL, map.get("RESOURCE_URL"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, map.get("CONSUMER_ID"));
        break;
    case DISTRIBUTION_ENGINE_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, map.get("SERVICE_INSTANCE_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        if (map.get("TOPIC_NAME") != null) {
            if (map.get("TOPIC_NAME").contains("-STATUS-")) {
                auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_STATUS_TOPIC_NAME,
                        map.get("TOPIC_NAME"));
            } else {
                auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_NOTIFICATION_TOPIC_NAME,
                        map.get("TOPIC_NAME"));
            }
        } else {
            auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_STATUS_TOPIC_NAME,
                    map.get("DSTATUS_TOPIC"));
            auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_NOTIFICATION_TOPIC_NAME,
                    map.get("DNOTIF_TOPIC"));
        }
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_TOPIC_NAME, map.get("TOPIC_NAME"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_ROLE, map.get("ROLE"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_API_KEY, map.get("API_KEY"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_ENVRIONMENT_NAME, map.get("D_ENV"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, map.get("CONSUMER_ID"));
        break;
    case DISTRIBUTION_NOTIFICATION_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, map.get("SERVICE_INSTANCE_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_CURR_STATE, map.get("CURR_STATE"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_CURR_VERSION, map.get("CURR_VERSION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_ID, map.get("DID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, map.get("MODIFIER"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, map.get("RESOURCE_NAME"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, map.get("RESOURCE_TYPE"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_TOPIC_NAME, map.get("TOPIC_NAME"));
        break;
    case DISTRIBUTION_STATUS_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, map.get("SERVICE_INSTANCE_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_RESOURCE_URL, map.get("RESOURCE_URL"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_ID, map.get("DID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_TOPIC_NAME, map.get("TOPIC_NAME"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, map.get("CONSUMER_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_STATUS_TIME, map.get("STATUS_TIME"));
        break;
    case DISTRIBUTION_DEPLOY_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, map.get("SERVICE_INSTANCE_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_ID, map.get("DID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, map.get("RESOURCE_NAME"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, map.get("RESOURCE_TYPE"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, map.get("MODIFIER"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_CURR_VERSION, map.get("CURR_VERSION"));
        break;
    case DISTRIBUTION_GET_UEB_CLUSTER_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, map.get("SERVICE_INSTANCE_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        if (map.get("STATUS_DESC") != null) {
            auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("STATUS_DESC"));
        } else {
            auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        }
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, map.get("CONSUMER_ID"));
        break;
    case AUTH_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_AUTH_USER, map.get("USER"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_AUTH_URL, map.get("URL"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_AUTH_STATUS, map.get("AUTH_STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_AUTH_REALM, map.get("REALM"));
        break;
    case CONSUMER_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, map.get("MODIFIER"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ECOMP_USER, map.get("ECOMP_USER"));
        break;
    case CATEGORY_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, map.get("MODIFIER"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, map.get("SERVICE_INSTANCE_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_CATEGORY_NAME, map.get("CATEGORY_NAME"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_SUB_CATEGORY_NAME, map.get("SUB_CATEGORY_NAME"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_GROUPING_NAME, map.get("GROUPING_NAME"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, map.get("RESOURCE_TYPE"));
        break;
    case GET_USERS_LIST_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, map.get("MODIFIER"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DETAILS, map.get("DETAILS"));
        break;
    case GET_CATEGORY_HIERARCHY_EVENT:
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, map.get("TIMESTAMP"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, map.get("ACTION"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DESC, map.get("DESC"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_STATUS, map.get("STATUS"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, map.get("MODIFIER"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_REQUEST_ID, map.get("REQUEST_ID"));
        auditingFields.put(AuditingFieldsKeysEnum.AUDIT_DETAILS, map.get("DETAILS"));
        break;
    default:
        auditingFields = null;
        break;
    }
    return auditingFields;
}