Solstice Enterprise Manager 4.1 Java API Reference Doc Set ContentsPreviousNextIndex


Chapter 2

Java PMI API

This chapter introduces the classes that make up the Java Portable Management Interface (PMI) APIs.

This chapter comprises the following topics:

2.1 Overview

The Java PMI is a Java based API for manipulating managed objects similar to the C++ PMI API. Java applications can use the Java PMI to communicate with the MIS. JMI is used as an abbreviation for Java PMI throughout this book.

While functionally similar to the C++ PMI API, Java PMI offers a subset of the PMI features. Java PMI includes five major classes:

Additionally, some classes used in the PMI are not reflected in the JMI:

For more detailed information on how to use this API, refer to Chapter 2 in Developing Java Applications .

2.2 AbstractData Class

public class AbstractData

extends Object implements Serializable

The com.sun.em.api.pmi.AbstractData class represents an attribute for the managed object. It encapsulates the syntax information along with the value for any attribute. AbstractData corresponds to the Morf class available under C++ PMI API. This class provides many utility methods regarding the attribute value and also allows the user to break a complex attribute into its constituents.

2.2.1 Constructors

AbstractData

Constructs an instance of the AbstractData class.

public AbstractData(String attrName, Platform 
platform) 
throws JmiException

attrName is the name of the attribute.

platform is the instance of Platform.

Throws JmiException if there is an error in the construction of AbstractData, or a fault in the communication link.

AbstractData

Constructs an instance of the AbstractData class.

public AbstractData(String attrName,AbstractData list[],
Platform platform)
throws JmiException

attrName is the name of the attribute.

list is the array of AbstractData.

platform is the instance of Platform used for establishing connection to MIS.

Throws JmiException if there is an error in the construction of AbstractData, processing errors are encountered at the server, or a fault in the communication link.

2.2.2 Methods

For error handling, all these methods throw JmiException:

getStr

Provides the attribute value in String form.

 public String getStr() throws JmiException

Returns the attribute value in String form.

getLong

Provides the attribute value as Long.

public long getLong() throws JmiException

Returns the attribute value as Long.

getDouble

Provides the attribute value as Double.

public double getDouble() throws JmiException

Returns the attribute value as Double.

getBigInteger

Provides the attribute value as BigInteger.

public BigInteger getBigInteger() throws JmiException

Returns the attribute value as BigInteger.

setStr

Sets the attribute value.

public void setStr(String attrValue) throws 
JmiException

attrValue is the value of attribute in String form.

setLong

Sets the attribute value with a Long.

public void setLong(long attrValue) throws 
JmiException

attrValue is the value of attribute as Long.

setDouble

Set the attribute value with a Double.

public void setDouble(double attrValue) throws 
JmiException

attrValue is the value of attribute as Double.

setAny

Sets the attribute value with an AbstractData.

public void setAny(AbstractData data) throws JmiException

attrValue is the value of attribute as AbstractData.

setBigInteger

Sets the attribute value with a BigInteger.

public void setBigInteger(BigInteger attrValue) throws 
JmiException

attrValue is the value of attribute as BigInteger.

isList

Finds out if the attribute is either of SET/SET_OF/SEQUENCE/SEQUENCE_OF.

public boolean isList() throws JmiException

Returns true if the attribute is either of SET/SET_OF/SEQUENCE/SEQUENCE_OF, otherwise returns false.

isChoice

Indicates if the attribute type is CHOICE or not.

public boolean isChoice() throws JmiException

Returns true if the attribute type is CHOICE, otherwise returns false.

isSet

Indicates if the attribute type is SET or not.

public boolean isSet() throws JmiException

Returns true if the attribute is a SET, otherwise returns false.

isSequence

Indicates if the attribute type is SEQUENCE or not.

 public boolean isSequence() throws JmiException

Returns true if the attribute is a SEQUENCE, otherwise returns false.

isAny

Indicates if the attribute type is ANY or not.

public boolean isAny() throws JmiException

Returns true if the attribute type is ANY, otherwise returns false.

splitList

