Solstice Enterprise Manager 4.1 Java API Reference Doc Set ContentsPreviousNextIndex


Chapter 3

Java Alarms API

This chapter presents the classes that make up the Java Alarms Application Programming Interface.

This chapter comprises the following topics:

3.1 Overview

The Java Alarms API enables you to:

For information on how to use these APIs, see the Chapter 3 in Developing Java Applications book.

3.2 AlarmAttributeNotSetException Class

public class AlarmAttributeNotSetException

extends throwable

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.

Returns none.

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.

Returns none.

3.4 AlarmException Class

public class AlarmException

extends RemoteException

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.AlarmException

3.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.

See Also: AlarmLogEvent

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.

See Also: AlarmLogEvent

3.6.1 Methods

alarmRecordDeleted

public void alarmRecordDeleted(AlarmLogEvent event)

3.7 AlarmLogEvent Class

public class AlarmLogEvent

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_CREATED

OBJECT_DELETED

Type of the event being returned: OBJECT_DELETED for alarm deletion.

public static final int 
OBJECT_DELETED

ATTR_VALUE_CHANGED

Type of the event being returned: ATTR_VALUE_CHANGED for alarm modification.

public static final int ATTR_VALUE_CHANGED

ALARM_EVENT_ID

String identifying the type of event.

public static final String ALARM_EVENT_ID

3.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()

See Also: AlarmRecord

getAlarmRecordId

Returns the alarm record ID corresponding to the event.

public AlarmRecordId 
getAlarmRecordId() 
throws AlarmAttributeNotSetException

Throws AlarmAttributeNotSetException if AlarmRecordId was not set in the initial AlarmRecordAttributeSet list.

See Also: AlarmRecordId

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.

See Also: AlarmLogEvent

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.

See Also: AlarmLogEvent

3.9.1 Methods

alarmRecordModified

public void alarmRecordModified(AlarmLogEvent event)

3.10 AlarmLog Class

public class AlarmLogSvc

extends Log

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 AlarmException

platform 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.

See Also: LogName

3.10.2 Methods

getLogName

Returns under which log the alarms are stored.

public LogName getLogName() 
throws AlarmException

Returns the LogName.

setEventAttrSet

Specify which attributes are to be returned when receiving events.

public void setEventAttrSet(AlarmRecordAttributeSet attrSet1)
throws AlarmException

attrSet1 is the list of attributes to be returned.

Returns nothing.

See Also: AlarmRecordAttributeSet

getAlarmsInBatches

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 AlarmException

query 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 AlarmException

callId is the handle from getAlarmsInBatches.

Returns nothing.

getAlarms

Returns all alarms that match the query.

public AlarmRecord[] 
getAlarms(Query query,AlarmRecordAttributeSet attrSet)
throws AlarmException

query 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.

See Also: AlarmRecord

getAlarmCount

Returns the count of alarms that match the query.

public int getAlarmCount(Query 
query) 
throws AlarmException

query 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.

See Also: AlarmRecord

getAlarmCountBySeverity

Returns an Integer array that contains the count of alarm per severity.

public int[] getAlarmCountBySeverity
(MOName moName[],EMSeverity severity[])
throws AlarmException

MOName gets the alarm severities for these managed objects.

severity specifies the severities.

Returns: Array of Integer containing the count of alarm per severity.

See Also: MOName, EMSeverity

setClearAlarms

public void setClearAlarms
(AlarmRecordId alarmRecordIds[], String clearText[])
throws AlarmException

Clears the alarms against the given alarm records.

alarmRecordIds is the array of alarms to clear.

String is the text to display in the ClearText attribute field of the cleared alarm.

See Also: AlarmRecordId

setAckAlarms

Acknowledges the alarms corresponding to the given alarm records.

public void setAckAlarms 
(AlarmRecordId alarmRecordIds[], String ackText[])
throws AlarmException

alarmRecordIds is the array of alarms to acknowledge.

