| javax.management.relation.RelationServiceMBean
All known Subclasses: javax.management.relation.RelationService,
RelationServiceMBean | public interface RelationServiceMBean (Code) | | The Relation Service is in charge of creating and deleting relation types
and relations, of handling the consistency and of providing query mechanisms.
|
Method Summary | |
public void | addRelation(ObjectName theRelObjectName) Adds a MBean created by te user (and registered by him in the MBean
Server) as a relation in the Relation Service. | public void | addRelationType(RelationType theRelTypeObj) Adds given object as a relation type. | public Integer | checkRoleReading(String theRoleName, String theRelTypeName) Checks if given Role can be read in a relation of the given type. | public Integer | checkRoleWriting(Role theRole, String theRelTypeName, Boolean theInitFlg) Checks if given Role can be set in a relation of given type. | public void | createRelation(String theRelId, String theRelTypeName, RoleList theRoleList) 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 initialised using that mean are set to an empty ArrayList
of ObjectNames. | public void | createRelationType(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. | public Map | findAssociatedMBeans(ObjectName theMBeanName, String theRelTypeName, String theRoleName) Retrieves the MBeans associated to given one in a relation.
This corresponds to CIM Associators and AssociatorNames operations.
Parameters: theMBeanName - - ObjectName of MBean Parameters: theRelTypeName - - can be null; if specified, only the relations ofthat type will be considered in the search. | public Map | findReferencingRelations(ObjectName theMBeanName, String theRelTypeName, String theRoleName) Retrieves the relations where a given MBean is referenced.
This corresponds to the CIM "References" and "ReferenceNames" operations.
Parameters: theMBeanName - - ObjectName of MBean Parameters: theRelTypeName - - can be null; if specified, only the relations ofthat type will be considered in the search. | public List | findRelationsOfType(String theRelTypeName) Returns the relation ids for relations of the given type. | public List | getAllRelationIds() | public List | getAllRelationTypeNames() | public RoleResult | getAllRoles(String theRelId) | public boolean | getPurgeFlag() Returns the 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. | public Map | getReferencedMBeans(String theRelId) Retrieves MBeans referenced in the various roles of the relation. | public String | getRelationTypeName(String theRelId) Returns name of associated relation type for given relation. | public List | getRole(String theRelId, String theRoleName) Retrieves role value for given role name in given relation. | public Integer | getRoleCardinality(String theRelId, String theRoleName) Retrieves the number of MBeans currently referenced in the given role. | public RoleInfo | getRoleInfo(String theRelTypeName, String theRoleInfoName) | public List | getRoleInfos(String theRelTypeName) | public RoleResult | getRoles(String theRelId, String[] theRoleNameArray) Retrieves values of roles with given names in given relation. | public Boolean | hasRelation(String theRelId) Checks if there is a relation identified in Relation Service with
given relation id. | public void | isActive() Checks if the Relation Service is active. | public 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. | public ObjectName | isRelationMBean(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. | 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
a MBean referenced in a relation (if the flag is set to true), or not
(if the flag is set to false). | public void | removeRelation(String theRelId) Removes given relation from the Relation Service. | public void | removeRelationType(String theRelTypeName) Removes given relation type from Relation Service. | public void | sendRelationCreationNotification(String theRelId) 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. | public void | sendRelationRemovalNotification(String theRelId, List theUnregMBeanList) Sends a notification (RelationNotification) for a relation removal. | public void | sendRoleUpdateNotification(String theRelId, Role theNewRole, List theOldRoleValue) Sends a notification (RelationNotification) for a role update in the
given relation. | public 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. | public void | setRole(String theRelId, Role theRole) Sets the given role in given relation. | public RoleResult | setRoles(String theRelId, RoleList theRoleList) Sets the given roles in given relation. | public void | updateRoleMap(String theRelId, Role theNewRole, List theOldRoleValue) Handles update of the Relation Service role map for the update of given
role in given relation. |
checkRoleReading | public Integer checkRoleReading(String theRoleName, String theRelTypeName) throws IllegalArgumentException, RelationTypeNotFoundException(Code) | | Checks if given Role can be read in a relation of the given type.
Parameters: theRoleName - - name of role to be checked Parameters: theRelTypeName - - name of the relation type an Integer wrapping an integer corresponding to possibleproblems represented as constants in RoleUnresolved:- 0 if role can be read- integer corresponding to RoleStatus.NO_ROLE_WITH_NAME- integer corresponding to RoleStatus.ROLE_NOT_READABLE throws: IllegalArgument - - if null parameter throws: RelationTypeNotFoundException - - if the relation type is notknown in the Relation Service |
checkRoleWriting | public Integer checkRoleWriting(Role theRole, String theRelTypeName, Boolean theInitFlg) throws IllegalArgumentException, RelationTypeNotFoundException(Code) | | Checks if given Role can be set in a relation of given type.
Parameters: theRole - - role to be checked Parameters: theRelTypeName - - name of relation type Parameters: theInitFlg - - flag to specify that the checking is done for theinitialisation of a role, write access shall not be verified.an Integer wrapping an integer corresponding to possible problems represented asconstants in RoleUnresolved:- 0 if role can be set- integer corresponding to RoleStatus.NO_ROLE_WITH_NAME- integer for RoleStatus.ROLE_NOT_WRITABLE- integer for RoleStatus.LESS_THAN_MIN_ROLE_DEGREE- integer for RoleStatus.MORE_THAN_MAX_ROLE_DEGREE- integer for RoleStatus.REF_MBEAN_OF_INCORRECT_CLASS- integer for RoleStatus.REF_MBEAN_NOT_REGISTERED throws: java.lang.IllegalArgumentException - - if null parameter throws: RelationTypeNotFoundException - - if unknown relation type |
createRelation | public void createRelation(String theRelId, String theRelTypeName, RoleList theRoleList) throws RelationServiceNotRegisteredException, IllegalArgumentException, RoleNotFoundException, InvalidRelationIdException, RelationTypeNotFoundException, InvalidRoleValueException(Code) | | 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 initialised using that mean are set to an empty ArrayList
of ObjectNames. A RelationNotification, with type
RELATION_BASIC_CREATION, is sent.
Parameters: theRelId - - relation identifier, to uniquely identify the relationinside the Relation Service Parameters: theRelTypeName - - name of the relation type (has to be created inthe Relation Service) Parameters: theRoleList - - role list to initialise roles of the relation (can be null). throws: RelationServiceNotRegisteredException - - if the Relation Serviceis not registered in the MBean Server throws: java.lang.IllegalArgumentException - - if null paramater throws: RoleNotFoundException - - if a value is provided for a role thatdoes not exist in the relation type throws: InvalidRelationIdException - - if relation id already used throws: RelationTypeNotFoundException - - if relation type not known inRelation Service throws: InvalidRoleValueException - - if:- the same role name is used for two different roles- the number of referenced MBeans in given value is lessthan expected minimum degree- the number of referenced MBeans in provided value exceedsexpected maximum degree- one referenced MBean in the value is not an Object of theMBean class expected for that role- a MBean provided for that role does not exist |
createRelationType | public void createRelationType(String theRelTypeName, RoleInfo[] theRoleInfoArray) throws IllegalArgumentException, InvalidRelationTypeException(Code) | | Creates a relation type (RelationTypeSupport object) with given role
infos (provided by the RoleInfo objects), and adds it in the Relation Service.
Parameters: theRelTypeName - - name of the relation type Parameters: theRoleInfoArray - - array of role infos throws: java.lang.IllegalArgumentException - - if null parameter throws: InvalidRelationTypeException - - If:- there is already a relation type with that name- the same name has been used for two different role infos- no role info provided- one null role info provided |
findAssociatedMBeans | public Map findAssociatedMBeans(ObjectName theMBeanName, String theRelTypeName, String theRoleName) throws IllegalArgumentException(Code) | | Retrieves the MBeans associated to given one in a relation.
This corresponds to CIM Associators and AssociatorNames operations.
Parameters: theMBeanName - - ObjectName of MBean Parameters: theRelTypeName - - can be null; if specified, only the relations ofthat type will be considered in the search. Else allrelation types are considered. Parameters: theRoleName - - can be null; if specified, only the relations wherethe MBean is referenced in that role will be considered.Else all roles are considered. an HashMap, where the keys are the ObjectNames of the MBeansassociated to given MBean, and the value is, for each key,an ArrayList of the relation ids of the relations where thekey MBean is associated to given one (as they can beassociated in several different relations). throws: java.lang.IllegalArgumentException - - if null parameter |
findReferencingRelations | public Map findReferencingRelations(ObjectName theMBeanName, String theRelTypeName, String theRoleName) throws IllegalArgumentException(Code) | | Retrieves the relations where a given MBean is referenced.
This corresponds to the CIM "References" and "ReferenceNames" operations.
Parameters: theMBeanName - - ObjectName of MBean Parameters: theRelTypeName - - can be null; if specified, only the relations ofthat type will be considered in the search. Else allrelation types are considered. Parameters: theRoleName - - can be null; if specified, only the relations wherethe MBean is referenced in that role will be returned.Else all roles are considered. an HashMap, where the keys are the relation ids of the relationswhere the MBean is referenced, and the value is, for eachkey, an ArrayList of role names (as a MBean can bereferenced in several roles in the same relation). throws: java.lang.IllegalArgumentException - - if null parameter |
getAllRelationIds | public List getAllRelationIds()(Code) | | Returns all the relation ids for all the relations handled by the
Relation Service
ArrayList of String |
getAllRelationTypeNames | public List getAllRelationTypeNames()(Code) | | Retrieves names of all known relation types
ArrayList of relation type names (Strings) |
getPurgeFlag | public boolean getPurgeFlag()(Code) | | Returns the 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.
|
isRelation | public String isRelation(ObjectName theObjName) throws IllegalArgumentException(Code) | | Returns the relation id associated to the given ObjectName if the MBean
has been added as a relation in the Relation Service.
Parameters: theObjName - - ObjectName of supposed relation relation id (String) or null (if the ObjectName is not arelation handled by the Relation Service) throws: java.lang.IllegalArgumentException - - if null parameter |
purgeRelations | public void purgeRelations() throws RelationServiceNotRegisteredException(Code) | | Purges the relations.
Depending on the purgeFlag value, this method is either called
automatically when a notification is received for the unregistration of
a 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 a 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.
throws: RelationServiceNotRegisteredException - - if the Relation Serviceis not registered in the MBean Server. |
sendRelationCreationNotification | public void sendRelationCreationNotification(String theRelId) throws IllegalArgumentException, RelationNotFoundException(Code) | | 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.
Parameters: theRelId - - relation identifier of the updated relation throws: java.lang.IllegalArgumentException - - if null parameter throws: RelationNotFoundException - - if there is no relation for given relation id |
sendRelationRemovalNotification | public void sendRelationRemovalNotification(String theRelId, List theUnregMBeanList) throws IllegalArgumentException, RelationNotFoundException(Code) | | 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.
Parameters: theRelId - - relation identifier of the updated relation Parameters: theUnregMBeanList - - ArrayList of ObjectNames of MBeans expectedto be unregistered due to relation removal (can be null) throws: java.lang.IllegalArgumentException - - if null parameter throws: RelationNotFoundException - - if there is no relation for given relation id |
sendRoleUpdateNotification | public void sendRoleUpdateNotification(String theRelId, Role theNewRole, List theOldRoleValue) throws IllegalArgumentException, RelationNotFoundException(Code) | | 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.
Parameters: theRelId - - relation identifier of the updated relation Parameters: theNewRole - - new role (name and new value) Parameters: theOldRoleValue - - old role value (ArrayList of ObjectName objects) throws: java.lang.IllegalArgumentException - - if null parameter throws: RelationNotFoundException - - if there is no relation for given relation id |
setPurgeFlag | public void setPurgeFlag(boolean thePurgeFlg)(Code) | | 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. true is immediate purge.
Parameters: thePurgeFlg - - flag |
updateRoleMap | public void updateRoleMap(String theRelId, Role theNewRole, List theOldRoleValue) throws IllegalArgumentException, RelationServiceNotRegisteredException, RelationNotFoundException(Code) | | 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.
Parameters: theRelId - - relation identifier of the updated relation Parameters: theNewRole - - new role (name and new value) Parameters: theOldRoleValue - - old role value (ArrayList of ObjectName objects) throws: java.lang.IllegalArgumentException - - if null parameter throws: RelationServiceNotRegisteredException - - if the Relation Serviceis not registered in the MBean Server throws: RelationNotFoundException - - if no relation for given id. |
|
|