Creates an AbstractData for each member of the AbstractData and returns an array of all the members. This method works only on AbstractData that are of list type.

public AbstractData[] 
splitList() throws JmiException

Returns an array of the members of AbstractData.

extract

Extracts the member of the composite AbstractData using the navigational string.

public AbstractData 
extract(String navigation) throws 
JmiException

navigation is the navigational string.

Returns AbstractData which is a member of the composite AbstractData.

numElements

Returns the number of elements in the list. This method works only on AbstractData which are of list type.

public int numElements() throws JmiException

Returns the number of members for this list type AbstractData.

setMemberName

Sets the member in the attribute of CHOICE type.

public void setMemberName(String str) throws JmiException

str is the name of the member syntax. Calling this method sets the behavior of the AbstractData according to the member syntax. This method is applicable only on choice types.

getMemberName

Returns the name of member syntax. This method is applicable on choice types only.

public String getMemberName() throws JmiException

Returns the name of member syntax.

getMemberNames

Returns an array of member names. This method is applicable on choice types only.

public String[] getMemberNames() throws JmiException

Returns an array of member names for this particular choice type.

2.3 AuthList Class

public class AuthList

extends Object implements Serializable

The com.sun.em.api.pmi.AuthList class represents a list of authorized applications or features of a given application. This list is determined by access control setup of MIS server. AuthList corresponds to two C++ PMI classes: AuthFeatures and AuthApps, for application/feature level access control purposes.

2.3.1 Constructors

AuthList

Constructs an instance of the AuthList class.

public AuthList(String list[])

list is the list of names of applications or features.

2.3.2 Methods

isAuthorized

Checks to see if the application is authorized.

public boolean isAuthorized(String name)

name is the name of the application.

Returns true if the application is authorized, otherwise returns false.

hasFullAccess

Checks to see if the user has full access.

public boolean hasFullAccess()

Returns true if the user has full access, otherwise returns false.

getAuthorizedList

Returns the authorized list.

public String[] getAuthorizedList()

Returns an empty array (zero length) if the user has full access. If the user doesn't have any access, the return value will be a null object. Otherwise, the array containing applications or features will be returned.

2.4 EventReport Class

public class EventReport

extends Object implements Serializable

The com.sun.em.api.pmi.The EventReport class provides information for any event received from the MIS. Applications can register for events using the appropriate methods in the various classes for example, Platform, MOHandle, MOHcollection (ByRule/Enum) and so forth. The EventReport class is similar to the CurrentEvent class available under C++ PMI API.

2.4.1 Methods

For error handling, most of these methods throw JmiException when there is an error in executing this method or a fault in the communication link.

getName

Returns the event type in String form.

public String getName()

getInfo

Returns the event information in String form.

public String getInfo() throws JmiException

getInfoRaw

Returns the event information in AbstractData form.

public AbstractData 
getInfoRaw() throws JmiException

getMOName

Returns the managed object name for the event in String form.

public String getMOName()

getMOClass

Returns the managed object class for the event in String form.

public String getMOClass()

2.5 EventReportListener Interface

public interface EventReportListener

The com.sun.em.api.pmi.EventReportListener interface will be implemented by any user interested in receiving EventReports. This interface defines the method handler which will be called by JMI when the event arrives. The abstract handler in the EventReportListener needs to be implemented for receiving and processing events.

2.5.1 Methods

handler

This method is called by JMI when an event arrives.

public void handler(EventReport ind)

ind is an instance of EventReport which provides the event information.

2.6 JmiException Class

public class JmiException

extends Exception

The com.sun.em.api.pmi.JmiException class is used to represent errors encountered in method execution, broken communication links, or processing errors encountered at the server.

2.6.1 Constructors

JmiException

Constructs an instance of the JmiException class.

JmiException(String 
msg) 

msg is the message provided by the object that is throwing the exception.

2.7 MOHandle Class

public class MOHandle

extends Object

The com.sun.em.api.pmi.MOHandle class represents the Managed Object Handle. This class is similar to the Image class from C++ PMI API. It provides methods to operate on the object over the network and the copy held in the server.

