diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/certsrv/logging/AuditEvent.java')
-rw-r--r-- | pki/base/common/src/com/netscape/certsrv/logging/AuditEvent.java | 67 |
1 files changed, 39 insertions, 28 deletions
diff --git a/pki/base/common/src/com/netscape/certsrv/logging/AuditEvent.java b/pki/base/common/src/com/netscape/certsrv/logging/AuditEvent.java index 4f7e64f27..aa0077b06 100644 --- a/pki/base/common/src/com/netscape/certsrv/logging/AuditEvent.java +++ b/pki/base/common/src/com/netscape/certsrv/logging/AuditEvent.java @@ -17,20 +17,18 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.logging; - import java.text.MessageFormat; import java.util.Locale; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.MessageFormatter; - /** * The log event object that carries message detail of a log event - * that goes into the Transaction log. Note that the name of this - * class "AuditEvent" is legacy and has nothing to do with the signed + * that goes into the Transaction log. Note that the name of this + * class "AuditEvent" is legacy and has nothing to do with the signed * audit log events, whcih are represented by SignedAuditEvent. - * + * * @version $Revision$, $Date$ * @see java.text.MessageFormat * @see com.netscape.certsrv.logging.LogResources @@ -56,12 +54,12 @@ public class AuditEvent implements IBundleLogEvent { * The bundle name for this event. */ private String mBundleName = LogResources.class.getName(); - private static final String INVALID_LOG_LEVEL="log level: {0} is invalid, should be 0-6"; + private static final String INVALID_LOG_LEVEL = "log level: {0} is invalid, should be 0-6"; /** * Constructs a message event * <P> - * + * * @param msgFormat the message string */ public AuditEvent(String msgFormat) { @@ -71,11 +69,12 @@ public class AuditEvent implements IBundleLogEvent { /** * Constructs a message with a parameter. For example, + * * <PRE> - * new AuditEvent("failed to load {0}", fileName); + * new AuditEvent("failed to load {0}", fileName); * </PRE> * <P> - * + * * @param msgFormat details in message string format * @param param message string parameter */ @@ -89,6 +88,7 @@ public class AuditEvent implements IBundleLogEvent { * Constructs a message from an exception. It can be used to carry * a system exception that may contain information about * the context. For example, + * * <PRE> * try { * ... @@ -97,7 +97,7 @@ public class AuditEvent implements IBundleLogEvent { * } * </PRE> * <P> - * + * * @param msgFormat exception details in message string format * @param exception system exception */ @@ -110,6 +110,7 @@ public class AuditEvent implements IBundleLogEvent { /** * Constructs a message from a base exception. This will use the msgFormat * from the exception itself. + * * <PRE> * try { * ... @@ -118,7 +119,7 @@ public class AuditEvent implements IBundleLogEvent { * } * </PRE> * <P> - * + * * @param e CMS exception */ public AuditEvent(Exception e) { @@ -135,7 +136,7 @@ public class AuditEvent implements IBundleLogEvent { * Constructs a message event with a list of parameters * that will be substituted into the message format. * <P> - * + * * @param msgFormat message string format * @param params list of message format parameters */ @@ -147,7 +148,7 @@ public class AuditEvent implements IBundleLogEvent { /** * Returns the current message format string. * <P> - * + * * @return details message */ public String getMessage() { @@ -157,7 +158,7 @@ public class AuditEvent implements IBundleLogEvent { /** * Returns a list of parameters. * <P> - * + * * @return list of message format parameters */ public Object[] getParameters() { @@ -168,7 +169,7 @@ public class AuditEvent implements IBundleLogEvent { * Returns localized message string. This method should * only be called if a localized string is necessary. * <P> - * + * * @return details message */ public String toContent() { @@ -178,7 +179,7 @@ public class AuditEvent implements IBundleLogEvent { /** * Returns the string based on the given locale. * <P> - * + * * @param locale locale * @return details message */ @@ -189,8 +190,9 @@ public class AuditEvent implements IBundleLogEvent { } /** - * Gets the resource bundle name for this class instance. This should + * Gets the resource bundle name for this class instance. This should * be overridden by subclasses who have their own resource bundles. + * * @param bundle String that represents the resource bundle name to be set */ public void setBundleName(String bundle) { @@ -199,6 +201,7 @@ public class AuditEvent implements IBundleLogEvent { /** * Retrieves bundle name. + * * @return a String that represents the resource bundle name */ protected String getBundleName() { @@ -207,8 +210,9 @@ public class AuditEvent implements IBundleLogEvent { /** * Retrieves log source. + * * @return an integer that indicates the component source - * where this message event was triggered + * where this message event was triggered */ public int getSource() { return mSource; @@ -216,18 +220,19 @@ public class AuditEvent implements IBundleLogEvent { /** * Sets log source. + * * @param source an integer that represents the component source - * where this message event was triggered + * where this message event was triggered */ public void setSource(int source) { mSource = source; } - /** * Retrieves log level. * The log level of an event represents its relative importance * or severity within CMS. + * * @return Integer log level value. */ public int getLevel() { @@ -236,6 +241,7 @@ public class AuditEvent implements IBundleLogEvent { /** * Retrieves NT specific log event type. + * * @return Integer NTEventType value. */ public int getNTEventType() { @@ -246,6 +252,7 @@ public class AuditEvent implements IBundleLogEvent { * Sets log level, NT log event type. * For certain log levels the NT log event type gets * set as well. + * * @param level Integer log level value. */ public void setLevel(int level) { @@ -273,12 +280,13 @@ public class AuditEvent implements IBundleLogEvent { break; } } - + /** * Retrieves log multiline attribute. + * * @return Boolean whether or not this event is multiline. - * A multiline message simply consists of more than one line. - */ + * A multiline message simply consists of more than one line. + */ public boolean getMultiline() { return mMultiline; } @@ -286,6 +294,7 @@ public class AuditEvent implements IBundleLogEvent { /** * Sets log multiline attribute. A multiline message consists of * more than one line. + * * @param multiline Boolean multiline value. */ public void setMultiline(boolean multiline) { @@ -294,26 +303,27 @@ public class AuditEvent implements IBundleLogEvent { /** * Retrieves event time stamp. + * * @return Long integer of the time the event was created. */ public long getTimeStamp() { return mTimeStamp; } - /** * Retrieves log event type. Each type of event * has an associated String type value. + * * @return String containing the type of event. */ public String getEventType() { return mEventType; } - /** * Sets log event type. Each type of event * has an associated String type value. + * * @param eventType String containing the type of event. */ public void setEventType(String eventType) { @@ -321,9 +331,10 @@ public class AuditEvent implements IBundleLogEvent { } /** - * Return string representation of log message. - * @return String containing log message. - */ + * Return string representation of log message. + * + * @return String containing log message. + */ public String toString() { if (getBundleName() == null) { MessageFormat detailMessage = new MessageFormat(mMessage); |