|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bea.security.NamedObject | +--com.bea.security.AuditRecord
This class allows applications to log events to the audit provider. The naming authority used with these events must be based upon the
AUDITBASE
naming format. The AUDITBASE
naming convention is defined as "TYPE/SEVERITY/MESSAGE".
The simplest way to use this class is to add a MULTI_VALUE_PREFIX
attribute referencing the "AUDITBASE" naming authority as the first attribute in your own name. For example:
<AuthorityDefinition name="CUSTOMRECORD" delimiters=":"> <Attribute name="auditbase" type="MULTI_VALUE_PREFIX" authority="AUDITBASE" /> <Attribute name="sessionid" type="SINGLE_VALUE_PREFIX" /> <Attribute name="location" type="SINGLE_VALUE_TERMINAL" /> </AuthorityDefinition>
In the above example, passing in a message of Session failed:#124524:Boston
with a severity of FAILURE
and an authority of CUSTOMRECORD
would result in an audit record that contains the following name/value pairs:
type=CUSTOMRECORD
, severity=FAILURE
, message=Session Failed
,
sessionid=#124524
, location=Boston
Field Summary | |
static int |
AUDIT_FAILURE
AUDIT_FAILURE severity. |
static int |
ERROR
ERROR severity. |
protected HashMapContext |
eventCtx
A reference to the cloned context of the application at the time of this event. |
protected java.lang.String |
evtMessage
A reference to the message associated with this event. |
static int |
FAILURE
FAILURE severity. |
protected java.util.Map |
identityMap
A map of aliases to identies. |
static int |
INFORMATIONAL
INFORMATIONAL severity. |
protected java.lang.Exception |
msgExc
A reference to the exception associated with this event. |
static java.lang.String |
REQUESTOR_ALIAS
The alias that should be used to store the identity that audited the event. |
protected int |
severityCode
A reference to the severity of this event. |
static int |
SUCCESS
SUCCESS severity. |
static int |
WARNING
WARNING severity. |
Fields inherited from class com.bea.security.NamedObject |
deep,
nameAuth,
shallow |
Constructor Summary | |
AuditRecord(java.lang.String authorityname,
int severity,
java.lang.Exception exc)
Construct an audit message with an exception message associated with a naming authority. |
|
AuditRecord(java.lang.String authorityname,
int severity,
java.lang.Exception exc,
AppContext ctx)
Construct an audit message with an exception message associated with a naming authority. |
|
AuditRecord(java.lang.String authorityname,
int severity,
java.lang.String message)
Construct an audit message with a message associated with a naming authority. |
|
AuditRecord(java.lang.String authorityname,
int severity,
java.lang.String message,
AppContext ctx)
Construct an audit message with a message associated with a naming authority and a context. |
Method Summary | |
AppContext |
getContext()
Gets the context associated with this audit record. |
java.lang.Exception |
getException()
Gets the exception associated with this audit record. |
AuthenticIdentity |
getIdentity(java.lang.String alias)
Returns the identity associated with the given alias. |
java.util.Enumeration |
getIdentityAliases()
Lists all the identity alias names of this audit record. |
java.lang.String |
getMessage()
Gets the audit message. |
int |
getSeverity()
Gets the severity level associated with this audit record. |
void |
setContext(AppContext context)
Associates an application context with this audit record. |
void |
setException(java.lang.Exception exc)
Sets an Exception object from which the audit message will be derived. |
void |
setIdentity(java.lang.String alias,
AuthenticIdentity identity)
Associates the given identity with the supplied alias. |
void |
setMessage(java.lang.String message)
Sets the audit message. |
void |
setSeverity(int severity)
Sets the severity level value associated with the AuditRecord .
|
static java.lang.String |
severityCodeToName(int severitycode)
Converts from severity codes ( int ) to severity names (String). |
static int |
severityNameToCode(java.lang.String severityname)
Converts from severity names (String) to severity codes ( int ).
|
java.lang.String |
toString()
Returns this audit event as a string. |
Methods inherited from class com.bea.security.NamedObject |
chop,
getAuthorityName,
getDeepEnumeration,
getEnumeration,
getID,
getNamingAuthority |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int INFORMATIONAL
public static final int WARNING
public static final int ERROR
public static final int SUCCESS
public static final int FAILURE
public static final int AUDIT_FAILURE
public static final java.lang.String REQUESTOR_ALIAS
protected java.lang.Exception msgExc
protected int severityCode
protected java.lang.String evtMessage
protected HashMapContext eventCtx
protected java.util.Map identityMap
Constructor Detail |
public AuditRecord(java.lang.String authorityname, int severity, java.lang.String message)
authorityname
- the name of the naming authority defined by this message.severity
- the severity of this message. One of INFORMATIONAL
,
WARNING
, ERROR
, SUCCESS
, FAILURE
,
or AUDIT_FAILURE
.message
- the message for this audit record.public AuditRecord(java.lang.String authorityname, int severity, java.lang.String message, AppContext ctx)
authorityname
- the name of the naming authority defined by this message.severity
- the severity of this message. One of INFORMATIONAL
,
WARNING
, ERROR
, SUCCESS
, FAILURE
,
or AUDIT_FAILURE
.message
- the message for this audit record.ctx
- an application context to be recorded with this audit record.public AuditRecord(java.lang.String authorityname, int severity, java.lang.Exception exc)
authorityname
- the name of the naming authority defined by this message.severity
- the severity of this message. One of INFORMATIONAL
,
WARNING
, ERROR
, SUCCESS
, FAILURE
,
or AUDIT_FAILURE
.exc
- an exception associated with this audit record. The message of this audit record is taken from the exception.public AuditRecord(java.lang.String authorityname, int severity, java.lang.Exception exc, AppContext ctx)
authorityname
- the name of the naming authority defined by this message.severity
- the severity of this message. One of INFORMATIONAL
,
WARNING
, ERROR
, SUCCESS
, FAILURE
,
or AUDIT_FAILURE
.exc
- an exception associated with this audit record. The message of this audit record is taken from the exception.ctx
- an application context to be recorded with this audit record.Method Detail |
public static java.lang.String severityCodeToName(int severitycode)
int
) to severity names (String).
severitycode
- a severity code as an int
.INFORMATIONAL
,
WARNING
, ERROR
, SUCCESS
, FAILURE
,
or AUDIT_FAILURE
.public static int severityNameToCode(java.lang.String severityname)
int
).
This conversion is case insensitive.
severityname
- a severity name as a String
.int
.public void setException(java.lang.Exception exc)
Exception
object from which the audit message will be derived.
exc
- an Exception
object containing additonal information associated with this record.public java.lang.Exception getException()
Exception
associated with this audit record or null
if one does not exist.public void setSeverity(int severity)
AuditRecord
.
The auditing provider decides whether or not to log this record depending upon the severity.
severity
- a severity code as an int
. public int getSeverity()
int
.public void setMessage(java.lang.String message)
message
- a message for this audit record.public java.lang.String getMessage()
public void setContext(AppContext context)
context
- an object with a AppContext
interface containing application context for this event.public AppContext getContext()
AppContext
containing application context relevent to with audit record.public java.lang.String toString()
String
.public AuthenticIdentity getIdentity(java.lang.String alias)
alias
- the alias namepublic void setIdentity(java.lang.String alias, AuthenticIdentity identity)
alias
- the alias nameidentity
- the identity to assoicate with the given aliaspublic java.util.Enumeration getIdentityAliases()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |