All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.odpi.openmetadata.accessservices.digitalservice.ffdc.DigitalServiceAuditCode Maven / Gradle / Ivy

There is a newer version: 5.1
Show newest version
/* SPDX-License-Identifier: Apache-2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.accessservices.digitalservice.ffdc;

import org.odpi.openmetadata.frameworks.auditlog.AuditLogRecordSeverityLevel;
import org.odpi.openmetadata.frameworks.auditlog.messagesets.AuditLogMessageDefinition;
import org.odpi.openmetadata.frameworks.auditlog.messagesets.AuditLogMessageSet;


/**
 * The DigitalServiceAuditCode is used to define the message content for the OMRS Audit Log.
 * The 5 fields in the enum are:
 * 
    *
  • Log Message id - to uniquely identify the message
  • *
  • Severity - is this an event, decision, action, error or exception
  • *
  • Log Message Text - includes placeholder to allow additional values to be captured
  • *
  • Additional Information - further parameters and data relating to the audit message (optional)
  • *
  • SystemAction - describes the result of the situation
  • *
  • UserAction - describes how a user should correct the situation
  • *
* */ public enum DigitalServiceAuditCode implements AuditLogMessageSet { /** * OMAS-DIGITAL-SERVICE-0001 - The Digital Service Open Metadata Access Service (OMAS) is initializing a new server instance */ SERVICE_INITIALIZING("OMAS-DIGITAL-SERVICE-0001", AuditLogRecordSeverityLevel.STARTUP, "The Digital Service Open Metadata Access Service (OMAS) is initializing a new server instance", "The local server has started up a new instance of the Digital Service OMAS.", "No action is needed if this service is required. This is part of the configured operation of the server."), /** * OMAS-DIGITAL-SERVICE-0003 - The Digital Service Open Metadata Access Service (OMAS) has initialized a new instance for server {0} */ SERVICE_INITIALIZED("OMAS-DIGITAL-SERVICE-0003", AuditLogRecordSeverityLevel.STARTUP, "The Digital Service Open Metadata Access Service (OMAS) has initialized a new instance for server {0}", "The access service has completed initialization of a new instance.", "Verify that there were no errors reported as the service started."), /** * OMAS-DIGITAL-SERVICE-0004 - The Digital Service Open Metadata Access Service (OMAS) is shutting down its instance for server {0} */ SERVICE_SHUTDOWN("OMAS-DIGITAL-SERVICE-0004", AuditLogRecordSeverityLevel.SHUTDOWN, "The Digital Service Open Metadata Access Service (OMAS) is shutting down its instance for server {0}", "The local administrator has requested shut down of an Digital Service OMAS instance.", "Verify that all resources have been released."), /** * OMAS-DIGITAL-SERVICE-0005 - The Digital Service Open Metadata Access Service (OMAS) is unable to initialize a new instance; error message is {0} */ SERVICE_INSTANCE_FAILURE("OMAS-DIGITAL-SERVICE-0005", AuditLogRecordSeverityLevel.EXCEPTION, "The Digital Service Open Metadata Access Service (OMAS) is unable to initialize a new instance; error message is {0}", "The access service detected an error during the start up of a specific server instance. Its services are not available for the server.", "Review the error message and any other reported failures to determine the cause of the problem. Once this is resolved, restart the server."), ; private final String logMessageId; private final AuditLogRecordSeverityLevel severity; private final String logMessage; private final String systemAction; private final String userAction; /** * The constructor for DigitalServiceAuditCode expects to be passed one of the enumeration rows defined in * DigitalServiceAuditCode above. For example: * DigitalServiceAuditCode auditCode = DigitalServiceAuditCode.SERVER_NOT_AVAILABLE; * This will expand out to the 5 parameters shown below. * * @param messageId - unique id for the message * @param severity - severity of the message * @param message - text for the message * @param systemAction - description of the action taken by the system when the condition happened * @param userAction - instructions for resolving the situation, if any */ DigitalServiceAuditCode(String messageId, AuditLogRecordSeverityLevel severity, String message, String systemAction, String userAction) { this.logMessageId = messageId; this.severity = severity; this.logMessage = message; this.systemAction = systemAction; this.userAction = userAction; } /** * Retrieve a message definition object for logging. This method is used when there are no message inserts. * * @return message definition object. */ @Override public AuditLogMessageDefinition getMessageDefinition() { return new AuditLogMessageDefinition(logMessageId, severity, logMessage, systemAction, userAction); } /** * Retrieve a message definition object for logging. This method is used when there are values to be inserted into the message. * * @param params array of parameters (all strings). They are inserted into the message according to the numbering in the message text. * @return message definition object. */ @Override public AuditLogMessageDefinition getMessageDefinition(String... params) { AuditLogMessageDefinition messageDefinition = new AuditLogMessageDefinition(logMessageId, severity, logMessage, systemAction, userAction); messageDefinition.setMessageParameters(params); return messageDefinition; } /** * JSON-style toString * * @return string of property names and values for this enum */ @Override public String toString() { return "DigitalServiceAuditCode{" + "logMessageId='" + logMessageId + '\'' + ", severity=" + severity + ", logMessage='" + logMessage + '\'' + ", systemAction='" + systemAction + '\'' + ", userAction='" + userAction + '\'' + '}'; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy