Modifier and Type | Method and Description |
---|---|
public void | addRelation(ObjectName
ObjectName of the relation MBean to be added. relationObjectName)Adds an MBean created by the user (and registered by him in the MBean Server) as a relation in the Relation Service. |
public void | addRelationType(RelationType
relation type object (implementing the
RelationType interface) relationTypeObj)Adds given object as a relation type. |
public Integer | Returns: an Integer wrapping an integer corresponding to possible problems 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 name of role to be checked roleName, String name of the relation type relationTypeName)Checks if given Role can be read in a relation of the given type. |
public Integer | Returns: an Integer wrapping an integer corresponding to possible problems represented as constants 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 role to be checked role, String name of relation type relationTypeName, Boolean flag to specify that the checking is done for the
initialization of a role, write access shall not be verified. initFlag)Checks if given Role can be set in a relation of given type. |
public void | createRelation(String
relation identifier, to identify uniquely the relation
inside the Relation Service relationId, String name of the relation type (has to be created
in the Relation Service) relationTypeName, RoleList role list to initialize roles of the relation (can
be null). roleList)Creates a simple relation (represented by a RelationSupport object) of given relation type, and adds it in the Relation Service. |
public void | createRelationType(String
name of the relation type relationTypeName, RoleInfo[] array of role infos roleInfoArray)Creates a relation type (RelationTypeSupport object) with given role infos (provided by the RoleInfo objects), and adds it in the Relation Service. |
public Map | Returns: an HashMap, where the keys are the ObjectNames of the MBeans associated to given MBean, and the value is, for each key, an ArrayList of the relation ids of the relations where the key MBean is associated to given one (as they can be associated in several different relations).ObjectName of MBean mbeanName, String can be null; if specified, only the relations
of that type will be considered in the search. Else all
relation types are considered. relationTypeName, String can be null; if specified, only the relations
where the MBean is referenced in that role will be considered. Else all
roles are considered. roleName)Retrieves the MBeans associated to given one in a relation. |
public Map | Returns: an HashMap, where the keys are the relation ids of the relations where the MBean is referenced, and the value is, for each key, an ArrayList of role names (as an MBean can be referenced in several roles in the same relation).ObjectName of MBean mbeanName, String can be null; if specified, only the relations
of that type will be considered in the search. Else all relation types
are considered. relationTypeName, String can be null; if specified, only the relations
where the MBean is referenced in that role will be returned. Else all
roles are considered. roleName)Retrieves the relations where a given MBean is referenced. |
public List | Returns: an ArrayList of relation ids.relation type name relationTypeName)Returns the relation ids for relations of the given type. |
public List | Returns: ArrayList of StringReturns all the relation ids for all the relations handled by the Relation Service. |
public List | Returns: ArrayList of relation type names (Strings)Retrieves names of all known relation types. |
public RoleResult | Returns: a RoleResult object, including a RoleList (for roles successfully retrieved) and a RoleUnresolvedList (for roles not readable).relation id relationId)Returns all roles present in the relation. |
public boolean | Returns: true if purges are immediate.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. |
public Map | Returns: a HashMap mapping:ObjectName -> ArrayList of String (role names) relation id relationId)Retrieves MBeans referenced in the various roles of the relation. |
public String | Returns: the name of the associated relation type.relation id relationId)Returns name of associated relation type for given relation. |
public List | |
public Integer | Returns: the number of currently referenced MBeans in that rolerelation id relationId, String name of role roleName)Retrieves the number of MBeans currently referenced in the given role. |
public RoleInfo | Returns: RoleInfo object.name of relation type relationTypeName, String name of role roleInfoName)Retrieves role info for given role of a given relation type. |
public List | Returns: ArrayList of RoleInfo.name of relation type relationTypeName)Retrieves list of role infos (RoleInfo objects) of a given relation type. |
public RoleResult | |
public Boolean | Returns: boolean: true if there is a relation, false elserelation id identifying the relation relationId)Checks if there is a relation identified in Relation Service with given relation id. |
public void | |
public String | Returns: relation id (String) or null (if the ObjectName is not a relation handled by the Relation Service)ObjectName of supposed relation objectName)Returns the relation id associated to the given ObjectName if the MBean has been added as a relation in the Relation Service. |
public ObjectName | Returns: ObjectName of the corresponding relation MBean, or null if the relation is not an MBean.relation id identifying the relation 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 | |
public void | removeRelation(String
relation id of the relation to be removed relationId)Removes given relation from the Relation Service. |
public void | removeRelationType(String
name of the relation type to be removed relationTypeName)Removes given relation type from Relation Service. |
public void | sendRelationCreationNotification(String
relation identifier of the updated relation relationId)Sends a notification (RelationNotification) for a relation creation. |
public void | sendRelationRemovalNotification(String
relation identifier of the updated relation relationId, List<ObjectName> List of ObjectNames of MBeans expected
to be unregistered due to relation removal (can be null) unregMBeanList)Sends a notification (RelationNotification) for a relation removal. |
public void | sendRoleUpdateNotification(String
relation identifier of the updated relation relationId, Role new role (name and new value) newRole, List<ObjectName> old role value (List of ObjectName objects) oldRoleValue)Sends a notification (RelationNotification) for a role update in the given relation. |
public void | setPurgeFlag(boolean
flag 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. |
public void | |
public RoleResult | |
public void | updateRoleMap(String
relation identifier of the updated relation relationId, Role new role (name and new value) newRole, List<ObjectName> old role value (List of ObjectName objects) oldRoleValue)Handles update of the Relation Service role map for the update of given role in given relation. |
addRelation | back to summary |
---|---|
public void addRelation(ObjectName relationObjectName) throws IllegalArgumentException, RelationServiceNotRegisteredException, NoSuchMethodException, InvalidRelationIdException, InstanceNotFoundException, InvalidRelationServiceException, RelationTypeNotFoundException, RoleNotFoundException, InvalidRoleValueException 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.
|
addRelationType | back to summary |
---|---|
public void addRelationType(RelationType relationTypeObj) throws IllegalArgumentException, InvalidRelationTypeException Adds given object as a relation type. The object is expected to implement the RelationType interface.
|
checkRoleReading | back to summary |
---|---|
public Integer checkRoleReading(String roleName, String relationTypeName) throws IllegalArgumentException, RelationTypeNotFoundException Checks if given Role can be read in a relation of the given type.
|
checkRoleWriting | back to summary |
---|---|
public Integer checkRoleWriting(Role role, String relationTypeName, Boolean initFlag) throws IllegalArgumentException, RelationTypeNotFoundException Checks if given Role can be set in a relation of given type.
|
createRelation | back to summary |
---|---|
public void createRelation(String relationId, String relationTypeName, RoleList roleList) throws RelationServiceNotRegisteredException, IllegalArgumentException, RoleNotFoundException, InvalidRelationIdException, RelationTypeNotFoundException, InvalidRoleValueException 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.
|
createRelationType | back to summary |
---|---|
public void createRelationType(String relationTypeName, RoleInfo[] roleInfoArray) throws IllegalArgumentException, InvalidRelationTypeException Creates a relation type (RelationTypeSupport object) with given role infos (provided by the RoleInfo objects), and adds it in the Relation Service.
|
findAssociatedMBeans | back to summary |
---|---|
public Map Retrieves the MBeans associated to given one in a relation. This corresponds to CIM Associators and AssociatorNames operations.
|
findReferencingRelations | back to summary |
---|---|
public Map Retrieves the relations where a given MBean is referenced. This corresponds to the CIM "References" and "ReferenceNames" operations.
|
findRelationsOfType | back to summary |
---|---|
public List Returns the relation ids for relations of the given type.
|
getAllRelationIds | back to summary |
---|---|
public List Returns all the relation ids for all the relations handled by the Relation Service. |
getAllRelationTypeNames | back to summary |
---|---|
public List Retrieves names of all known relation types. |
getAllRoles | back to summary |
---|---|
public RoleResult getAllRoles(String relationId) throws IllegalArgumentException, RelationNotFoundException, RelationServiceNotRegisteredException Returns all roles present in the relation.
|
getPurgeFlag | back to summary |
---|---|
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.
|
getReferencedMBeans | back to summary |
---|---|
public Map Retrieves MBeans referenced in the various roles of the relation.
|
getRelationTypeName | back to summary |
---|---|
public String getRelationTypeName(String relationId) throws IllegalArgumentException, RelationNotFoundException Returns name of associated relation type for given relation.
|
getRole | back to summary |
---|---|
public List Retrieves role value for given role name in given relation.
|
getRoleCardinality | back to summary |
---|---|
public Integer getRoleCardinality(String relationId, String roleName) throws IllegalArgumentException, RelationNotFoundException, RoleNotFoundException Retrieves the number of MBeans currently referenced in the given role.
|
getRoleInfo | back to summary |
---|---|
public RoleInfo getRoleInfo(String relationTypeName, String roleInfoName) throws IllegalArgumentException, RelationTypeNotFoundException, RoleInfoNotFoundException Retrieves role info for given role of a given relation type.
|
getRoleInfos | back to summary |
---|---|
public List Retrieves list of role infos (RoleInfo objects) of a given relation type.
|
getRoles | back to summary |
---|---|
public RoleResult getRoles(String relationId, String[] roleNameArray) throws RelationServiceNotRegisteredException, IllegalArgumentException, RelationNotFoundException Retrieves values of roles with given names in given relation.
|
hasRelation | back to summary |
---|---|
public Boolean hasRelation(String relationId) throws IllegalArgumentException Checks if there is a relation identified in Relation Service with given relation id.
|
isActive | back to summary |
---|---|
public void isActive() throws RelationServiceNotRegisteredException Checks if the Relation Service is active. Current condition is that the Relation Service must be registered in the MBean Server
|
isRelation | back to summary |
---|---|
public String isRelation(ObjectName objectName) throws IllegalArgumentException Returns the relation id associated to the given ObjectName if the MBean has been added as a relation in the Relation Service.
|
isRelationMBean | back to summary |
---|---|
public ObjectName isRelationMBean(String relationId) throws IllegalArgumentException, RelationNotFoundException 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.
|
purgeRelations | back to summary |
---|---|
public void purgeRelations() throws RelationServiceNotRegisteredException 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.
|
removeRelation | back to summary |
---|---|
public void removeRelation(String relationId) throws RelationServiceNotRegisteredException, IllegalArgumentException, RelationNotFoundException 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,
|
removeRelationType | back to summary |
---|---|
public void removeRelationType(String relationTypeName) throws RelationServiceNotRegisteredException, IllegalArgumentException, RelationTypeNotFoundException Removes given relation type from Relation Service. The relation objects of that type will be removed from the Relation Service.
|
sendRelationCreationNotification | back to summary |
---|---|
public void sendRelationCreationNotification(String relationId) throws IllegalArgumentException, RelationNotFoundException 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.
|
sendRelationRemovalNotification | back to summary |
---|---|
public void sendRelationRemovalNotification(String relationId, List<ObjectName> unregMBeanList) throws IllegalArgumentException, RelationNotFoundException 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.
|
sendRoleUpdateNotification | back to summary |
---|---|
public void sendRoleUpdateNotification(String relationId, Role newRole, List<ObjectName> oldRoleValue) throws IllegalArgumentException, RelationNotFoundException 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.
|
setPurgeFlag | back to summary |
---|---|
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.
|
setRole | back to summary |
---|---|
public void setRole(String relationId, Role role) throws RelationServiceNotRegisteredException, IllegalArgumentException, RelationNotFoundException, RoleNotFoundException, InvalidRoleValueException, RelationTypeNotFoundException 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 deregistrations.
|
setRoles | back to summary |
---|---|
public RoleResult setRoles(String relationId, RoleList roleList) throws RelationServiceNotRegisteredException, IllegalArgumentException, RelationNotFoundException 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 deregistrations.
|
updateRoleMap | back to summary |
---|---|
public void updateRoleMap(String relationId, Role newRole, List<ObjectName> oldRoleValue) throws IllegalArgumentException, RelationServiceNotRegisteredException, RelationNotFoundException 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.
|