public class RASEvent extends java.lang.Object implements RASIEvent, RASConstants
RASEvent is the parent of all
RASMessageEvent and RASTraceEvent objects. These
classes are used
within this RAS system to encapsulate the message and trace data created
by an application. An application should not need to use them. They
would only be used by a RAS implementation that wishes to extend the
function of this RAS Toolkit.
RASEvent contains the following information:
RASLogger for additional information on this important
point.
RASEvent class.
RASConstants defines the key names.
See RASMessageEvent and
RASTraceEvent for a list of attributes specific to
those classes.
RASLogger,
Serialized FormKEY_CLASS_NAME, KEY_CLIENT, KEY_COMPONENT, KEY_DATE_FORMAT, KEY_DEFAULT_HANDLERS, KEY_DEFAULT_MESSAGE_HANDLERS, KEY_DEFAULT_TRACE_HANDLERS, KEY_DESCRIPTION, KEY_ENCODING, KEY_EXCEPTION, KEY_EXCEPTION_TRACE, KEY_FILE_NAME, KEY_FORMATTER_NAMES, KEY_GROUP, KEY_HANDLER_NAMES, KEY_HEX_DATA, KEY_IS_CIRCULAR, KEY_IS_LOGGING, KEY_IS_SYNC, KEY_LOGGER, KEY_LOGGING_CLASS, KEY_LOGGING_METHOD, KEY_MAX_FILE_SIZE, KEY_MAX_FILES, KEY_MAX_QUEUE_SIZE, KEY_MESSAGE_EVENT_CLASSES, KEY_MESSAGE_FILE, KEY_MESSAGE_MASK, KEY_NAME, KEY_ORGANIZATION, KEY_PRODUCT, KEY_RETRY_INTERVAL, KEY_SEPARATOR, KEY_SERVER, KEY_SOCKET_PORT, KEY_SOCKET_SERVER, KEY_SUPPRESSED_KEYS, KEY_THREAD_ID, KEY_TIME_FORMAT, KEY_TRACE_EVENT_CLASSES, KEY_TRACE_MASK, RAS_VERSION| Constructor and Description |
|---|
RASEvent()
Deprecated.
Creates a
RASEvent. |
RASEvent(long type,
java.lang.String text,
java.lang.Object[] parms)
Deprecated.
Creates a
RASEvent. |
RASEvent(long type,
java.lang.String text,
java.lang.String[] parms)
Deprecated.
Use
RASEvent instead. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getAttribute(java.lang.String name)
Deprecated.
Gets an attribute that is saved as part of a RAS event.
|
java.lang.String[] |
getParameters()
Deprecated.
Gets the text parameters:
Strings to be displayed with
the message text. |
java.util.Hashtable |
getSupportedTypes()
Deprecated.
Gets the complete set of event types supported by this class.
|
java.lang.String |
getText()
Deprecated.
Gets the event text.
|
long |
getTimeStamp()
Deprecated.
Gets the time at which this event was created.
|
long |
getType()
Deprecated.
Gets the type of event: "informational message," for example.
|
boolean |
isMessageEvent()
Deprecated.
Determines if this object is a message event or a trace event.
|
long |
maskLongValue(java.lang.String types)
Deprecated.
Converts a
String representation of a message or trace
mask to its long equivalent. |
java.lang.String |
maskToString(long types)
Deprecated.
Converts a long containing the logical OR of one or more event types
to its
String equivalent. |
protected static java.lang.String[] |
objectsToStrings(java.lang.Object[] parms)
Deprecated.
Converts an array of
Objects to an array of equivalent
Strings. |
void |
setAttribute(java.lang.String name,
java.lang.Object attrib)
Deprecated.
Sets an attribute, saving it as part of a RAS event.
|
void |
setMessageEvent(boolean flag)
Deprecated.
Sets a flag that indicates whether this object is classified
as a message event or a trace event.
|
void |
setParameters(java.lang.String[] parms)
Deprecated.
Gets the text parameters:
Strings to be displayed with
the message text. |
void |
setText(java.lang.String text)
Deprecated.
Sets the event text.
|
void |
setTimeStamp(long timeStamp)
Deprecated.
Sets the time at which this event was created.
|
void |
setType(long type)
Deprecated.
Sets the type of event: "informational message," for example.
|
public RASEvent()
RASEvent. The time stamp is generated
at this time.source - The Object which created this event.public RASEvent(long type,
java.lang.String text,
java.lang.Object[] parms)
RASEvent.type - The message type.text - The message text, or a message key if the message file
is not null.parms - An array of Objects to be displayed
with the message.public RASEvent(long type,
java.lang.String text,
java.lang.String[] parms)
RASEvent instead.RASEvent.type - The message type.text - The message text, or a message key if the message file
is not null.parms - An array of Strings to be displayed
with the message.protected static java.lang.String[] objectsToStrings(java.lang.Object[] parms)
Objects to an array of equivalent
Strings.parms - An array of objects to be converted to strings.public long getTimeStamp()
getTimeStamp in interface RASIEventtimeStamp - The event time stamp, as generated by
System.currentTimeMillis.public void setTimeStamp(long timeStamp)
System.currentTimeMillis.setTimeStamp in interface RASIEventtimeStamp - The event time stamp.public long getType()
RASEvent.
If a type is not defined, the default value of zero is returned.public void setType(long type)
RASEvent.public java.lang.String getText()
public void setText(java.lang.String text)
null, the current
text is not changed.public java.lang.String[] getParameters()
Strings to be displayed with
the message text. If no parameters have been set, null
is returned.getParameters in interface RASIEventpublic void setParameters(java.lang.String[] parms)
Strings to be displayed with
the message text.setParameters in interface RASIEventparms - The text parameters.public java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface RASIEventname - The name of the attribute.null
if the named attribute was not found.public void setAttribute(java.lang.String name,
java.lang.Object attrib)
null, nothing is saved.setAttribute in interface RASIEventname - The name of the attribute.attrib - The attribute associated with the name.public void setMessageEvent(boolean flag)
setMessageEvent in interface RASIEventflag - A boolean set true if this
object is a message event and false if it
is a trace event.public boolean isMessageEvent()
isMessageEvent in interface RASIEventtrue if this object is a message event and
false if it is a trace event.public java.util.Hashtable getSupportedTypes()
This method can be used by a graphical log manager to display the
set of types and allow a user to select those to be monitored. Every
extending class should override this method to add the types it supports
to the Hashtable returned by its parent.
getSupportedTypes in interface RASIEventHashtable containing the values of all of the
event types. The names of the types are used as keys and
are returned in the current locale. The type values,
normally kept as ints, are returned as
Integers because of the Hashtable
requirement that all elements be Objects.public long maskLongValue(java.lang.String types)
String representation of a message or trace
mask to its long equivalent. The string must have the
following format:
String types = "TYPE_INFO TYPE_WARN";Unknown values in the
String are ignored.maskLongValue in interface RASIEventtypes - The blank-delimited String to be converted.String, formed by
the logical OR of each element in the String.public java.lang.String maskToString(long types)
String equivalent. The string will have the
following format:
String types = "TYPE_INFO TYPE_WARN";Every extending class should override this method to add the types it supports to the value returned by its parent.
Unknown values in the long are ignored.
maskToString in interface RASIEventtypes - The message or trace mask.String equivalent of the mask.