com.ibm.ras
Class RASEvent
- java.lang.Object
-
- com.ibm.ras.RASEvent
-
- All Implemented Interfaces:
- RASConstants, RASIEvent, java.io.Serializable
- Direct Known Subclasses:
- RASMessageEvent, RASTraceEvent
Deprecated.As of WAS 6.0, recommend using java.util.logging
public class RASEvent extends java.lang.Object implements RASIEvent, RASConstants
RASEventis the parent of allRASMessageEventandRASTraceEventobjects. 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.RASEventcontains the following information:- A flag which identifies this event as a message event or a trace event.
- A time stamp, generated automatically when the event is created.
- A "type" field, which defines the particular flavor of the event.
For example, a message event might be one of "informational," "warning,"
or "error." These types are defined by the extensions to this class. See
RASLoggerfor additional information on this important point. - The text of the event.
- An array of run-time parameters which may be inserted into the text or displayed with the text.
- Zero or more additional attributes that are specific to different RAS
event types. These attributes are a set of "key=value" pairs, maintained
in a hashtable by the
RASEventclass.RASConstantsdefines the key names. SeeRASMessageEventandRASTraceEventfor a list of attributes specific to those classes.
- See Also:
RASLogger, Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.ibm.ras.RASConstants
KEY_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 Summary
Constructors Constructor and Description RASEvent()Deprecated.Creates aRASEvent.RASEvent(long type, java.lang.String text, java.lang.Object[] parms)Deprecated.Creates aRASEvent.RASEvent(long type, java.lang.String text, java.lang.String[] parms)Deprecated.UseRASEventinstead.
-
Method Summary
Methods Modifier and Type Method and Description java.lang.ObjectgetAttribute(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:Stringsto be displayed with the message text.java.util.HashtablegetSupportedTypes()Deprecated.Gets the complete set of event types supported by this class.java.lang.StringgetText()Deprecated.Gets the event text.longgetTimeStamp()Deprecated.Gets the time at which this event was created.longgetType()Deprecated.Gets the type of event: "informational message," for example.booleanisMessageEvent()Deprecated.Determines if this object is a message event or a trace event.longmaskLongValue(java.lang.String types)Deprecated.Converts aStringrepresentation of a message or trace mask to itslongequivalent.java.lang.StringmaskToString(long types)Deprecated.Converts a long containing the logical OR of one or more event types to itsStringequivalent.protected static java.lang.String[]objectsToStrings(java.lang.Object[] parms)Deprecated.Converts an array ofObjectsto an array of equivalentStrings.voidsetAttribute(java.lang.String name, java.lang.Object attrib)Deprecated.Sets an attribute, saving it as part of a RAS event.voidsetMessageEvent(boolean flag)Deprecated.Sets a flag that indicates whether this object is classified as a message event or a trace event.voidsetParameters(java.lang.String[] parms)Deprecated.Gets the text parameters:Stringsto be displayed with the message text.voidsetText(java.lang.String text)Deprecated.Sets the event text.voidsetTimeStamp(long timeStamp)Deprecated.Sets the time at which this event was created.voidsetType(long type)Deprecated.Sets the type of event: "informational message," for example.
-
-
-
Constructor Detail
-
RASEvent
public RASEvent()
Deprecated.Creates aRASEvent. The time stamp is generated at this time.- Parameters:
source- TheObjectwhich created this event.
-
RASEvent
public RASEvent(long type, java.lang.String text, java.lang.Object[] parms)Deprecated.Creates aRASEvent.- Parameters:
type- The message type.text- The message text, or a message key if the message file is notnull.parms- An array ofObjectsto be displayed with the message.
-
RASEvent
public RASEvent(long type, java.lang.String text, java.lang.String[] parms)Deprecated. UseRASEventinstead.Creates aRASEvent.- Parameters:
type- The message type.text- The message text, or a message key if the message file is notnull.parms- An array ofStringsto be displayed with the message.
-
-
Method Detail
-
objectsToStrings
protected static java.lang.String[] objectsToStrings(java.lang.Object[] parms)
Deprecated.Converts an array ofObjectsto an array of equivalentStrings.- Parameters:
parms- An array of objects to be converted to strings.- Returns:
- The equivalent array of strings.
-
getTimeStamp
public long getTimeStamp()
Deprecated.Gets the time at which this event was created.- Specified by:
getTimeStampin interfaceRASIEvent- Parameters:
timeStamp- The event time stamp, as generated bySystem.currentTimeMillis.
-
setTimeStamp
public void setTimeStamp(long timeStamp)
Deprecated.Sets the time at which this event was created. This value is expected to be of the format returned bySystem.currentTimeMillis.- Specified by:
setTimeStampin interfaceRASIEvent- Parameters:
timeStamp- The event time stamp.
-
getType
public long getType()
Deprecated.Gets the type of event: "informational message," for example. Specific types are defined by the classes which extendRASEvent. If a type is not defined, the default value of zero is returned.
-
setType
public void setType(long type)
Deprecated.Sets the type of event: "informational message," for example. Specific types are defined by the classes which extendRASEvent.
-
getText
public java.lang.String getText()
Deprecated.Gets the event text.
-
setText
public void setText(java.lang.String text)
Deprecated.Sets the event text. If the text isnull, the current text is not changed.
-
getParameters
public java.lang.String[] getParameters()
Deprecated.Gets the text parameters:Stringsto be displayed with the message text. If no parameters have been set,nullis returned.- Specified by:
getParametersin interfaceRASIEvent- Returns:
- The text parameters.
-
setParameters
public void setParameters(java.lang.String[] parms)
Deprecated.Gets the text parameters:Stringsto be displayed with the message text.- Specified by:
setParametersin interfaceRASIEvent- Parameters:
parms- The text parameters.
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
Deprecated.Gets an attribute that is saved as part of a RAS event.- Specified by:
getAttributein interfaceRASIEvent- Parameters:
name- The name of the attribute.- Returns:
- The attribute associated with the name or
nullif the named attribute was not found.
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object attrib)Deprecated.Sets an attribute, saving it as part of a RAS event. If the name or the attribute arenull, nothing is saved.- Specified by:
setAttributein interfaceRASIEvent- Parameters:
name- The name of the attribute.attrib- The attribute associated with the name.
-
setMessageEvent
public void setMessageEvent(boolean flag)
Deprecated.Sets a flag that indicates whether this object is classified as a message event or a trace event.- Specified by:
setMessageEventin interfaceRASIEvent- Parameters:
flag- Abooleansettrueif this object is a message event andfalseif it is a trace event.
-
isMessageEvent
public boolean isMessageEvent()
Deprecated.Determines if this object is a message event or a trace event.- Specified by:
isMessageEventin interfaceRASIEvent- Returns:
trueif this object is a message event andfalseif it is a trace event.
-
getSupportedTypes
public java.util.Hashtable getSupportedTypes()
Deprecated.Gets the complete set of event types supported by this class.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
Hashtablereturned by its parent.- Specified by:
getSupportedTypesin interfaceRASIEvent- Returns:
- A
Hashtablecontaining 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 asints, are returned asIntegersbecause of theHashtablerequirement that all elements beObjects.
-
maskLongValue
public long maskLongValue(java.lang.String types)
Deprecated.Converts aStringrepresentation of a message or trace mask to itslongequivalent. The string must have the following format:String types = "TYPE_INFO TYPE_WARN";
Unknown values in theStringare ignored.- Specified by:
maskLongValuein interfaceRASIEvent- Parameters:
types- The blank-delimitedStringto be converted.- Returns:
- The long equivalent of the
String, formed by the logical OR of each element in theString.
-
maskToString
public java.lang.String maskToString(long types)
Deprecated.Converts a long containing the logical OR of one or more event types to itsStringequivalent. 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
longare ignored.- Specified by:
maskToStringin interfaceRASIEvent- Parameters:
types- The message or trace mask.- Returns:
- The blank-delimited
Stringequivalent of the mask.
-
-