In order to deliver events, you need to define and instantiate a class that implements the interface EventReportListener. An instance of the class implementing this interface is passed as a parameter to the event registration methods (addAttributeValueChangeListener, addObjectCreationListener and so forth). On event delivery, Java PMI invokes the handler method of this interface.

Similar to event registration, callbacks for events can be deregistered by calling methods such as removeAttributeValueChangeListener, removeObjectCreationListener and so forth. Java PMI expects the same listener arguments passed as the one used when registering the event.

2.7.1 Constructors

MOHandle

Constructs an instance of the MOHandle class.

public MOHandle(String instance,Platform 
platform)
throws
JmiException

instance is the name of the object in DN form.

platform is the instance of the Platform used for establishing connection to MIS.

Throws JmiException if there is an error in the construction of MOHandle, or a fault in the communication link.

MOHandle

Constructs an instance of the MOHandle class.

public MOHandle(String instance,String objclass,Platform platform) 
throws JmiException

instance is the name of the object in DN form.

objclass is the class name of the object.

platform is the instance of the Platform used for establishing connection to MIS.

Throws JmiException if there is an error in the construction of MOHandle, processing errors occur at the server, or a fault occurs in the communication link.

2.7.2 Methods

Unless otherwise noted, all these methods throw JmiException if an error occurs in executing the method, a fault occurs in the communication link, or processing errors are encountered at the server.

addAttributeValueChangeListener

Registers a callback for Attribute Value Change of the managed object represented by this MOHandle.

public void addAttributeValueChangeListener
(EventReportListener listener)
throws JmiException

listener is the instance of EventReportListener which implements handler method.

Throws JmiException if there is an error in registering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

addObjectCreationListener

Registers a callback for Object Creation of a managed object represented by this MOHandle.

public void addObjectCreationListener(EventReportListener listener) 
throws JmiException

listener is the instance of EventReportListener which implements handler method.

Throws JmiException if there is an error in registering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

addObjectDeletionListener

Registers a callback for Object Deletion of a managed object represented by this MOHandle.

public void addObjectDeletionListener(EventReportListener listener) 
throws JmiException

listener is the instance of EventReportListener that implements handler method.

Throws JmiException if there is an error in registering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

addRawEventListener

Registers a callback for any event for the managed object represented by this MOHandle.

public void addRawEventListener(EventReportListener listener) 
throws JmiException

listener is the instance of EventReportListener that implements handler method.

Throws JmiException if there is an error in registering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

removeAttributeValueChangeListener

Removes the callback for Attribute Value Change for this MOHandle.

public void 
removeAttributeValueChangeListener(EventReportListener listener) 
throws JmiException

listener is the instance of EventReportListener that implements handler method.

Throws JmiException if there is an error in deregistering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

removeObjectCreationListener

Removes the callback for Object Creation for this MOHandle.

public void removeObjectCreationListener
(EventReportListener listener)
throws JmiException

listener is the instance of EventReportListener that was used for registering the callback.

Throws JmiException if there is an error in deregistering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

removeObjectDeletionListener

Removes the callback for Object Deletion for this MOHandle.

public void removeObjectDeletionListener
(EventReportListener listener)
throws JmiException

listener is the instance of EventReportListener that was used for registering the callback.

Throws JmiException if there is an error in deregistering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

removeRawEventListener

Removes the callback for registered event using addRawEventListener.

public void removeRawEventListener(EventReportListener listener) 
throws JmiException

listener is the instance of EventReportListener that was used for registering the callback.

Throws JmiException if there is an error in deregistering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

isEmpty

Indicates whether the server holds an underlying data object for this MOHandle.

public boolean isEmpty() throws JmiException

Returns true or false.

getTrackIdList

Returns an array of attribute names. The array contains the names of the attributes that are tracked by the MOHandle for any changes in their values (in the network).

public String[] getTrackIdList() throws JmiException

Returns an array of zero or more attribute names.

setTrackIdList

Sets the attributes of the MOHandle to track changes in their values in the network based on the trackIdList supplied.

