| javax.management.relation.RelationServiceMBean
All known Subclasses: javax.management.relation.RelationService,
RelationServiceMBean | public interface RelationServiceMBean (Code) | | This interface defines the management interface for a relation
service.
The relation service performs the following functions:
Creating and deleting relation types and relations.
Making sure relations are consistent as defined by information
in their relation types/roles.
Allowing relations to be queried.
Revisions:
20020312 Adrian Brock:
- Fixed wrong exception types thrown
- Add missing method getRoles(String, String[])
author: Adrian Brock. version: $Revision: 57200 $ |
Method Summary | |
public void | addRelation(ObjectName relation) Add a manually created relation to the relation service. | public void | addRelationType(RelationType relationType) Add a relation type to the relation service. | public Integer | checkRoleReading(String roleName, String relationTypeName) Checks whether the passed role can be read in the given
relation type.
The return value is either zero when readable or a value from
RoleStatus .
Parameters: roleName - the name of the role to check. Parameters: relationTypeName - the relation type to check. | public Integer | checkRoleWriting(Role role, String relationTypeName, Boolean initFlag) Checks whether the passed role can be written in the given
relation type.
The return value is either zero when writable or a value from
RoleStatus .
Parameters: role - the role to check. Parameters: relationTypeName - the relation type to check. Parameters: initFlag - write access is not check when this flag is true. | public void | createRelation(String relationId, String relationTypeName, RoleList roleList) Create a simple relation using
RelationSupport for a relation
type within the relation service.
Roles not initialised are set to an empty ArrayList.
A RELATION_BASIC_CREATION notification is sent. | public void | createRelationType(String relationTypeName, RoleInfo[] roleInfos) Create a relation type within the relation service. | public Map | findAssociatedMBeans(ObjectName mbeanName, String relationTypeName, String roleName) Retrieves MBeans associated with the passed MBean in the passed
relation type and role.
Parameters: mbeanName - the name of the reference MBean Parameters: relationTypeName - the relation type, null means check allrelation types. Parameters: roleName - the role, null means check all roles. | public Map | findReferencingRelations(ObjectName mbeanName, String relationTypeName, String roleName) Retrieves MBeans referencing the passed MBean in the passed
relation type and role.
Parameters: mbeanName - the name of the referenced MBean Parameters: relationTypeName - the relation type, null means check allrelation types. Parameters: roleName - the role, null means check all roles. | public List | findRelationsOfType(String relationTypeName) Retrieves the relation ids for relations of the passed type.
Parameters: relationTypeName - the relation type. | public List | getAllRelationIds() Retrieves all the relation ids. | public List | getAllRelationTypeNames() Retrieves all the relation type names. | public RoleResult | getAllRoles(String relationId) Retrieves all the roles for a given relation id. | public boolean | getPurgeFlag() Retrieves the purge flag. | public Map | getReferencedMBeans(String relationId) Retrieves all the MBeans referenced in all the roles of a
relation. | public String | getRelationTypeName(String relationId) Retrieves the relation type name for the passed relation. | public List | getRole(String relationId, String roleName) Retrieves MBeans in a role for a given relation id. | public Integer | getRoleCardinality(String relationId, String roleName) Retrieves the number of MBeans in a role for a given relation id. | public RoleInfo | getRoleInfo(String relationTypeName, String roleInfoName) Retrieves the role information for a given relation type. | public List | getRoleInfos(String relationTypeName) Retrieves all the role information for a given relation type. | public RoleResult | getRoles(String relationId, String[] roleNames) Retrieves selected roles for a relation. | public Boolean | hasRelation(String relationId) Checks whether the relation service has the passed relation id. | public void | isActive() Checks whether the relation service is active, i.e. | public String | isRelation(ObjectName objectName) Checks whether the passed object name is a relation in this relation
service. | public ObjectName | isRelationMBean(String relationId) Checks whether the passed relation id is an MBean created by a user
or has been internally created by the relation service. | public void | purgeRelations() Purge relations. | public void | removeRelation(String relationId) Removes a relation from the relation service.
For internally created relations, a RELATION_BASIC_REMOVAL
notification is sent.
For externally created relations, a RELATION_MBEAN_REMOVAL
notification is sent.
The MBeans referenced in the relation are unaffected. | public void | removeRelationType(String relationTypeName) Removes a relation type from the relation service.
Any relations using this relation type are also removed. | public void | sendRelationCreationNotification(String relationId) | public void | sendRelationRemovalNotification(String relationId, List unregMBeans) | public void | sendRoleUpdateNotification(String relationId, Role newRole, List oldRoleValue) Sends a relation update notification
For internally created relations, a RELATION_BASIC_UPDATE
notification is sent.
For externally created relations, a RELATION_MBEAN_UPDATE
notification is sent.
The source is this relation service.
This method is called from the RelationSupport setRole() and
setRoles() methods. | public void | setPurgeFlag(boolean value) Sets the purge flag. | public void | setRole(String relationId, Role role) Sets the role in the passed relation.
The role will be validated according to information in the relation
type.
The relation service will keep track the MBeans unregistration
to maintain the consistency of the relation. | public RoleResult | setRoles(String relationId, RoleList roles) Sets the roles in the passed relation.
The roles will be validated according to information in the relation
type.
The relation service will keep track the MBeans unregistration
to maintain the consistency of the relation. | public void | updateRoleMap(String relationId, Role newRole, List oldRoleValue) Handles the update of the relation service role map when a role
is changed.
It is called from RelationSupport setRole() and setRoles() and
the relation service's setRole() and setRoles() methods.
The relation service will keep track the MBeans unregistration
to maintain the consistency of the relation. |
createRelation | public void createRelation(String relationId, String relationTypeName, RoleList roleList) throws RelationServiceNotRegisteredException, IllegalArgumentException, RoleNotFoundException, InvalidRelationIdException, RelationTypeNotFoundException, InvalidRoleValueException(Code) | | Create a simple relation using
RelationSupport for a relation
type within the relation service.
Roles not initialised are set to an empty ArrayList.
A RELATION_BASIC_CREATION notification is sent.
Parameters: relationId - the relation id of the relation Parameters: relationTypeName - the relation type of the relation Parameters: roleList - the roles to initialise in the relation (can be null) throws: IllegalArgumentException - for a null parameter. throws: RelationServiceNotRegisteredException - when the relationservice is not registered with the MBeanServer. throws: InvalidRelationIdException - if the relation idis already used by another relation. throws: RelationTypeNotFoundException - if there is no relation type inthe relation or the relation type has not been registeredwith the relation service. throws: InvalidRoleValueException - if the number of MBeans in arole is outside the bounds of the RoleInfo defined in therelation type, one of the MBeans is not of the correctclass, an MBean does not exist, the same role name isused in two different relations. throws: RoleNotFoundException - if a role in the relation is notin the relation type. |
findAssociatedMBeans | public Map findAssociatedMBeans(ObjectName mbeanName, String relationTypeName, String roleName) throws IllegalArgumentException(Code) | | Retrieves MBeans associated with the passed MBean in the passed
relation type and role.
Parameters: mbeanName - the name of the reference MBean Parameters: relationTypeName - the relation type, null means check allrelation types. Parameters: roleName - the role, null means check all roles. a HashMap with keys of the related MBeans with thevalue for each MBean an ArrayList of Relation Types. throws: IllegalArgumentException - for a null object name. |
findReferencingRelations | public Map findReferencingRelations(ObjectName mbeanName, String relationTypeName, String roleName) throws IllegalArgumentException(Code) | | Retrieves MBeans referencing the passed MBean in the passed
relation type and role.
Parameters: mbeanName - the name of the referenced MBean Parameters: relationTypeName - the relation type, null means check allrelation types. Parameters: roleName - the role, null means check all roles. a HashMap with keys of the referencing MBeans with thevalue for each MBean an ArrayList of Relation Types. throws: IllegalArgumentException - for a null object name. |
getAllRelationIds | public List getAllRelationIds()(Code) | | Retrieves all the relation ids.
an ArrayList of relation ids. |
getAllRelationTypeNames | public List getAllRelationTypeNames()(Code) | | Retrieves all the relation type names.
an ArrayList of relation type names |
getPurgeFlag | public boolean getPurgeFlag()(Code) | | Retrieves the purge flag. This flag controls whether all relations
have to validated when notification is received of an MBeans
unregistration or whether the purgeRelations() method has to be
called.
true for an immediate purge on unregistration, false otherwise. |
isRelation | public String isRelation(ObjectName objectName) throws IllegalArgumentException(Code) | | Checks whether the passed object name is a relation in this relation
service.
Parameters: objectName - the name of the MBean to check the relation id the MBean is registered as, or nullwhen not registered. throws: IllegalArgumentException - for a null object name. |
purgeRelations | public void purgeRelations() throws RelationServiceNotRegisteredException(Code) | | Purge relations. This method is called automatically when the purge
flag is true and an MBean in a relation is unregistered.
Not purging relations automatically can lead to problems when the
same object name is reused.
If the unregistration causes a role to go below its minimal cardinality,
the relation is removed. Otherwise the relation's
handleMBeanUnregistration() is called.
throws: RelationServiceNotRegisteredException - when the relationservice is not registered with an MBeanServer. |
sendRelationCreationNotification | public void sendRelationCreationNotification(String relationId) throws IllegalArgumentException, RelationNotFoundException(Code) | | Sends a relation creation notification
For internally created relations, a RELATION_BASIC_CREATION
notification is sent.
For externally created relations, a RELATION_MBEAN_CREATION
notification is sent.
The source is this relation service.
This method is called by addRelation() and createRelation()
Parameters: relationId - the relation id throws: IllegalArgumentException - for a null parameter. throws: RelationNotFoundException - when the relation id does notexist. |
sendRelationRemovalNotification | public void sendRelationRemovalNotification(String relationId, List unregMBeans) throws IllegalArgumentException, RelationNotFoundException(Code) | | Sends a relation removal notification
For internally created relations, a RELATION_BASIC_REMOVAL
notification is sent.
For externally created relations, a RELATION_MBEAN_REMOVAL
notification is sent.
The source is this relation service.
This method is called by removeRelation()
Parameters: relationId - the relation id Parameters: unregMBeans - a list of MBeans to be unregistered due to thisremoval (can be null) throws: IllegalArgumentException - for a null parameter. throws: RelationNotFoundException - when the relation id does notexist. |
sendRoleUpdateNotification | public void sendRoleUpdateNotification(String relationId, Role newRole, List oldRoleValue) throws IllegalArgumentException, RelationNotFoundException(Code) | | Sends a relation update notification
For internally created relations, a RELATION_BASIC_UPDATE
notification is sent.
For externally created relations, a RELATION_MBEAN_UPDATE
notification is sent.
The source is this relation service.
This method is called from the RelationSupport setRole() and
setRoles() methods.
Parameters: relationId - the relation id Parameters: newRole - the new role Parameters: oldRoleValue - a list of MBeans in the old role throws: IllegalArgumentException - for a null parameter. throws: RelationNotFoundException - when the relation id does notexist. |
setPurgeFlag | public void setPurgeFlag(boolean value)(Code) | | Sets the purge flag. This flag controls whether all relations
have to validated when notification is received of an MBeans
unregistration or whether the purgeRelations() method has to be
called.
Parameters: value - true for an immediate purge on unregistration, falseotherwise. |
|
|