Methods Summary |
---|
public void | addRelation(javax.management.ObjectName relationObjectName)Adds an MBean created by the user (and registered by him in the MBean
Server) as a relation in the Relation Service.
To be added as a relation, the MBean must conform to the
following:
- implement the Relation interface
- have for RelationService ObjectName the ObjectName of current
Relation Service
- have a relation id that is unique and unused in current Relation Service
- have for relation type a relation type created in the Relation
Service
- have roles conforming to the role info provided in the relation
type.
|
public void | addRelationType(javax.management.relation.RelationType relationTypeObj)Adds given object as a relation type. The object is expected to
implement the RelationType interface.
|
public java.lang.Integer | checkRoleReading(java.lang.String roleName, java.lang.String relationTypeName)Checks if given Role can be read in a relation of the given type.
|
public java.lang.Integer | checkRoleWriting(javax.management.relation.Role role, java.lang.String relationTypeName, java.lang.Boolean initFlag)Checks if given Role can be set in a relation of given type.
|
public void | createRelation(java.lang.String relationId, java.lang.String relationTypeName, javax.management.relation.RoleList roleList)Creates a simple relation (represented by a RelationSupport object) of
given relation type, and adds it in the Relation Service.
Roles are initialized according to the role list provided in
parameter. The ones not initialized in this way are set to an empty
ArrayList of ObjectNames.
A RelationNotification, with type RELATION_BASIC_CREATION, is sent.
|
public void | createRelationType(java.lang.String relationTypeName, javax.management.relation.RoleInfo[] roleInfoArray)Creates a relation type (RelationTypeSupport object) with given
role infos (provided by the RoleInfo objects), and adds it in the
Relation Service.
|
public java.util.Map | findAssociatedMBeans(javax.management.ObjectName mbeanName, java.lang.String relationTypeName, java.lang.String roleName)Retrieves the MBeans associated to given one in a relation.
This corresponds to CIM Associators and AssociatorNames operations.
|
public java.util.Map | findReferencingRelations(javax.management.ObjectName mbeanName, java.lang.String relationTypeName, java.lang.String roleName)Retrieves the relations where a given MBean is referenced.
This corresponds to the CIM "References" and "ReferenceNames"
operations.
|
public java.util.List | findRelationsOfType(java.lang.String relationTypeName)Returns the relation ids for relations of the given type.
|
public java.util.List | getAllRelationIds()Returns all the relation ids for all the relations handled by the
Relation Service.
|
public java.util.List | getAllRelationTypeNames()Retrieves names of all known relation types.
|
public javax.management.relation.RoleResult | getAllRoles(java.lang.String relationId)Returns all roles present in the relation.
|
public boolean | getPurgeFlag()Returns the flag to indicate if when a notification is received for the
unregistration of an MBean referenced in a relation, if an immediate
"purge" of the relations (look for the relations no longer valid)
has to be performed, or if that will be performed only when the
purgeRelations method is explicitly called.
true is immediate purge.
|
public java.util.Map | getReferencedMBeans(java.lang.String relationId)Retrieves MBeans referenced in the various roles of the relation.
|
public java.lang.String | getRelationTypeName(java.lang.String relationId)Returns name of associated relation type for given relation.
|
public java.util.List | getRole(java.lang.String relationId, java.lang.String roleName)Retrieves role value for given role name in given relation.
|
public java.lang.Integer | getRoleCardinality(java.lang.String relationId, java.lang.String roleName)Retrieves the number of MBeans currently referenced in the
given role.
|
public javax.management.relation.RoleInfo | getRoleInfo(java.lang.String relationTypeName, java.lang.String roleInfoName)Retrieves role info for given role of a given relation type.
|
public java.util.List | getRoleInfos(java.lang.String relationTypeName)Retrieves list of role infos (RoleInfo objects) of a given relation
type.
|
public javax.management.relation.RoleResult | getRoles(java.lang.String relationId, java.lang.String[] roleNameArray)Retrieves values of roles with given names in given relation.
|
public java.lang.Boolean | hasRelation(java.lang.String relationId)Checks if there is a relation identified in Relation Service with given
relation id.
|
public void | isActive()Checks if the Relation Service is active.
Current condition is that the Relation Service must be registered in the
MBean Server
|
public java.lang.String | isRelation(javax.management.ObjectName objectName)Returns the relation id associated to the given ObjectName if the
MBean has been added as a relation in the Relation Service.
|
public javax.management.ObjectName | isRelationMBean(java.lang.String relationId)If the relation is represented by an MBean (created by the user and
added as a relation in the Relation Service), returns the ObjectName of
the MBean.
|
public void | purgeRelations()Purges the relations.
Depending on the purgeFlag value, this method is either called
automatically when a notification is received for the unregistration of
an MBean referenced in a relation (if the flag is set to true), or not
(if the flag is set to false).
In that case it is up to the user to call it to maintain the
consistency of the relations. To be kept in mind that if an MBean is
unregistered and the purge not done immediately, if the ObjectName is
reused and assigned to another MBean referenced in a relation, calling
manually this purgeRelations() method will cause trouble, as will
consider the ObjectName as corresponding to the unregistered MBean, not
seeing the new one.
The behavior depends on the cardinality of the role where the
unregistered MBean is referenced:
- if removing one MBean reference in the role makes its number of
references less than the minimum degree, the relation has to be removed.
- if the remaining number of references after removing the MBean
reference is still in the cardinality range, keep the relation and
update it calling its handleMBeanUnregistration() callback.
|
public void | removeRelation(java.lang.String relationId)Removes given relation from the Relation Service.
A RelationNotification notification is sent, its type being:
- RelationNotification.RELATION_BASIC_REMOVAL if the relation was
only internal to the Relation Service
- RelationNotification.RELATION_MBEAN_REMOVAL if the relation is
registered as an MBean.
For MBeans referenced in such relation, nothing will be done,
|
public void | removeRelationType(java.lang.String relationTypeName)Removes given relation type from Relation Service.
The relation objects of that type will be removed from the
Relation Service.
|
public void | sendRelationCreationNotification(java.lang.String relationId)Sends a notification (RelationNotification) for a relation creation.
The notification type is:
- RelationNotification.RELATION_BASIC_CREATION if the relation is an
object internal to the Relation Service
- RelationNotification.RELATION_MBEAN_CREATION if the relation is a
MBean added as a relation.
The source object is the Relation Service itself.
It is called in Relation Service createRelation() and
addRelation() methods.
|
public void | sendRelationRemovalNotification(java.lang.String relationId, java.util.List unregMBeanList)Sends a notification (RelationNotification) for a relation removal.
The notification type is:
- RelationNotification.RELATION_BASIC_REMOVAL if the relation is an
object internal to the Relation Service
- RelationNotification.RELATION_MBEAN_REMOVAL if the relation is a
MBean added as a relation.
The source object is the Relation Service itself.
It is called in Relation Service removeRelation() method.
|
public void | sendRoleUpdateNotification(java.lang.String relationId, javax.management.relation.Role newRole, java.util.List oldRoleValue)Sends a notification (RelationNotification) for a role update in the
given relation. The notification type is:
- RelationNotification.RELATION_BASIC_UPDATE if the relation is an
object internal to the Relation Service
- RelationNotification.RELATION_MBEAN_UPDATE if the relation is a
MBean added as a relation.
The source object is the Relation Service itself.
It is called in relation MBean setRole() (for given role) and
setRoles() (for each role) methods (implementation provided in
RelationSupport class).
It is also called in Relation Service setRole() (for given role) and
setRoles() (for each role) methods.
|
public void | setPurgeFlag(boolean purgeFlag)Sets the flag to indicate if when a notification is received for the
unregistration of an MBean referenced in a relation, if an immediate
"purge" of the relations (look for the relations no longer valid)
has to be performed, or if that will be performed only when the
purgeRelations method is explicitly called.
true is immediate purge.
|
public void | setRole(java.lang.String relationId, javax.management.relation.Role role)Sets the given role in given relation.
Will check the role according to its corresponding role definition
provided in relation's relation type
The Relation Service will keep track of the change to keep the
consistency of relations by handling referenced MBean unregistrations.
|
public javax.management.relation.RoleResult | setRoles(java.lang.String relationId, javax.management.relation.RoleList roleList)Sets the given roles in given relation.
Will check the role according to its corresponding role definition
provided in relation's relation type
The Relation Service keeps track of the changes to keep the
consistency of relations by handling referenced MBean unregistrations.
|
public void | updateRoleMap(java.lang.String relationId, javax.management.relation.Role newRole, java.util.List oldRoleValue)Handles update of the Relation Service role map for the update of given
role in given relation.
It is called in relation MBean setRole() (for given role) and
setRoles() (for each role) methods (implementation provided in
RelationSupport class).
It is also called in Relation Service setRole() (for given role) and
setRoles() (for each role) methods.
To allow the Relation Service to maintain the consistency (in case
of MBean unregistration) and to be able to perform queries, this method
must be called when a role is updated.
|