public void setTrackIdList(String trackIdList[]) throws 
JmiException

trackIdList is an array of attribute names that are expected to be tracked.

setTracking

This method enables or disables tracking of the attributes for this MOHandle.

public void setTracking(boolean tracking) throws JmiException

tracking is a boolean flag. A true value sets tracking on and false turns it off.

removeFromTrackIdList

Removes the attributes from trackIdList when in tracking mode.

public void removeFromTrackIdList(String trackIdList[])
throws JmiException

trackIdList is a list of attribute names that are removed from the tracking mode.

getStr

Gets the value of the attribute in String form.

public String getStr(String attrName) throws JmiException

attrName is the name of the attribute.

getStr

Gets the values of more than one attribute at a time.

public String[] getStr(String attrList[]) throws 
JmiException

attrList is the list of attribute names for which values are returned.

Returns attribute values in an array of Strings.

getAttrNames

Returns all the attribute names for the MOHandle as an array of Strings.

public String[] getAttrNames() throws JmiException

Returns attribute names in an array of Strings.

getLong

Gets the value of the attribute as a Long.

public long getLong(String attrName) throws JmiException

attrName is the name of the attribute.

Returns an attribute value as a Long.

getDouble

Gets the value of the attribute as a Double.

public double getDouble(String attrName) throws JmiException

attrName is the name of the attribute.

Returns an attribute value as a Double.

getBigInteger

Gets the value of the attribute as a BigInteger.

public BigInteger getBigInteger(String attrName)
throws JmiException

attrName is the name of the attribute.

Returns an attribute value as a BigInteger.

getRaw

Gets the value of the attribute as an AbstractData.

public AbstractData 
getRaw(String attrName) throws JmiException

attrName is the name of the attribute.

Returns an attribute value as AbstractData.

setStr

Sets the value of the attribute.

public void setStr(String attrName,String value)
throws JmiException

attrName is the name of the attribute.

value is the value of the attribute as a String.

setStr

Sets the values of more than one attribute at a time.  

public void setStr(String attrList[],String 
values[]) 
throws JmiException

attrList is the names of the attribute.

values is the corresponding values of the attributes.

exists

Indicates whether or not the object represented by this MOHandle already exists.

public boolean exists() throws JmiException

Returns a boolean value. If MOHandle exists, it returns true, otherwise it returns false.

setLong

Sets the value of the attribute as a Long.

public void setLong(String attrName,long value) throws JmiException

attrName is the name of the attribute.

value is the value of the attribute as a Long.

setDouble

Sets the value of the attribute as a Double.

public void setDouble(String attrName,double value)
throws JmiException

attrName is the name of the attribute.

value is the value of the attribute as a Double.

setBigInteger

Sets the value of the attribute as BigInteger.

public void setBigInteger(String attrName,BigInteger 
value)
throws JmiException

attrName is the name of the attribute.

value is the value of the attribute as a BigInteger.

setRaw

Sets the value of the attribute as AbstractData.

public void setRaw(String attrName,AbstractData rawAttr)
throws JmiException

attrName is the name of the attribute.

value is the value of the attribute in AbstractData form.

getObjectName

Returns the name of the object in distinguished form.

public String getObjectName() throws JmiException

Returns the object name in String form.

getObjectClass

Returns the name of the object class for this MOHandle.

public String getObjectClass() throws JmiException

Returns the object class.

getObjectState

Returns the state of this MOHandle. If the state is up, the MOhandle is "booted", that is, the MOHandle has all the metadata information and attribute values (if the object exists). If the state is down, the MOHandle is not booted.

public String getObjectState() throws JmiException

Returns the up or down state of MOHandle.

MGet

Executes a management operation of getting all the attribute values from the network for this MOHandle.

public void MGet(double to) throws JmiException

to is the time out value provided for this operation to finish.

MGet

Executes a management operation of getting some of the attribute values from the network for this MOHandle.

public void MGet(String attrlist[],double to) 
throws JmiException

attrlist is the attribute list.

to is the time out value provided for this operation to finish.

MSet