String is the text to display in the ackText attribute field of the acknowledged alarm.

See Also: AlarmRecordId

setDisplayAlarms

Indicates which alarm records should be displayed.

public void setDisplayAlarms
(AlarmRecordId alarmRecordIds[], String displayText[])
throws AlarmException

alarmRecordIds is the array of alarms to display.

String is the text to display in the ackText attribute field of the acknowledged alarm.

See Also: AlarmRecordId

setUnAckAlarms

Unacknowledge the alarms corresponding to the given alarm records.

public void setUnAckAlarms(AlarmRecordId alarmRecordIds[])
throws AlarmException

alarmRecordIds is the array of alarms to unacknowledged.

See Also: AlarmRecordId

setUnClearAlarms

Unclears the alarms corresponding to the given alarm records.

public void setUnClearAlarms(AlarmRecordId alarmRecordIds[])
throws AlarmException

alarmRecordIds is the array of alarms to unclear.

See Also: AlarmRecordId

setUnDisplayAlarms

Undisplays the alarms corresponding to the given alarm records.

public void setUnDisplayAlarms(AlarmRecordId alarmRecordIds[]) 
throws AlarmException

alarmRecordIds is the array of alarms to undisplay.

See Also: AlarmRecordId

sendClearAlarmsEvent

Sends a clear alarm event for the given alarm records.

public void sendClearAlarmsEvent(AlarmRecordId alarmRecordIds[])
throws AlarmException

alarmRecordIds is the array of alarms to clear.

See Also: AlarmRecordId

deleteAlarms

Delete the given alarm records from the persistent store.

public void deleteAlarms(AlarmRecordId alarmRecordIds[]) 
throws AlarmException

alarmRecordIds is the array of alarms to delete.

See Also: AlarmRecordId

addAlarmLogCreationListener

Registers for alarm log creation events.

public void addAlarmLogCreationListener
(AlarmLogCreationListener l) throws AlarmException

l is the listener for AlarmLogEvent creation.

See Also: AlarmLogCreationListener

removeAlarmLogCreationListener

Deregisters for alarm log creation events.

public void removeAlarmLogCreationListener
(AlarmLogCreationListener l) throws AlarmException

l 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 AlarmException

l 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 AlarmException

l 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 AlarmException

l is the listener for AlarmLogEvent modification.

See Also: AlarmLogEvent

removeAlarmLogModificationListener

Deregisters from receiving an event when the alarm log is modified.

public void removeAlarmLogModificationListener
(AlarmLogModificationListener l) throws AlarmException

l is the listener for AlarmLogEvent modification to be removed.

See Also: AlarmLogEvent

addAlarmLogListener

Register to receive an event when the alarm log is modified.

public void addAlarmLogListener(AlarmLogListener l)
throws AlarmException

l is the listener for AlarmLogEvent. Can be creation, deletion or modification.

See Also: AlarmLogEvent

removeAlarmLogListener

Deregisters to receive an event when the alarm log is modified.

public void removeAlarmLogListener(AlarmLogListener l)
throws AlarmException

l is the listener for AlarmLogEvent to be removed.

See Also: AlarmLogEvent

3.11 AlarmRecord Class

public class AlarmRecord

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 AlarmAttributeNotSetException

Returns LogName.

Throws 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 AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws AlarmAttributeNotSetException if EventTime was not set in the initial AlarmRecordAttributeSet.

getEventType

Returns the event type that created this alarm record.

public String getEventType() 
throws AlarmAttributeNotSetException

Throws AlarmAttributeNotSetException if EventType was not set in the initial AlarmRecordAttributeSet.

getLogRecordId

Returns the ID of this alarm record.

public AlarmRecordId 
getLogRecordId() 
throws AlarmAttributeNotSetException

Throws AlarmAttributeNotSetException if LogRecordId was not set in the initial AlarmRecordAttributeSet.

See Also: AlarmRecordId

