Solstice Enterprise Manager 4.1 Java API Reference | ![]() ![]() ![]() ![]() ![]() |
Java Alarms API
This chapter presents the classes that make up the Java Alarms Application Programming Interface.
This chapter comprises the following topics:
- Section 3.1 Overview
- Section 3.2 AlarmAttributeNotSetException Class
- Section 3.3 AlarmsBatchListener Interface
- Section 3.4 AlarmException Class
- Section 3.5 AlarmLogCreationListener Interface
- Section 3.6 AlarmLogDeletionListener Interface
- Section 3.7 AlarmLogEvent Class
- Section 3.8 AlarmLogListener Interface
- Section 3.9 AlarmLogModificationListener Interface
- Section 3.10 AlarmLog Class
- Section 3.11 AlarmRecord Class
- Section 3.12 AlarmRecordAttribute Class
- Section 3.13 AlarmRecordAttributeSet Class
- Section 3.14 AlarmRecordId Class
- Section 3.15 Filter Class
- Section 3.16 FilterItem Class
- Section 3.17 GenericQuery Class
- Section 3.18 LogicalCriteria Class
- Section 3.19 LogName Class
- Section 3.20 Query Interface
- Section 3.21 RelationCriteria Class
3.1 Overview
The Java Alarms API enables you to:
- Query alarms under a specific log
- Clear/acknowledge and set the attributes of a given alarm
- Query alarms in batches (to return alarms asynchronously)
- Delete alarms
- Register for alarm creation, modification, and deletion events
For information on how to use these APIs, see the Chapter 3 in Developing Java Applications book.
3.2 AlarmAttributeNotSetException Class
public class AlarmAttributeNotSetException
The com.sun.em.api.alarm.AlarmAttributeNotSetExcep tion class is used for exceptions thrown when the user tries to access fields in AlarmRecord that were not set.
3.2.1 Constructors
AlarmAttributeNotSetException
This is the class constructor for the exception.
public AlarmAttributeNotSetException(String message)AlarmAttributeNotSetException
This is the Class Constructor for the exception.
public AlarmAttributeNotSetException(Throwable t)3.3 AlarmsBatchListener Interface
public interface AlarmsBatchListener
The com.sun.em.api.alarm.AlarmsBatchListener interface provides notifications whenever a new batch is received or when the query is completed (that is, all batches have been received).
3.3.1 Methods
batchReceived
This method is called when a new batch is being received.
public void batchReceived(int callId,AlarmRecord record[])callId is the Integer returned when the batch call was initiated.
record is an array of AlarmRecord returned in this batch.
batchDone
This method is called when there are no more alarms to receive for that batch query.
public void batchDone(int callId)callId is the BatchId referencing the given batch.
3.4 AlarmException Class
The com.sun.em.api.alarm.AlarmException class wraps and hides Remote Method Invocation (RMI) exceptions to hide the transport layer. The exception is thrown when an error occurs in the underlying service or an exceptional condition exists on the server.
3.4.1 Inheritance
java.lang.Object|+--java.lang.Throwable|+--java.lang.Exception|+--java.io.IOException|+--java.rmi.RemoteException|+--com.sun.em.api.alarm.AlarmException3.4.2 Constructors
AlarmException
public AlarmException(String message)AlarmException
public AlarmException(Throwable t)3.5 AlarmLogCreationListener Interface
public interface AlarmLogCreationListener
An AlarmLogEvent event occurs whenever an alarm is being created, deleted, or modified. The com.sun.em.api.alarm.AlarmLogCreationListener< /font> interface allows you to be notified whenever an alarm is being created.
3.5.1 Methods
alarmRecordCreated
public void alarmRecordCreated(AlarmLogEvent event)3.6 AlarmLogDeletionListener Interface
public interface AlarmLogDeletionListener
An AlarmLogEvent event occurs whenever an alarm is being created, deleted or modified. The com.sun.em.api.alarm.AlarmLogDeletionListener< /font> interface allows you to be notified whenever an alarm is being deleted.
3.6.1 Methods
alarmRecordDeleted
public void alarmRecordDeleted(AlarmLogEvent event)3.7 AlarmLogEvent Class
extends Object implements Serializable
The com.sun.em.api.alarm.AlarmLogEvent class implements the events associated with creation, deletion of alarm records, and the modification of alarm record attributes.
3.7.1 Variables
OBJECT_CREATED
Type of the event being returned: OBJECT_CREATED for alarm creation.
public static final int OBJECT_CREATEDOBJECT_DELETED
Type of the event being returned: OBJECT_DELETED for alarm deletion.
public static final int OBJECT_DELETEDATTR_VALUE_CHANGED
Type of the event being returned: ATTR_VALUE_CHANGED for alarm modification.
public static final int ATTR_VALUE_CHANGEDALARM_EVENT_ID
String identifying the type of event.
public static final String ALARM_EVENT_ID3.7.2 Methods
getEventType
Returns the type of the event: OBJECT_CREATED, OBJECT_DELETED, ATTR_VALUE_CHANGED.
public int getEventType()getAlarmRecord
Returns the alarm record corresponding to the event.
public AlarmRecord getAlarmRecord()getAlarmRecordId
Returns the alarm record ID corresponding to the event.
public AlarmRecordId getAlarmRecordId()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if AlarmRecordId was not set in the initial AlarmRecordAttributeSet list.
toString
Returns a String containing String representation of the event type and the alarm record.
public String toString()Overrides toString in class Object.
toTypeString
Returns a String representation of the event type.
public String toTypeString()3.8 AlarmLogListener Interface
public interface AlarmLogListener
An AlarmLogEvent event occurs whenever an alarm is being created, deleted or modified. The com.sun.em.api.alarm.AlarmLogListener interface allows you to be notified whenever an alarm is being created, deleted, or modified.
3.8.1 Methods
alarmRecordCreated
public void alarmRecordCreated(AlarmLogEvent event)alarmRecordDeleted
public void alarmRecordDeleted(AlarmLogEvent event)alarmRecordModified
public void alarmRecordModified(AlarmLogEvent event)3.9 AlarmLogModificationListener Interface
public interface AlarmLogModificationListener
An AlarmLogEvent event occurs whenever an alarm is being created, deleted or modified. The com.sun.em.api.alarm.AlarmLogModificationListe ner interface allows you to be notified whenever an alarm is being modified.
3.9.1 Methods
alarmRecordModified
public void alarmRecordModified(AlarmLogEvent event)3.10 AlarmLog Class
The com.sun.em.api.alarm.AlarmLog class represents an alarm instantiation which enables the user to query, clear, acknowledge, delete alarms and receive event notifications.
3.10.1 Constructors
AlarmLog
Creates an instance of AlarmLog by specifying the log where the alarms are stored.
public AlarmLog(Platform platform,LogName logN)
throws AlarmExceptionplatform is the platform for the alarm Service.
logN is the object that contains the name of the log.
Throws AlarmException if there is an internal error in the alarm service.
3.10.2 Methods
Returns under which log the alarms are stored.
public LogName getLogName() throws AlarmExceptionsetEventAttrSet
Specify which attributes are to be returned when receiving events.
public void setEventAttrSet(AlarmRecordAttributeSet attrSet1)
throws AlarmExceptionattrSet1 is the list of attributes to be returned.
See Also: AlarmRecordAttributeSet
Gets a batch of alarms in the Alarm Log. The user will receive all alarms matching the given query in chunks. Each chunk will contain the batchSize number of alarms. The attrSet variable specifies which attributes to get back in the alarmRecord.
public int getAlarmsInBatches
(Query query,int batchSize,AlarmsBatchListener listener,
AlarmRecordAttributeSet attrSet)
throws AlarmExceptionquery finds the alarms that match this query.
batchSize gets at most this many alarms in a chunk.
listener applies to the batch response.
attrSet specifies which attributes to get back in the alarmRecord.
Returns a handle that can be used to stop this call.
See Also: AlarmsBatchListener, AlarmRecordAttributeSet
stopGetAlarmsInBatches
Stops a call to get a batch of alarms in the Alarm Log.
public void stopGetAlarmsInBatches(int callId)
throws AlarmExceptioncallId is the handle from getAlarmsInBatches.
getAlarms
Returns all alarms that match the query.
public AlarmRecord[]
getAlarms(Query query,AlarmRecordAttributeSet attrSet)
throws AlarmExceptionquery is used to find the alarms that match this query.
attrSet specifies which AlarmRecord attributes to retrieve.
Returns an array of AlarmRecord. It can be null if no records are found.
getAlarmCount
Returns the count of alarms that match the query.
public int getAlarmCount(Query query) throws AlarmExceptionquery is used to find the alarms that match this query.
attrSet specifies which AlarmRecord attributes to retrieve.
Returns array of AlarmRecord. It can be null if no records are found.
getAlarmCountBySeverity
Returns an Integer array that contains the count of alarm per severity.
public int[] getAlarmCountBySeverity
(MOName moName[],EMSeverity severity[])
throws AlarmExceptionMOName gets the alarm severities for these managed objects.
severity specifies the severities.
Returns: Array of Integer containing the count of alarm per severity.
setClearAlarms
Clears the alarms against the given alarm records.
public void setClearAlarms
(AlarmRecordId alarmRecordIds[], String clearText[])
throws AlarmExceptionalarmRecordIds is the array of alarms to clear.
String is the text to display in the ClearText attribute field of the cleared alarm.
setAckAlarms
Acknowledges the alarms corresponding to the given alarm records.
public void setAckAlarms
(AlarmRecordId alarmRecordIds[], String ackText[])
throws AlarmExceptionalarmRecordIds is the array of alarms to acknowledge.
String is the text to display in the ackText attribute field of the acknowledged alarm.
setDisplayAlarms
Indicates which alarm records should be displayed.
public void setDisplayAlarms
(AlarmRecordId alarmRecordIds[], String displayText[])
throws AlarmExceptionalarmRecordIds is the array of alarms to display.
String is the text to display in the ackText attribute field of the acknowledged alarm.
setUnAckAlarms
Unacknowledge the alarms corresponding to the given alarm records.
public void setUnAckAlarms(AlarmRecordId alarmRecordIds[])
throws AlarmExceptionalarmRecordIds is the array of alarms to unacknowledged.
setUnClearAlarms
Unclears the alarms corresponding to the given alarm records.
public void setUnClearAlarms(AlarmRecordId alarmRecordIds[])
throws AlarmExceptionalarmRecordIds is the array of alarms to unclear.
setUnDisplayAlarms
Undisplays the alarms corresponding to the given alarm records.
public void setUnDisplayAlarms(AlarmRecordId alarmRecordIds[]) throws AlarmExceptionalarmRecordIds is the array of alarms to undisplay.
sendClearAlarmsEvent
Sends a clear alarm event for the given alarm records.
public void sendClearAlarmsEvent(AlarmRecordId alarmRecordIds[])
throws AlarmExceptionalarmRecordIds is the array of alarms to clear.
deleteAlarms
Delete the given alarm records from the persistent store.
public void deleteAlarms(AlarmRecordId alarmRecordIds[])
throws AlarmExceptionalarmRecordIds is the array of alarms to delete.
addAlarmLogCreationListener
Registers for alarm log creation events.
public void addAlarmLogCreationListener
(AlarmLogCreationListener l) throws AlarmExceptionl is the listener for AlarmLogEvent creation.
See Also: AlarmLogCreationListener
removeAlarmLogCreationListener
Deregisters for alarm log creation events.
public void removeAlarmLogCreationListener
(AlarmLogCreationListener l) throws AlarmExceptionl is the listener for AlarmLogEvent creation to unregister.
See Also: AlarmLogCreationListener
addAlarmLogDeletionListener
Registers to receive an event when the alarm log is deleted.
public void addAlarmLogDeletionListener
(AlarmLogDeletionListener l) throws AlarmExceptionl is the listener for AlarmLogEvent deletion to be removed.
See Also: AlarmLogDeletionListener
removeAlarmLogDeletionListener
Deregisters from receiving an event when the alarm log is deleted.
public void removeAlarmLogDeletionListener
(AlarmLogDeletionListener l) throws AlarmExceptionl is the listener for AlarmLogEvent deletion to be removed.
See Also: AlarmLogDeletionListener
addAlarmLogModificationListener
Registers to receive an event when the alarm log is modified.
public void addAlarmLogModificationListener
(AlarmLogModificationListener l) throws AlarmExceptionl is the listener for AlarmLogEvent modification.
removeAlarmLogModificationListener
Deregisters from receiving an event when the alarm log is modified.
public void removeAlarmLogModificationListener
(AlarmLogModificationListener l) throws AlarmExceptionl is the listener for AlarmLogEvent modification to be removed.
addAlarmLogListener
Register to receive an event when the alarm log is modified.
public void addAlarmLogListener(AlarmLogListener l)
throws AlarmExceptionl is the listener for AlarmLogEvent. Can be creation, deletion or modification.
removeAlarmLogListener
Deregisters to receive an event when the alarm log is modified.
public void removeAlarmLogListener(AlarmLogListener l)
throws AlarmExceptionl is the listener for AlarmLogEvent to be removed.
3.11 AlarmRecord Class
extends LogRecord implements Serializable
The com.sun.em.api.alarm.AlarmRecord class implements the alarm record. It provides methods to retrieve the attribute values of an alarm record.
3.11.1 Inheritance
java.lang.Object|+----com.sun.em.api.log.LogRecord|+----com.sun.em.api.alarm.AlarmRecord
Note LogRecord is an empty class. Basically an AlarmRecord inherits from LogRecord for some basic attributes but right now this is an empty class.
3.11.2 Methods
getAttrSet
Returns the attributes that have been set in the AlarmRecord. This method is used in case of events. Some events do not contain all attributes. This flag indicates which attributes are present.
public AlarmRecordAttributeSet getAttrSet()See Also: AlarmRecordAttributeSet
getLogName
Returns the container alarm log of the alarm record.
public LogName getLogName() throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if LogName was not set in the initial AlarmRecordAttributeSet.
getAckOperator
Returns the user ID of the operator who acknowledged the alarm.
public String getAckOperator()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if AckOperator was not set in the initial AlarmRecordAttributeSet.
getAckState
Returns a boolean indicating whether the alarm has been acknowledged or not. If the boolean is set to true, the alarm has been acknowledged.
public boolean getAckState()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if AckState was not set in the initial AlarmRecordAttributeSet.
getAckText
Returns any description entered by the operator who acknowledged the alarm.
public String getAckText() throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if AckText was not set in the initial AlarmRecordAttributeSet.
getAdditionalText
Returns the additionalText attribute which is part of the AlarmRecord.
public String getAdditionalText()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if AdditionalText was not set in the initial AlarmRecordAttributeSet.
getAckTime
Returns the date and time when the alarm was acknowledged.
public Date getAckTime() throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if AckTime was not set in the initial AlarmRecordAttributeSet.
getClearOperator
Returns the user ID of the operator who cleared the alarm.
public String getClearOperator()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if ClearOperator was not set in the initial AlarmRecordAttributeSet.
getClearState
Returns a boolean indicating whether the alarm has been cleared or not. If the boolean is set to true, the alarm has been cleared.
public boolean getClearState()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if ClearState was not set in the initial AlarmRecordAttributeSet.
getClearText
Returns any description entered by the operator when the alarm was cleared.
public String getClearText()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if ClearText was not set in the initial AlarmRecordAttributeSet.
getClearTime
Returns the date and time when the alarm was cleared.
public Date getClearTime() throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if ClearTime was not set in the initial AlarmRecordAttributeSet.
getDisplayOperator
Returns the user ID of the operator who changed the display state of the alarm.
public String getDisplayOperator()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if DisplayOperator was not set in the initial AlarmRecordAttributeSet.
getDisplayState
Returns a boolean indicating whether the alarm displayed or not. If the boolean has been set to true, the alarm has been set to displayed.
public boolean getDisplayState()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if DisplayState was not set in the initial AlarmRecordAttributeSet.
getDisplayText
Returns any description entered by the operator when the alarm display state is changed.
public String getDisplayText()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if DisplayText was not set in the initial AlarmRecordAttributeSet.
getDisplayTime
Returns the date and time when the operator last changed the display state of the alarm.
public Date getDisplayTime()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if DisplayTime was not set in the initial AlarmRecordAttributeSet.
getEventTime
Returns the date and time when the corresponding alarm was generated.
public Date getEventTime() throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if EventTime was not set in the initial AlarmRecordAttributeSet.
getEventType
Returns the event type that created this alarm record.
public String getEventType()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if EventType was not set in the initial AlarmRecordAttributeSet.
getLogRecordId
Returns the ID of this alarm record.
public AlarmRecordId getLogRecordId()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if LogRecordId was not set in the initial AlarmRecordAttributeSet.
getLoggingTime
Returns the date and time when the event was logged.
public Date getLoggingTime()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if loggingTime was not set in the initial AlarmRecordAttributeSet.
getManagedObjectInstance
Returns the managed object instance of the device that generated the alarm.
public MOName getManagedObjectInstance()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if ManagedObjectInstance was not set in the initial AlarmRecordAttributeSet.
getPerceivedSeverity
Returns the severity of the alarm.
public EMSeverity getPerceivedSeverity()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if PerceivedSeverity was not set in the initial AlarmRecordAttributeSet.
getProbableCause
Returns the probable cause of the alarm.
public String getProbableCause()
throws AlarmAttributeNotSetExceptionThrows AlarmAttributeNotSetException if ProbableCause was not set in the initial AlarmRecordAttributeSet .
toString
Returns a String representation of the fields that have been set in the alarm record. Note that this prints out only the fields that have been requested.
public String toString()Overrides toString in class Object
See Also: AlarmRecordAttributeSet
3.12 AlarmRecordAttribute Class
public class AlarmRecordAttribute
extends EMObjectAttribute implements Serializable
The com.sun.em.api.alarm.AlarmRecordAttribute class represents a single attribute of the AlarmRecord object.
3.12.1 Inheritance
java.lang.Object|+----com.sun.em.api.common.EMObjectAttribute|+----com.sun.em.api.alarm.AlarmRecordAttribute
Note EMObjectAttribute is also being used in the Topology API. It is part of the common API directory. It represents any attribute of a given object. An attribute is represented by an ID.
3.12.2 Variables
ACK_OPERATOR
AlarmRecordAttribute for ACK_OPERATOR field
public static final AlarmRecordAttribute ACK_OPERATORACK_STATE
AlarmRecordAttribute for ACK_STATE field
public static final AlarmRecordAttribute ACK_STATEACK_TEXT
AlarmRecordAttribute for ACK_TEXT field
public static final AlarmRecordAttribute ACK_TEXTACK_TIME
AlarmRecordAttribute for ACK_TIME field
public static final AlarmRecordAttribute ACK_TIMECLEAR_OPERATOR
AlarmRecordAttribute for CLEAR_OPERATOR field
public static final AlarmRecordAttribute CLEAR_OPERATORCLEAR_STATE
AlarmRecordAttribute for CLEAR_STATE field
public static final AlarmRecordAttribute CLEAR_STATECLEAR_TEXT
AlarmRecordAttribute for CLEAR_TEXT field
public static final AlarmRecordAttribute CLEAR_TEXTCLEAR_TIME
AlarmRecordAttribute for CLEAR_TIME field
public static final AlarmRecordAttribute CLEAR_TIMEDISPLAY_OPERATOR
AlarmRecordAttribute for DISPLAY_OPERATOR field
public static final AlarmRecordAttribute DISPLAY_OPERATORDISPLAY_STATE
AlarmRecordAttribute for DISPLAY_STATE field
public static final AlarmRecordAttribute DISPLAY_STATEDISPLAY_TEXT
AlarmRecordAttribute for DISPLAY_TEXT field
public static final AlarmRecordAttribute DISPLAY_TEXTDISPLAY_TIME
AlarmRecordAttribute for DISPLAY_TIME field
public static final AlarmRecordAttribute DISPLAY_TIMEEVENT_TIME
AlarmRecordAttribute for EVENT_TIME field
public static final AlarmRecordAttribute EVENT_TIMEEVENT_TYPE
AlarmRecordAttribute for EVENT_TYPE field
public static final AlarmRecordAttribute EVENT_TYPELOGGING_TIME
AlarmRecordAttribute for LOGGING_TIME field
public static final AlarmRecordAttribute LOGGING_TIMELOG_RECORD_ID
AlarmRecordAttribute for LOG_RECORD_ID field
public static final AlarmRecordAttribute LOG_RECORD_IDSee Also: LogRecord, LogRecordId
MANAGED_OBJECT_INSTANCE
AlarmRecordAttribute for MANAGED_OBJECT_INSTANCE field
public static final AlarmRecordAttribute MANAGED_OBJECT_INSTANCEPERCEIVED_SEVERITY
AlarmRecordAttribute for PERCEIVED_SEVERITY field
public static final AlarmRecordAttribute PERCEIVED_SEVERITYSee Also: LogRecord, EMSeverity
PROBABLE_CAUSE
AlarmRecordAttribute for PROBABLE_CAUSE field
public static final AlarmRecordAttribute PROBABLE_CAUSEADDITIONAL_TEXT
AlarmRecordAttribute for ADDITIONAL_TEXT field
public static final AlarmRecordAttribute ADDITIONAL_TEXTLOG_NAME
AlarmRecordAttribute for LOG_NAME field
public static final AlarmRecordAttribute LOG_NAMEMIS_NAME
AlarmRecordAttribute for MIS_NAME field
public static final AlarmRecordAttribute MIS_NAME3.12.3 Methods
toString
Returns a String representation of the AlarmRecordAttribute.
public String toString()Returns the String representation.
Overrides toString in class EMObjectAttribute.
getColumnName
Returns a String representation of the AlarmRecordAttribute.
public String getColumnName()Returns the String representation.
3.13 AlarmRecordAttributeSet Class
public class AlarmRecordAttributeSet
extends EMAttributeSet implements Cloneable, Serializable
The com.sun.em.api.alarm.AlarmRecordAttributeSet font> class implements an abstract class which forms the basis for the attributes set classes of each AlarmRecord. AlarmRecordAttributeSet is used in the Alarm API to communicate which attributes of the AlarmRecord must be returned.
3.13.1 Inheritance
java.lang.Object|+----com.sun.em.api.common.EMAttributeSet|+----com.sun.em.api.alarm.AlarmRecordAttributeSet3.13.2 Constructors
AlarmRecordAttributeSet
Creates an AlarmRecordAttributeSet which contains no attributes.
public AlarmRecordAttributeSet()3.13.3 Methods
clone
Returns a clone of this AlarmRecordAttributeSet object.
public Object clone()Returns a clone of this AlarmRecordAttributeSet.
Overrides clone in class EMAttributeSet.
elements
Returns an enumeration of the attributes in this set.
public Enumeration elements()Overrides elements in class EMAttributeSet.
3.14 AlarmRecordId Class
Extends Object implements Cloneable and Serializable.
An alarmRecord is uniquely identified with its AlarmRecordId and the LogName associated to it. The com.sun.em.api.alarm.AlarmRecordId is a unique identifier.
3.14.1 Constructors
AlarmRecordId
Construct using an Integer identifier.
public AlarmRecordId(int alarmId)3.14.2 Methods
getAlarmFullName
Returns the name of the logRecordId prepended with the choice String.
public String getAlarmFullName()clone
public Object clone()Overrides clone in class Object.
toString
Returns the name of the logRecordId.
public String toString()Overrides toString in class Object.
equals
Returns true if obj matches self, otherwise returns false.
public boolean equals(Object obj)Overrides equals in class Object.
3.15 Filter Class
extends Object implements Serializable
The com.sun.em.api.alarm.Filter class implements an alarm filter. An alarm filter is constructed by combining LogicalCriteria with a list of FilterItem.
See Also: LogicalCriteria, FilterItem
3.15.1 Constructors
Filter
This is the class constructor. An alarm filter is constructed by combining a LogicalCriteria with a FilterItem.
public Filter(LogicalCriteria op,FilterItem filterItem)Filter
This is the class constructor. An alarm filter is constructed by combining the default logical operator with the filterItem. The default logical operator is AND.
public Filter(FilterItem filterItem)3.15.2 Methods
setLogicalCriteria
Specifies the default logical operator to use in the query.
public void setLogicalCriteria(LogicalCriteria op)getLogicalCriteria
Get the default logical operator used in the query.
public LogicalCriteria getLogicalCriteria()logicalOp is the LogicalCriteria.
addFilterItem
Adds a filter element to the query.
public void addFilterItem(FilterItem filterItem)removeFilterItem
Removes a filter element from the query.
public boolean removeFilterItem(FilterItem filterItem)clear
Clears the query by removing all filter elements.
public void clear()elements
Returns an enumeration of the filter elements present in the query.
public Enumeration elements()toString
Returns a String representation of the query.
public String toString()Overrides toString in class Object.
3.16 FilterItem Class
extends Object implements Serializable
The com.sun.em.api.alarm.FilterItem class implements a FilterItem that represents a condition in a query. A condition comprises an attribute name, a relational operator, and one or more attribute values. Conditions are combined with a logical operator (AND or OR) to build a query.
3.16.1 Constructors
FilterItem
Constructs a FilterItem to filter alarms based on alarm severity attribute.
public FilterItem
(AlarmRecordAttribute name,RelationCriteria rel,
EMSeverity value[])
throws AlarmExceptionname is the AlarmRecordAttribute.PERCEIVED_SEVERITY .
See Also: AlarmRecordAttribute, RelationCriteria, EMSeverity
FilterItem
Constructs a FilterItem to filter alarms based on event time, log time, clear time, acknowledge time, or display time attribute.
public FilterItem
(AlarmRecordAttribute name,RelationCriteria rel,Date value)
throws AlarmExceptionname is the AlarmRecordAttribute: eventTime, loggingTime, clearTime, ackTime, displayTime.
value is the date to query on.
See Also: AlarmRecordAttribute, RelationCriteria
FilterItem
Constructs a FilterItem to filter alarms based on the Managed Object Name attribute.
public FilterItem(AlarmRecordAttribute name,RelationCriteria< br> rel,MOName value[])
throws AlarmExceptionname is the AlarmRecordAttribute.MANAGED_OBJECT_INSTANCE font>.
rel is the RelationCriteria: EQUAL or NOT_EQUAL.
value is the list of MOName to query on.
See Also: AlarmRecordAttribute, RelationCriteria, MOName
FilterItem
Constructs a FilterItem to filter alarms based on any String-format attribute, (should be part of DISPLAY_OPERATOR, ACK_OPERATOR, CLEAR_OPERATOR, DISPLAY_TEXT, ACK_TEXT, or CLEAR_TEXT).
public FilterItem
(AlarmRecordAttribute name,RelationCriteria rel,String value[])
throws AlarmExceptionrel is the RelationCriteria: EQUAL or NOT_EQUAL.
value is the list of value in String format.
See Also: AlarmRecordAttribute, RelationCriteria
FilterItem
Constructs a FilterItem to filter alarms based on the Log Record ID.
public FilterItem
(AlarmRecordAttribute name,RelationCriteria rel,
AlarmRecordId value[])
throws AlarmExceptionname is the AlarmRecordAttribute.LOG_RECORD_ID.
value is the list of AlarmRecordIds.
See Also: AlarmRecordAttribute, RelationCriteria, AlarmRecordId
FilterItem
Constructs a FilterItem to filter alarms based on the acknowledge, clear, or display state.
public FilterItem
(AlarmRecordAttribute name,RelationCriteria rel,
Boolean value)
throws AlarmExceptionname is the AlarmRecordAttribute: ACK_STATE, CLEAR_STATE, or DISPLAY_STATE.
See Also: AlarmRecordAttribute, RelationCriteria
3.16.2 Methods
getAttrName
Returns the attribute name of the FilterItem.
public AlarmRecordAttribute getAttrName()See Also: AlarmRecordAttribute
getRelation
Returns the relational operator of the FilterItem.
public RelationCriteria getRelation()getAttrValue
Returns an array of the attribute values of the FilterItem.
public Object[] getAttrValue()toString
Returns a String representation of the attribute name, the relation operator, and the attribute value(s).
public String toString()Overrides toString in class Object.
3.17 GenericQuery Class
extends Object implements Serializable, Query
The com.sun.em.api.alarm.GenericQuery class implements a generic alarm filter or query. An alarm filter is constructed by combining LogicalCriteria with a Filter.
3.17.1 Constructors
GenericQuery
The default class constructor using the AND logical operator for the query.
public GenericQuery()GenericQuery
The class constructor. A generic query is constructed by combining a LogicalCriteria with a filter.
public GenericQuery(LogicalCriteria op,Filter filter)See Also: LogicalCriteria, Filter
GenericQuery
The class constructor. A generic query is constructed by combining the default logical operator with the filter. The default logical operator is AND.
public GenericQuery(Filter filter)3.17.2 Methods
addFilter
Adds a filter element to the query.
public void addFilter(Filter filter)setLogicalCriteria
Specifies the default logical operator to use in the query.
public void setLogicalCriteria(LogicalCriteria log)getLogicalCriteria
Gets the default logical operator used in the query.
public LogicalCriteria getLogicalCriteria()removeFilter
Removes a filter element from the query.
public boolean removeFilter(Filter filter)clear
Clears the query by removing all filter elements.
public void clear()elements
Returns an enumeration of the filter elements present in the query.
public Enumeration elements()toString
Returns a String representation of the query.
public String toString()Overrides toString in class Object.
3.18 LogicalCriteria Class
extends EMObjectAttribute implements Serializable
The com.sun.em.api.alarm.LogicalCriteria class implements the logical operator used to combine the Filter conditions. The logical operators are AND and OR.
3.18.1 Variables
OR
Logical Criteria can be OR.
public static final LogicalCriteria ORAND
Logical Criteria can be AND
.
public static final LogicalCriteria AND3.18.2 Methods
toString
Gets the String representation of the logical operator indexed by ID.
public String toString()Returns the String representation of the logical operator.
Overrides toString in class EMObjectAttribute.
3.19 LogName Class
extends Object implements Serializable
The com.sun.em.api.alarm.LogName class implements the name of the alarm log.
3.19.1 Variables
STRING
public static final String STRINGNUMBER
public static final String NUMBER3.19.2 Constructors
LogName
Creates an instance of LogName by specifying the MIS name and the log name as a String format.
public LogName(String mis,String log)mis is the name of the MIS that contains the log.
log is the name of the log. The log name is a choice between a String and an Integer format. This example is the String format.
LogName
Creates an instance of LogName by specifying the MIS name and the log name as an Integer format.
public LogName(String mis,Integer log)mis is the name of the MIS that contains the log.
log is the name of the log. The LogName is a choice between a String and an Integer format. This example is the Integer format.
LogName
public LogName(String mis,int log)3.19.3 Methods
getMisName
Returns the name of the MIS of the alarm log.
public String getMisName()getLogName
Returns the name of the alarm log.
public Object getLogName()getFullLogName
Returns the name of the alarm log as a fully distinguished name (fdn).
public String getFullLogName()equals
Tests for equality of alarm logs.
public boolean equals(Object obj)Returns true if obj matches self, otherwise returns false.
Overrides equals in class Object.
toString
Returns the name of the log in String format. This does not contain the MIS name.
public String toString()Overrides toString in class Object.
3.20 Query Interface
The com.sun.em.api.alarm.Query interface is empty.
3.21 RelationCriteria Class
extends EMObjectAttribute implements Serializable
The com.sun.em.api.alarm.RelationCriteria class implements a RelationCriteria or relation operator. RelationCriteria is used in building a FilterItem.
3.21.1 Variables
EQUAL
RelationCriteria can be EQUAL.
public static final RelationCriteria EQUALNOT_EQUAL
RelationCriteria can be NOT_EQUAL.
public static final RelationCriteria NOT_EQUALGREATER_THAN
RelationCriteria can be GREATER_THAN.
public static final RelationCriteria GREATER_THANGREATER_THAN_OR_EQUAL
RelationCriteria can be GREATER_THAN_OR_EQUAL.
public static final RelationCriteria GREATER_THAN_OR_EQUALLESS_THAN
RelationCriteria can be LESS_THAN.
public static final RelationCriteria LESS_THANLESS_THAN_OR_EQUAL
RelationCriteria can be LESS_THAN_OR_EQUAL.
public static final RelationCriteria LESS_THAN_OR_EQUAL3.21.2 Methods
toString
Returns a String representation of the relational operator.
public String toString()
Sun Microsystems, Inc. Copyright information. All rights reserved. |
Doc Set | Contents | Previous | Next | Index |