Executes a management operation of setting all the attribute values from the MOHandle over the network (set locally by calling setStr).

public void MSet(double to) throws JmiException

to is the time out value provided for this operation to finish.

MCreate

Executes a management operation of creating the object in the network represented by this MOHandle.

public void MCreate(double to) throws JmiException

to is the time out value provided for this operation to finish.

MCreateWithin

Executes a management operation of creating the object in the network represented by this MOHandle with the superior object as in the argument.

public void MCreateWithin(String superiorObj,double 
to) 
throws JmiException

superiorObj is the name of the object that will contain the new object.

to is the time out value provided for this operation to finish.

MDelete

Executes a management operation of deleting the object in the network represented by this MOHandle.

public void MDelete(double to) throws JmiException

to is the time out value provided for this operation to finish.

MAction

Executes a management operation of calling an action on the object in the network represented by this MOHandle.

public String MAction(String actionName,String 
param,double 
to) 
throws JmiException

actionName is the name of the action supported by the object.

param is the parameter required to execute this action.

to is the time out value provided for this operation to finish.

MEventReport

Sends an event with the type and the event information provided.

public void MEventReport(String eventName,String eventInfo)
throws JmiException

eventName is the name of the event type.

eventInfo is the event information in the String form.

2.8 MOHCollectionByRule Class

public class MOHCollectionByRule

extends Object

The com.sun.em.api.pmi.MOHCollectionByRule class represents a group of MOHandles which satisfy the rule specified by base object (the distinguished name of the base object), scope (the scope of the collection in the MIT), and filter (the filter applied as a criteria for membership). The MOHCollectionByRule class does not allow user manipulation of its membership. This class will track all the MOHandles within the collection, based on changes in the network for these MOHandles.

In order for events to be delivered, users of MOHCollectionByRule need to define and instantiate a class that implements the EventReportListener interface. An instance of the class implementing this interface is passed as a parameter to these event registration methods (addAttributeValueChangeListener, addObjectCreationListener and so forth). Upon event delivery, Java PMI invokes the handler method of this interface.

Two additional events are supported by MOHCollectionByRule, namely, MOHandleIncluded and MOHandleExcluded. These events are delivered when a MOHandle is included in the collection (because it satisfies the rule for collection) or excluded.

Similar to event registration, callbacks for events can be deregistered by calling methods such as removeAttributeValueChangeListener, removeObjectCreationListener and so forth. The user of Java PMI is expected to pass the same listener argument as the one used when registering earlier.

2.8.1 Constructors

MOHCollectionByRule

Constructs an instance of the MOHCollectionByRule class.

public MOHCollectionByRule(String baseobj,String scope,
String filter,Platform platform)
throws
JmiException

baseObj is the distinguished name of the base object.

scope is the cope of the collection in the MIT.

filter is the filter applied as a criteria for membership.

platform is the instance of Platform.

Throws JmiException if there is an error in the construction of MOHCollectionByRule, or a fault in the communication link.

2.8.2 Methods


Note – For error handling, all these methods throw JmiException if an error occurs while executing, processing errors are encountered at the server, or a fault occurs in the communication link.

allSetProp

Sets the specified property of every image currently in the existing MOHCollectionByRule instance to the specified value.

public void allSetProp(String property,String value)
throws JmiException

property is the name of the MOHandle property.

value is the value to which the specified property is set.

setTracking

Modifies tracking mode of the collection . The collection will get updated whenever the managed objects, represented by member MOHandles, are changed in the network when tracking is set to on.

public void setTracking(boolean tracking) throws JmiException

tracking is a boolean flag. If it is set to true, collection is in tracking mode or it does not track.

getTracking

Returns the tracking mode for the collection.

public boolean getTracking() throws JmiException

Returns a boolean value to indicate whether or not the collection is tracking.

populate

Populates the collection from the network based on the base object, scope, and the filter defined in the constructor.

public void populate(double to) throws JmiException

to is the time out value provided for this operation to finish.

getScope

Returns the scope for this collection.

public String getScope() throws JmiException

Returns the String value of the scope.

getFilter

Returns the filter for this collection.