getLoggingTime

Returns the date and time when the event was logged.

public Date getLoggingTime() 
throws AlarmAttributeNotSetException

Throws 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 AlarmAttributeNotSetException

Throws AlarmAttributeNotSetException if ManagedObjectInstance was not set in the initial AlarmRecordAttributeSet.

See Also: MOName

getPerceivedSeverity

Returns the severity of the alarm.

public EMSeverity getPerceivedSeverity() 
throws AlarmAttributeNotSetException

Throws AlarmAttributeNotSetException if PerceivedSeverity was not set in the initial AlarmRecordAttributeSet.

See Also: EMSeverity

getProbableCause

Returns the probable cause of the alarm.

public String getProbableCause() 
throws AlarmAttributeNotSetException

Throws 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_OPERATOR

See Also: LogRecord

ACK_STATE

AlarmRecordAttribute for ACK_STATE field

public static final AlarmRecordAttribute ACK_STATE

See Also: LogRecord

ACK_TEXT

AlarmRecordAttribute for ACK_TEXT field

public static final AlarmRecordAttribute ACK_TEXT

See Also: LogRecord

ACK_TIME

AlarmRecordAttribute for ACK_TIME field

public static final AlarmRecordAttribute ACK_TIME

See Also: LogRecord

CLEAR_OPERATOR

AlarmRecordAttribute for CLEAR_OPERATOR field

public static final AlarmRecordAttribute CLEAR_OPERATOR

See Also: LogRecord

CLEAR_STATE

AlarmRecordAttribute for CLEAR_STATE field

public static final AlarmRecordAttribute CLEAR_STATE

See Also: LogRecord

CLEAR_TEXT

AlarmRecordAttribute for CLEAR_TEXT field

public static final AlarmRecordAttribute CLEAR_TEXT

See Also: LogRecord

CLEAR_TIME

AlarmRecordAttribute for CLEAR_TIME field

public static final AlarmRecordAttribute CLEAR_TIME

See Also: LogRecord

DISPLAY_OPERATOR

AlarmRecordAttribute for DISPLAY_OPERATOR field

public static final AlarmRecordAttribute DISPLAY_OPERATOR

See Also: LogRecord

DISPLAY_STATE

AlarmRecordAttribute for DISPLAY_STATE field

public static final AlarmRecordAttribute DISPLAY_STATE

See Also: LogRecord

DISPLAY_TEXT

AlarmRecordAttribute for DISPLAY_TEXT field

public static final AlarmRecordAttribute DISPLAY_TEXT

See Also: LogRecord

DISPLAY_TIME

AlarmRecordAttribute for DISPLAY_TIME field

public static final AlarmRecordAttribute DISPLAY_TIME

See Also: LogRecord

EVENT_TIME

AlarmRecordAttribute for EVENT_TIME field

public static final AlarmRecordAttribute EVENT_TIME

See Also: LogRecord

EVENT_TYPE

AlarmRecordAttribute for EVENT_TYPE field

public static final AlarmRecordAttribute EVENT_TYPE

See Also: LogRecord

LOGGING_TIME

AlarmRecordAttribute for LOGGING_TIME field

public static final AlarmRecordAttribute LOGGING_TIME

See Also: LogRecord

LOG_RECORD_ID

AlarmRecordAttribute for LOG_RECORD_ID field

public static final AlarmRecordAttribute LOG_RECORD_ID

See Also: LogRecord, LogRecordId

MANAGED_OBJECT_INSTANCE

AlarmRecordAttribute for MANAGED_OBJECT_INSTANCE field

public static final AlarmRecordAttribute 
MANAGED_OBJECT_INSTANCE

See Also: LogRecord, MOName

PERCEIVED_SEVERITY

AlarmRecordAttribute for PERCEIVED_SEVERITY field

public static final AlarmRecordAttribute PERCEIVED_SEVERITY

See Also: LogRecord, EMSeverity

