Solstice Enterprise Manager 4.1 Java API Reference Doc Set ContentsPreviousNextIndex


Chapter 1

Common API Classes

This chapter covers are the common set of objects you can use with the Java PMI, Alarms, and Topology Application Programming Interface (API).

This chapter comprises the following topics:

1.1 EMObjectAttribute Class

java.lang.Object
   |
   +----com.sun.em.api.common.EMObjectAttribute

public final class EMObjectAttribute

extends java.lang.Object

implements java.io.Serializable

The abstract class EMObjectAttribute is the superclass of the classes AlarmRecordAttribute, EMCmipAgentAttribute, EMRpcAgentAttribute, EMSnmpAgentAttribute, EMTopoNodeAttribute, and EMTopoTypeAttribute.

1.1.1 Methods

equals

Compares this EMObjectAttribute against the specified object. The result is true if and only if the argument is not null and is an EMObjectAttribute object with the same identity as this EMObjectAttribute.

public boolean equals(java.lang.Object obj)

obj is the object to compare against.

Returns: true if the objects are equal, false otherwise.

Overrides: equals in class java.lang.Object

toString

Returns a String representation of EMObjectAttribute.

public java.lang.String toString()

Returns: String

Overrides: toString in class java.lang.Object

intValue

Returns a unique integer identifier for this attribute.

public int intValue()

1.2 EMAttributeSet Class

java.lang.Object
   |
   +----com.sun.em.api.common.EMAttributeSet

public abstract class EMAttributeSet

extends java.lang.Object

implements java.lang.Cloneable, java.io.Serializable

The EMAttributeSet class is an abstract class that forms the basis for the attribute set classes of each API. EMAttributeSet is used with the Alarm and Topology APIs to communicate which attributes of the Alarm or Topology object, the API method should operate.

1.2.1 Methods

add

Adds an attribute to the set.

public void add(EMObjectAttribute attribute)

Parameters: attribute is the attribute to add to the set

Throws ClassCastException if the attribute is not a valid attribute of the object

addAll

Adds all attributes to the set.

public void addAll()

and

Performs a logical AND of this set with the argument set. This set contains attributes which are members of both this set and the argument set. This set also has its upper bound adjusted to the greater of its upper bound and the upper bound of the argument set.

public void and(EMAttributeSet set)

clone

Returns a clone of this EMAttributeSet object.

public java.lang.Object clone()

Returns: A clone of this EMAttributeSet

elements

Returns an enumeration of the attributes in this set. Enumeration.nextElement() will return an object whose type is a subclass of EMObjectAttribute, e.g. void enumeration(EMAttributeSet set) {Enumeration e=set.elements(); while (e.hasMoreElements() {EMObjectAttribute attribute=(EMObjectAttribute) e.nextElement(); System.out.println(attribute.toString());}}

public abstract java.util.Enumeration elements

Returns: An enumeration of the attributes in this set

equals

Compares this object against the specified object. The result is true if and only if the argument is not null and is an EMAttributeSet object that contains the same set of attributes as this EMAttributeSet.

public boolean equals(java.lang.Object obj)

Parameters: obj is the object to compare with

Returns: true if the objects are the same; false otherwise

Overrides: equals in class java.lang.Object

getNumMembers

Returns the number of attributes which are members of this set.

public int getNumMembers()

isMember

Returns whether the argument attribute is a member of this set.

public boolean isMember (EMObjectAttribute attributeID)

Parameters: attributeID is the attribute to test for membership in the set

Returns: true if the argument attribute is in the set, otherwise false

Throws ClassCastException if the attribute is not a valid attribute of the object

or

Performs a logical OR of this set with the argument set. This set contains attributes that are members of this set, the argument set, or both. This set also has its upper bound adjusted to the greater of its upper bound and the upper bound of the argument set.

public void or(EMAttributeSet set)

Parameters: The argument set

remove

Removes an attribute from the set.

public void remove(EMObjectAttribute attribute)

Parameters: attribute the attribute to remove from the set.

Throws ClassCastException if the attribute is not an attribute of the object

removeAll

Removes all attributes from the set.

public void removeAll

xor

Performs a logical XOR of this set with the argument set. This set contains attributes that are members of either this set or the argument set, but not both. This set also has its upper bound adjusted to the greater of its upper bound and the upper bound of the argument set.

public void xor(EMAttributeSet set)

Parameters: The argument set

1.3 MOName Class

java.lang.Object
   |
   +----com.sun.em.api.common.MOName

public final class MOName

extends java.lang.Object

implements java.io.Serializable

An instance of MOName represents a Managed Object Instance name. findMOsByNodes method of EMTopoNode class returns instances of this class.

1.3.1 Constructor

MOName

Creates an instance of MOName given the fully distinguished name (fdn) of a Managed Object Instance.

public MOName(String moiName)

Parameters: moiName is the fully distinguished name

1.3.2 Methods

getMOId

Gets the internal ID for the managed object.

public int getMOId()

getMOName

Gets the fully distinguished name of a managed object instance.

public String getMOName()

setMOId

Sets the internal ID for the managed object. This is generally not set by the API user, rather it is set internally.

public void setMOId(int id)

setMOName

Sets the fully distinguished name of a managed object instance.

public void setMOName(String moiName)

1.4 EMSeverity Class

java.lang.Object
   |
   +----com.sun.em.api.common.EMSeverity

public final class EMSeverity

extends java.lang.Object

An instance of com.sun.em.api.common.EMSeverity represents one of the six possible alarm severity levels.

1.4.1 Alarm Severity Levels

CLEARED

public static final EMSeverity CLEARED

CRITICAL

public static final EMSeverity CRITICAL

INDETERMINATE

public static final EMSeverity INDETERMINATE

MAJOR

public static final EMSeverity MAJOR

MINOR

public static final EMSeverity MINOR

WARNING

public static final EMSeverity WARNING

1.4.2 Methods

equals

Compares this EMSeverity against the specified object. The result is true if, and only if, the argument is not null and is a EMSeverity object with the same value as this EMSeverity.

public boolean equals(Object obj)

obj is the object to compare against.

Returns: true if the objects are equal, false otherwise.

Overrides: equals in class java.lang.Object

getId

Returns an integer representation of the EMSeverity.

public int getId()

toString

Returns a String representation of EMSeverity.

public String toString()

Returns: String

Overrides: toString in class java.lang.Object


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