public String getFilter() throws JmiException

Returns the String value of the filter.

getBaseManagedObject

Returns the name of the base object for this collection.

public String getBaseManagedObject() throws JmiException

Returns the name of the base object for this collection.

setScope

Modifies the scope for this collection.

public void setScope(String scope) throws JmiException

scope is the scope for the collection.

setFilter

Modifies the filter for this collection.

public void setFilter(String filter) throws JmiException

filter is the filter for the collection.

setBaseManagedObject

Modifies the base managed object for this collection.

public void setBaseManagedObject(String baseobj)
throws JmiException

baseObj is the name of the base object.

getMOHandles

Returns the members of this collection as an array of MOHandles.

public MOHandle[] 
getMOHandles() throws JmiException

Returns the MOHandles in the collection as an array.

MGet

Management operation to obtain information of all the MOHandles within the collection.

public void MGet(double to) throws JmiException

to is the time out value for the operation to finish.

MSet

Management operation to store information of all the MOHandles within the collection.

public void MSet(double to) throws JmiException

to is the time out value for the operation to finish.

2.9 MOHCollectionEnum Class

public class MOHCollectionEnum

extends Object

The com.sun.em.api.pmi.MOHCollectionEnum class represents a group of MOHandles in the Java PMI. The MOHCollectionEnum class allows a user to manipulate its membership.

In order for events to be delivered, users of MOHCollectionEnum must define and instantiate a class that implements the interface EventReportListener. An instance of the class implementing this interface is passed as a parameter to the event registration methods (addAttributeValueChangeListener, addObjectCreationListener and so forth). Upon event delivery, Java PMI invokes the handler method of this interface.

Similar to event registration, callbacks for events can be deregistered by calling methods such as removeAttributeValueChangeListener, removeObjectCreationListener etc. The user of Java PMI is expected to pass the same listener argument as the one used used while registering the event earlier.

2.9.1 Constructors

MOHCollectionEnum

Constructs an instance of the MOHCollectionEnum class from a MOHcollectionByRule instance. The instance of Platform in the constructor ensures that this instance of collection is created in the same process as that of the Platform.

public MOHCollectionEnum(MOHCollectionByRule collection,
Platform platform)
throws JmiException

collection is an instance of MOHCollectionByRule.

platform is an instance of Platform.

Throws JmiException if there is an error in the construction of MOHCollectionEnum, or a fault in the communication link.

MOHCollectionEnum

Constructs an instance of the MOHCollectionEnum class. The instance of Platform in the constructor ensures that this instance of collection is created in the same process as that of the Platform.

public MOHCollectionEnum(Platform 
platform) throws 
JmiException

platform is an instance of Platform.

Throws JmiException if there is an error in the construction of MOHCollectionEnum, or a fault in the communication link.

2.9.2 Methods

Unless otherwise noted, all these methods throw JmiException if an error occurs in the execution of this method, processing errors are encountered at the server, or a fault occurs in the communication link.

allSetProp

Sets the specified property of every image currently in the existing MOHCollectionEnum instance to the specified value.

public void allSetProp(String property, String value) 
throws JmiException

property is the name of the MOHandle property.

value is the value you set for the specified property.

getMOHandles

Returns an array of MOHandles within the collection.

public MOHandle[] 
getMOHandles() throws JmiException

Returns an array of MOHandles.

Mget

This is a management operation to obtain information on all the MOHandles within the collection.

public void MGet(double to) throws JmiException

to is the time out for the operation to finish.

MSet

This is a management operation to store information of all the MOHandles within the collection.

public void MSet(double to) throws JmiException

to is time out for the operation to finish.

Mcreate

This is a management operation to create all the MOHandles within the collection.

public void MCreate(double to) throws JmiException

to is the time out for the operation to finish.

MCreateWithin

This is a management operation to create all the MOHandles within the collection under a superior object.

public void MCreateWithin(String superiorObj, double 
to) 
throws JmiException

superiorObj is the name of the superior object.

to is the time out for the operation to finish.

MDelete

This is a management operation to delete all the MOHandles within the collection.