PROBABLE_CAUSE

AlarmRecordAttribute for PROBABLE_CAUSE field

public static final AlarmRecordAttribute PROBABLE_CAUSE

See Also: LogRecord

ADDITIONAL_TEXT

AlarmRecordAttribute for ADDITIONAL_TEXT field

public static final AlarmRecordAttribute ADDITIONAL_TEXT

See Also: LogRecord

LOG_NAME

AlarmRecordAttribute for LOG_NAME field

public static final AlarmRecordAttribute LOG_NAME

See Also: LogRecord, LogName

MIS_NAME

AlarmRecordAttribute for MIS_NAME field

public static final AlarmRecordAttribute MIS_NAME

See Also: LogRecord

3.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 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.AlarmRecordAttributeSet

3.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

public class AlarmRecordId

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

public class Filter

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)

See Also: FilterItem

removeFilterItem

Removes a filter element from the query.

public boolean removeFilterItem(FilterItem filterItem)

See Also: 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

public class FilterItem

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 AlarmException

name is the AlarmRecordAttribute.PERCEIVED_SEVERITY .

rel is the RelationCriteria.

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 AlarmException

name is the AlarmRecordAttribute: eventTime, loggingTime, clearTime, ackTime, displayTime.

rel is the RelationCriteria.

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 AlarmException

name is the AlarmRecordAttribute.MANAGED_OBJECT_INSTANCE.

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 AlarmException

rel 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 AlarmException

name is the AlarmRecordAttribute.LOG_RECORD_ID.

rel is the RelationCriteria.

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 AlarmException

name is the AlarmRecordAttribute: ACK_STATE, CLEAR_STATE, or DISPLAY_STATE.

rel is the RelationCriteria.

value is the boolean value.

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()

See Also: RelationCriteria

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

public class GenericQuery

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)

See Also: Filter

3.17.2 Methods

addFilter

Adds a filter element to the query.

public void addFilter(Filter filter)

See Also: FilterItem

setLogicalCriteria

Specifies the default logical operator to use in the query.

public void setLogicalCriteria(LogicalCriteria log)

See Also: LogicalCriteria

getLogicalCriteria

Gets the default logical operator used in the query.

public LogicalCriteria getLogicalCriteria()

Returns the LogicalCriteria.

removeFilter

Removes a filter element from the query.

public boolean removeFilter(Filter filter)

See Also: 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

public class LogicalCriteria

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 OR

AND

Logical Criteria can be AND

public static final LogicalCriteria AND

.

3.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

public class LogName

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 STRING

NUMBER

public static final String NUMBER 

3.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

public interface Query

The com.sun.em.api.alarm.Query interface is empty.

See Also: GenericQuery

3.21 RelationCriteria Class

public class RelationCriteria

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.

See Also: FilterItem

3.21.1 Variables

EQUAL

RelationCriteria can be EQUAL.

 public static final RelationCriteria EQUAL

NOT_EQUAL

RelationCriteria can be NOT_EQUAL.

 public static final RelationCriteria NOT_EQUAL

GREATER_THAN

RelationCriteria can be GREATER_THAN.

 public static final RelationCriteria GREATER_THAN

GREATER_THAN_OR_EQUAL

RelationCriteria can be GREATER_THAN_OR_EQUAL.

 public static final RelationCriteria 
GREATER_THAN_OR_EQUAL

LESS_THAN

RelationCriteria can be LESS_THAN.

 public static final RelationCriteria LESS_THAN

LESS_THAN_OR_EQUAL

RelationCriteria can be LESS_THAN_OR_EQUAL.

public static final RelationCriteria LESS_THAN_OR_EQUAL

3.21.2 Methods

toString

Returns a String representation of the relational operator.

 public String toString()

Overrides toString in class EMObjectAttribute.


Sun Microsystems, Inc.
Copyright information. All rights reserved.
Doc Set  |   Contents   |   Previous   |   Next   |   Index