|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--javax.management.NotificationBroadcasterSupport
|
+--javax.management.relation.RelationService
The Relation Service is in charge of creating and deleting relation types and relations, of handling the consistency and of providing query mechanisms. It implements the NotificationBroadcaster by extending NotificationBroadcasterSupport to send notifications when a relation is removed from it. It implements the NotificationListener interface to be able to receive notifications concerning unregistration of MBeans referenced in relation roles and of relation MBeans. It implements the MBeanRegistration interface to be able to retrieve its ObjectName and MBean Server.
| Fields inherited from class javax.management.NotificationBroadcasterSupport |
li |
| Constructor Summary | |
RelationService(boolean theImmediatePurgeFlg)
Constructor initiates relation service |
|
| Method Summary | |
void |
addRelation(ObjectName theRelObjectName)
Adds a MBean created by the user (and registered by him in the MBean Server) as a relation in the Relation Service. |
void |
addRelationType(RelationType theRelTypeObj)
Adds given object as a relation type. |
java.lang.Integer |
checkRoleReading(java.lang.String theRoleName,
java.lang.String theRelTypeName)
Checks if given Role can be read in a relation of the given type. |
java.lang.Integer |
checkRoleWriting(Role theRole,
java.lang.String theRelTypeName,
java.lang.Boolean theInitFlg)
Checks if given Role can be set in a relation of given type. |
void |
createRelation(java.lang.String theRelId,
java.lang.String theRelTypeName,
RoleList theRoleList)
Creates a simple relation (represented by a RelationSupport object) of given relation type, and adds it in the Relation Service. |
void |
createRelationType(java.lang.String theRelTypeName,
RoleInfo[] theRoleInfoArray)
Creates a relation type (RelationTypeSupport object) with given role infos (provided by the RoleInfo objects), and adds it in the Relation Service. |
java.util.Map |
findAssociatedMBeans(ObjectName theMBeanName,
java.lang.String theRelTypeName,
java.lang.String theRoleName)
Retrieves the MBeans associated to given one in a relation. |
java.util.Map |
findReferencingRelations(ObjectName theMBeanName,
java.lang.String theRelTypeName,
java.lang.String theRoleName)
Retrieves the relations where a given MBean is referenced. |
java.util.List |
findRelationsOfType(java.lang.String theRelTypeName)
Returns the relation ids for relations of the given type. |
java.util.List |
getAllRelationIds()
Returns all the relation ids for all the relations handled by the Relation Service |
java.util.List |
getAllRelationTypeNames()
Retrieves names of all known relation types |
RoleResult |
getAllRoles(java.lang.String theRelId)
Returns all roles present in the relation |
MBeanNotificationInfo[] |
getNotificationInfo()
Returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent. |
boolean |
getPurgeFlag()
Returns the flag to indicate if when a notification is received for the unregistration of a 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 will be explicitly called. |
java.util.Map |
getReferencedMBeans(java.lang.String theRelId)
Retrieves MBeans referenced in the various roles of the relation. |
(package private) java.lang.Object |
getRelation(java.lang.String theRelId)
|
(package private) RelationType |
getRelationType(java.lang.String theRelTypeName)
|
java.lang.String |
getRelationTypeName(java.lang.String theRelId)
Returns name of associated relation type for given relation. |
java.util.List |
getRole(java.lang.String theRelId,
java.lang.String theRoleName)
Retrieves role value for given role name in given relation. |
java.lang.Integer |
getRoleCardinality(java.lang.String theRelId,
java.lang.String theRoleName)
Retrieves the number of MBeans currently referenced in the given role |
RoleInfo |
getRoleInfo(java.lang.String theRelTypeName,
java.lang.String theRoleInfoName)
Retrieves role info for given role of a given relation type |
java.util.List |
getRoleInfos(java.lang.String theRelTypeName)
Retrieves list of role infos (RoleInfo objects) of a given relation type |
RoleResult |
getRoles(java.lang.String theRelId,
java.lang.String[] theRoleNameArray)
Retrieves values of roles with given names in given relation. |
void |
handleNotification(Notification theNtf,
java.lang.Object theHandback)
Method inherited from the NotificationListener Interface |
java.lang.Boolean |
hasRelation(java.lang.String theRelId)
Checks if there is a relation identified in Relation Service with given relation id. |
void |
isActive()
Checks if the Relation Service is active. |
java.lang.String |
isRelation(ObjectName theObjName)
Returns the relation id associated to the given ObjectName if the MBean has been added as a relation in the Relation Service. |
ObjectName |
isRelationMBean(java.lang.String theRelId)
If the relation is represented by a MBean (created by the user and added as a relation in the Relation Service), returns the ObjectName of the MBean. |
void |
postDeregister()
Description copied from interface: MBeanRegistration Allows the MBean to perform any operations needed after having been de-registered in the MBean mbeanServer. |
void |
postRegister(java.lang.Boolean registrationDone)
Description copied from interface: MBeanRegistration Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed. |
void |
preDeregister()
Description copied from interface: MBeanRegistration Allows the MBean to perform any operations it needs before being de-registered by the MBean mbeanServer. |
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
Description copied from interface: MBeanRegistration Allows the MBean to perform any operations it needs before being registered in the MBean mbeanServer. |
void |
purgeRelations()
Purges the relations. |
void |
removeRelation(java.lang.String theRelId)
Removes given relation from the Relation Service. |
void |
removeRelationType(java.lang.String theRelTypeName)
Removes given relation type from Relation Service. |
void |
sendRelationCreationNotification(java.lang.String theRelId)
Sends a notification (RelationNotification) for a relation creation. |
void |
sendRelationRemovalNotification(java.lang.String theRelId,
java.util.List theUnregMBeanList)
Sends a notification (RelationNotification) for a relation removal. |
void |
sendRoleUpdateNotification(java.lang.String theRelId,
Role theNewRole,
java.util.List theOldRoleValue)
Sends a notification (RelationNotification) for a role update in the given relation. |
void |
setPurgeFlag(boolean thePurgeFlg)
Sets the flag to indicate if when a notification is received for the unregistration of a 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 will be explicitly called. |
void |
setRole(java.lang.String theRelId,
Role theRole)
Sets the given role in given relation. |
RoleResult |
setRoles(java.lang.String theRelId,
RoleList theRoleList)
Sets the given roles in given relation. |
void |
updateRoleMap(java.lang.String theRelId,
Role theNewRole,
java.util.List theOldRoleValue)
Handles update of the Relation Service role map for the update of given role in given relation. |
| Methods inherited from class javax.management.NotificationBroadcasterSupport |
addNotificationListener,
handleNotification,
handleNotification,
removeNotificationListener,
removeNotificationListener,
sendNotification |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public RelationService(boolean theImmediatePurgeFlg)
theImmediatePurgeFlg - - flag to indicate when a notification
is received for the unregistration of a 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 will be explicitly called.
true is immediate purge.| Method Detail |
public void postDeregister()
public void postRegister(java.lang.Boolean registrationDone)
registrationDone - - Indicates whether or not the MBean
has been successfully registered in the MBean mbeanServer.
The value false means that the registration phase has failed.
public void preDeregister()
throws java.lang.Exception
public ObjectName preRegister(MBeanServer server,
ObjectName name)
throws java.lang.Exception
server - - The MBean server in which the MBean will be registered.name - - The object name of the MBean.
public void addRelation(ObjectName theRelObjectName)
throws java.lang.IllegalArgumentException,
RelationServiceNotRegisteredException,
java.lang.NoSuchMethodException,
InvalidRelationIdException,
InstanceNotFoundException,
InvalidRelationServiceException,
RelationTypeNotFoundException,
RoleNotFoundException,
InvalidRoleValueException
theRelObjectName - - ObjectName of the relation MBean to be added.
public void addRelationType(RelationType theRelTypeObj)
throws java.lang.IllegalArgumentException,
InvalidRelationTypeException
theRelTypeObj - - relation type object (implementing
the RelationType interface)
public java.lang.Integer checkRoleReading(java.lang.String theRoleName,
java.lang.String theRelTypeName)
throws java.lang.IllegalArgumentException,
RelationTypeNotFoundException
theRoleName - - name of role to be checkedtheRelTypeName - - name of the relation type
public java.lang.Integer checkRoleWriting(Role theRole,
java.lang.String theRelTypeName,
java.lang.Boolean theInitFlg)
throws java.lang.IllegalArgumentException,
RelationTypeNotFoundException
theRole - - role to be checkedtheRelTypeName - - name of relation typetheInitFlg - - flag to specify that the checking is done for
the initialisation of a role, write access shall not be verified.
public void createRelation(java.lang.String theRelId,
java.lang.String theRelTypeName,
RoleList theRoleList)
throws RelationServiceNotRegisteredException,
java.lang.IllegalArgumentException,
RoleNotFoundException,
InvalidRelationIdException,
RelationTypeNotFoundException,
InvalidRoleValueException
theRelId - - relation identifier, to uniquely identify the relation inside the Relation ServicetheRelTypeName - - name of the relation type (has to be created in the Relation Service)theRoleList - - role list to initialise roles of the relation (can be null).
public void createRelationType(java.lang.String theRelTypeName,
RoleInfo[] theRoleInfoArray)
throws java.lang.IllegalArgumentException,
InvalidRelationTypeException
theRelTypeName - - name of the relation typetheRoleInfoArray - - array of role infos
public java.util.Map findAssociatedMBeans(ObjectName theMBeanName,
java.lang.String theRelTypeName,
java.lang.String theRoleName)
throws java.lang.IllegalArgumentException
theMBeanName - - ObjectName of MBeantheRelTypeName - - can be null; if specified, only the relations of that type will be
considered in the search. Else all relation types are considered.theRoleName - - can be null; if specified, only the relations where the MBean is
referenced in that role will be considered. Else all roles are considered.
public java.util.Map findReferencingRelations(ObjectName theMBeanName,
java.lang.String theRelTypeName,
java.lang.String theRoleName)
throws java.lang.IllegalArgumentException
theMBeanName - - ObjectName of MBeantheRelTypeName - - can be null; if specified, only the relations of that type will be
considered in the search. Else all relation types are considered.theRoleName - - can be null; if specified, only the relations where the MBean is
referenced in that role will be returned. Else all roles are considered.
public java.util.List findRelationsOfType(java.lang.String theRelTypeName)
throws java.lang.IllegalArgumentException,
RelationTypeNotFoundException
theRelTypeName - - relation type namepublic java.util.List getAllRelationIds()
public java.util.List getAllRelationTypeNames()
public RoleResult getAllRoles(java.lang.String theRelId)
throws java.lang.IllegalArgumentException,
RelationNotFoundException,
RelationServiceNotRegisteredException
theRelId - - relation idpublic boolean getPurgeFlag()
public java.util.Map getReferencedMBeans(java.lang.String theRelId)
throws java.lang.IllegalArgumentException,
RelationNotFoundException
theRelId - - relation id
public java.lang.String getRelationTypeName(java.lang.String theRelId)
throws java.lang.IllegalArgumentException,
RelationNotFoundException
theRelId - - relation id
public java.util.List getRole(java.lang.String theRelId,
java.lang.String theRoleName)
throws RelationServiceNotRegisteredException,
java.lang.IllegalArgumentException,
RelationNotFoundException,
RoleNotFoundException
theRelId - - relation idtheRoleName - - name of role the ArrayList of ObjectName objects being the role value
public java.lang.Integer getRoleCardinality(java.lang.String theRelId,
java.lang.String theRoleName)
throws java.lang.IllegalArgumentException,
RelationNotFoundException,
RoleNotFoundException
theRelId - - relation idtheRoleName - - name of role
public RoleInfo getRoleInfo(java.lang.String theRelTypeName,
java.lang.String theRoleInfoName)
throws java.lang.IllegalArgumentException,
RelationTypeNotFoundException,
RoleInfoNotFoundException
theRelTypeName - - name of relation typetheRoleInfoName - - name of role
public java.util.List getRoleInfos(java.lang.String theRelTypeName)
throws java.lang.IllegalArgumentException,
RelationTypeNotFoundException
theRelTypeName - - name of relation type
public RoleResult getRoles(java.lang.String theRelId,
java.lang.String[] theRoleNameArray)
throws RelationServiceNotRegisteredException,
java.lang.IllegalArgumentException,
RelationNotFoundException
theRelId - - relation idtheRoleNameArray - - array of names of roles to be retrieved
public java.lang.Boolean hasRelation(java.lang.String theRelId)
throws java.lang.IllegalArgumentException
theRelId - - relation id identifying the relation
public void isActive()
throws RelationServiceNotRegisteredException
public java.lang.String isRelation(ObjectName theObjName)
throws java.lang.IllegalArgumentException
theObjName - - ObjectName of supposed relation
public ObjectName isRelationMBean(java.lang.String theRelId)
throws java.lang.IllegalArgumentException,
RelationNotFoundException
theRelId - - relation id identifying the relation
public void purgeRelations()
throws RelationServiceNotRegisteredException
public void removeRelation(java.lang.String theRelId)
throws RelationServiceNotRegisteredException,
java.lang.IllegalArgumentException,
RelationNotFoundException
theRelId - - relation id of the relation to be removed
public void removeRelationType(java.lang.String theRelTypeName)
throws RelationServiceNotRegisteredException,
java.lang.IllegalArgumentException,
RelationTypeNotFoundException
theRelTypeName - - name of the relation type to be removed
public void sendRelationCreationNotification(java.lang.String theRelId)
throws java.lang.IllegalArgumentException,
RelationNotFoundException
theRelId - - relation identifier of the updated relation
public void sendRelationRemovalNotification(java.lang.String theRelId,
java.util.List theUnregMBeanList)
throws java.lang.IllegalArgumentException,
RelationNotFoundException
theRelId - - relation identifier of the updated relationtheUnregMBeanList - - ArrayList of ObjectNames of MBeans expected to be
unregistered due to relation removal (can be null)
public void sendRoleUpdateNotification(java.lang.String theRelId,
Role theNewRole,
java.util.List theOldRoleValue)
throws java.lang.IllegalArgumentException,
RelationNotFoundException
theRelId - - relation identifier of the updated relationtheNewRole - - new role (name and new value)theOldRoleValue - - old role value (ArrayList of ObjectName objects)public void setPurgeFlag(boolean thePurgeFlg)
thePurgeFlg - - flag
public void setRole(java.lang.String theRelId,
Role theRole)
throws RelationServiceNotRegisteredException,
java.lang.IllegalArgumentException,
RelationNotFoundException,
RoleNotFoundException,
InvalidRoleValueException
theRelId - - relation idtheRole - - role to be set (name and new value)
public RoleResult setRoles(java.lang.String theRelId,
RoleList theRoleList)
throws RelationServiceNotRegisteredException,
java.lang.IllegalArgumentException,
RelationNotFoundException
theRelId - - relation idtheRoleList - - list of roles to be set
public void updateRoleMap(java.lang.String theRelId,
Role theNewRole,
java.util.List theOldRoleValue)
throws java.lang.IllegalArgumentException,
RelationServiceNotRegisteredException,
RelationNotFoundException
theRelId - - relation identifier of the updated relationtheNewRole - - new role (name and new value)theOldRoleValue - - old role value (ArrayList of ObjectName objects)
public void handleNotification(Notification theNtf,
java.lang.Object theHandback)
notification - The notification.handback - An opaque object which helps the listener to associate
information regarding the MBean emitter. This object is
passed to the MBean during the addListener call and
resent, without modification, to the listener. The MBean
object should not use or modify the object.public MBeanNotificationInfo[] getNotificationInfo()
RelationType getRelationType(java.lang.String theRelTypeName)
throws java.lang.IllegalArgumentException,
RelationTypeNotFoundException
java.lang.Object getRelation(java.lang.String theRelId)
throws java.lang.IllegalArgumentException,
RelationNotFoundException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||