public void MDelete(double to) throws JmiException

to is the time out for the operation to finish.

MAction

This is a management operation to call an action on all the MOHandles within the collection.

public void MAction(String actionName, String 
parameter, 
double to) 
throws JmiException

actionName is the name of the action.

parameter is the argument required for the action.

to is the time out for the operation to finish.

exclude

Excludes a MOHandle from this collection.

public void exclude(MOHandle 
mh) throws JmiException

mh is the MOHandle instance.

exclude

Excludes a collection of MOHandles from this collection.

public void exclude(MOHCollectionEnum collection)
throws JmiException

collection is the instance of a MOHCollectionEnum.

include

Adds a MOHandle to this collection.

public void include(MOHandle 
mh) throws JmiException

mh is the MOHandle instance.

include

Adds a collection of MOHandles to this collection.

public void include(MOHCollectionEnum collection)
throws JmiException

collection is the instance of a MOHCollectionEnum.

addAttributeValueChangeListener

Registers a callback for Attribute Value Change of any object in the collection in the network.

public void addAttributeValueChangeListener
(EventReportListener listener)
throws JmiException

listener is the instance of EventReportListener which implements handler method.

Throws JmiException if there is an error in registering the callback or a fault in the communication link.

addObjectCreationListener

Registers a callback for Object Creation of any managed object in the collection in the network.

public void addObjectCreationListener(EventReportListener listener) 
throws JmiException

listener is the instance of EventReportListener which implements handler method.

Throws JmiException if there is an error in registering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

addObjectDeletionListener

Registers a callback for Object Deletion of any managed object in the collection in the network.

public void addObjectDeletionListener(EventReportListener listener) 
throws JmiException

listener is the instance of EventReportListener which implements handler method.

Throws JmiException if there is an error in registering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

addRawEventListener

Registers a callback for any raw event forwarded by the MIS for a MOHandle in the collection.

public void addRawEventListener(EventReportListener listener) 
throws JmiException

listener is the instance of EventReportListener which implements handler method.

Throws JmiException if there is an error in registering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

removeAttributeValueChangeListener

Removes the callback for Attribute Value Change of a managed object in the collection.

public void removeAttributeValueChangeListener
(EventReportListener listener)
throws JmiException

listener is the instance of EventReportListener which was used for registering callback.

Throws JmiException if there is an error in deregistering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

removeObjectCreationListener

Removes the callback for Object Creation of a managed object in the collection.

public void removeObjectCreationListener
(EventReportListener listener)
throws JmiException

listener is the instance of EventReportListener which was used for registering the callback.

Throws JmiException if there is an error in deregistering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

removeObjectDeletionListener

Removes the callback for Object Deletion of a managed object in the collection.

public void removeObjectDeletionListener
(EventReportListener listener)
throws JmiException

listener is the instance of EventReportListener which was used for registering this callback.

Throws JmiException if there is an error in deregistering the callback, processing errors are encountered at the server, or a fault occurs in the communication link.

removeRawEventListener

Removes the callback for the registered event using addRawEventListener.

public void removeRawEventListener(EventReportListener listener) 
throws JmiException

listener is the instance of EventReportListener which was used for registering the callback.

Throws JmiException if there is an error in deregistering the callback processing errors are encountered at the server, or a fault occurs in the communication link.

2.10 Platform Class

public class Platform

extends Object

The com.sun.em.api.pmi.Platform class represents the Agent Handle for JMI. It needs to be instantiated to set up a connection with the MIS. Additionally, it spawns a remote server process which acts as the middle tier in the client-server model.

All operations happen through the Java server process. Each platform instance is associated with a unique server instance. All the major classes take a Platform instance as a parameter.

In order for events to be delivered, users of Platform must define and instantiate a class that implements the EventReportListener interface. An instance of the class implementing this interface is passed as a parameter to the event registration methods (addAttributeValueChangeListener, addObjectCreationListener and so forth). Upon event delivery, Platform invokes the handler method of this interface.

Similar to event registration, callbacks for events can be deregistered by calling methods such as removeAttributeValueChangeListener, removeObjectCreationListener and so forth. The user of Platform is expected to pass the same listener argument as the one used used while registering the event earlier.

2.10.1 Constructors

Platform

Constructs an instance of the Platform class.

public Platform(String host,String misName,String user,
String passwd)
throws JmiException

host is the host name where the server resides. This is the host where jme_services was started.

misName is the name of MIS host.

user is the user name.

passwd is the password. The password is supplied in clear-text but is not transmitted in clear-text to the server, except if the client program is an applet running in Netscape. The encryption is export quality.

Throws JmiException if there is an error in the construction of Platform, or a fault in the communication link.

2.10.2 Methods

addAttributeValueChangeListener

Registers a callback for Attribute Value Change of any object in the network.

public void addAttributeValueChangeListener
(EventReportListener listener)
throws JmiException

listener is the instance of EventReportListener which implements handler method.

Throws JmiException if there is an error in registering the callback or a fault in the communication link.

addObjectCreationListener

Registers a callback for Object Creation of any managed object in the network.

public void addObjectCreationListener(EventReportListener listener) 
throws JmiException

listener is the instance of EventReportListener which implements handler method.

Throws JmiException if there is an error in registering the callback or a fault in the communication link.

addObjectDeletionListener

Registers a callback for Object Deletion of any managed object in the network.

public void addObjectDeletionListener(EventReportListener listener) 
throws JmiException

listener is the instance of EventReportListener which implements handler method.

Throws JmiException if there is an error in registering the callback or a fault in the communication link.

addRawEventListener

Registers a callback for any event forwarded by the MIS.

public void addRawEventListener(EventReportListener listener) 
throws JmiException

listener is the instance of EventReportListener which implements handler method.

Throws JmiException if there is an error in registering the callback or a fault in the communication link.

removeAttributeValueChangeListener

Removes the callback for Attribute Value Change of a managed object in the network.

public void removeAttributeValueChangeListener
(EventReportListener listener)
throws JmiException

listener is the instance of EventReportListener which was used for registering callback.

Throws JmiException if there is an error in registering the callback or a fault in the communication link.

removeObjectCreationListener

Removes the callback for Object Creation of a managed object in the network.

public void removeObjectCreationListener
(EventReportListener listener)
throws JmiException

listener is the instance of EventReportListener which was used for registering the callback.

Throws JmiException if there is an error in deregistering the callback or a fault in the communication link.

removeObjectDeletionListener

Removes the callback for Object Deletion of a managed object in the network.

public void removeObjectDeletionListener
(EventReportListener listener)
throws JmiException

listener is the instance of EventReportListener which was used for registering this callback.

Throws JmiException if there is an error in deregistering the callback or a fault in the communication link.

removeRawEventListener

Removes the callback for registered event using addRawEventListener.

public void removeRawEventListener(EventReportListener listener) 
throws JmiException

listener is the instance of EventReportListener which was used for registering the callback.

Throws JmiException if there is an error in deregistering the callback or a fault in the communication link.

getAuthorizedFeatures

Returns a list of authorized features for an application for a particular user. It is possible through Solstice EM, to make some features of an application accessible/inaccessible to a user. The instance of AuthList returned provides a method (isAuthorized) which indicates whether or not the user is authorized to use that feature.

public AuthList 
getAuthorizedFeatures(String user,String appName) 
throws JmiException

user is the user name.

appName is the application name.

Returns the instance of AuthList which the user can further query for additional information.

getAuthorizedApps

Returns a list of authorized applications for a particular user. It is possible through Solstice EM, to make some applications accessible/inaccessible to a user. The instance of AuthList returned provides a method (isAuthorized) which indicates whether or not the user is authorized to use that application.

public AuthList 
getAuthorizedApps(String user) throws JmiException

user is the user name.

Returns the instance of AuthList which the user can further query for additional information.

getUserName

Returns the user name.

public String getUserName()

Returns the user name used for the creation of Platform and log in.

getMisName

Returns the MIS name.

public String getMisName()

Returns the host name of MIS to which the server is connected.


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