Simple relations, i.e. having only roles, no properties or methods, can be created directly by the Relation Service (represented as RelationSupport objects, internally handled by the Relation Service).
If the user wants to represent more complex relations, involving properties and/or methods, he has to provide his own class implementing the Relation interface. This can be achieved either by inheriting from RelationSupport class, or by implementing the interface (fully or delegation to a RelationSupport object member).
Specifying such user relation class is to introduce properties and/or methods. Those have to be exposed for remote management. So this means that any user relation class must be a MBean class.
Modifier and Type | Method and Description |
---|---|
public RoleResult | Returns: a RoleResult object, including a RoleList (for roles successfully retrieved) and a RoleUnresolvedList (for roles not readable).Returns all roles present in the relation. |
public Map | Returns: a HashMap mapping:ObjectName -> ArrayList of String (role names) Retrieves MBeans referenced in the various roles of the relation. |
public String | Returns: the relation id.Returns relation identifier (used to uniquely identify the relation inside the Relation Service). |
public ObjectName | Returns: the ObjectName of the Relation Service.Returns ObjectName of the Relation Service handling the relation. |
public String | Returns: the name of the relation type.Returns name of associated relation type. |
public List | |
public Integer | Returns: the number of currently referenced MBeans in that rolename of role roleName)Returns the number of MBeans currently referenced in the given role. |
public RoleResult | |
public void | handleMBeanUnregistration(ObjectName
ObjectName of unregistered MBean objectName, String name of role where the MBean is referenced roleName)Callback used by the Relation Service when a MBean referenced in a role is unregistered. |
public RoleList | |
public void | |
public RoleResult |
getAllRoles | back to summary |
---|---|
public RoleResult getAllRoles() throws RelationServiceNotRegisteredException Returns all roles present in the relation.
|
getReferencedMBeans | back to summary |
---|---|
public Map Retrieves MBeans referenced in the various roles of the relation.
|
getRelationId | back to summary |
---|---|
public String getRelationId() Returns relation identifier (used to uniquely identify the relation inside the Relation Service).
|
getRelationServiceName | back to summary |
---|---|
public ObjectName getRelationServiceName() Returns ObjectName of the Relation Service handling the relation.
|
getRelationTypeName | back to summary |
---|---|
public String getRelationTypeName() Returns name of associated relation type.
|
getRole | back to summary |
---|---|
public List Retrieves role value for given role name. Checks if the role exists and is readable according to the relation type.
|
getRoleCardinality | back to summary |
---|---|
public Integer getRoleCardinality(String roleName) throws IllegalArgumentException, RoleNotFoundException Returns the number of MBeans currently referenced in the given role.
|
getRoles | back to summary |
---|---|
public RoleResult getRoles(String[] roleNameArray) throws IllegalArgumentException, RelationServiceNotRegisteredException Retrieves values of roles with given names. Checks for each role if it exists and is readable according to the relation type.
|
handleMBeanUnregistration | back to summary |
---|---|
public void handleMBeanUnregistration(ObjectName objectName, String roleName) throws IllegalArgumentException, RoleNotFoundException, InvalidRoleValueException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException Callback used by the Relation Service when a MBean referenced in a role is unregistered. The Relation Service will call this method to let the relation take action to reflect the impact of such unregistration. BEWARE. the user is not expected to call this method. Current implementation is to set the role with its current value (list of ObjectNames of referenced MBeans) without the unregistered one.
|
retrieveAllRoles | back to summary |
---|---|
public RoleList retrieveAllRoles() Returns all roles in the relation without checking read mode.
|
setRole | back to summary |
---|---|
public void setRole(Role role) throws IllegalArgumentException, RoleNotFoundException, RelationTypeNotFoundException, InvalidRoleValueException, RelationServiceNotRegisteredException, RelationNotFoundException Sets the given role. Will check the role according to its corresponding role definition provided in relation's relation type Will send a notification (RelationNotification with type RELATION_BASIC_UPDATE or RELATION_MBEAN_UPDATE, depending if the relation is a MBean or not).
|
setRoles | back to summary |
---|---|
public RoleResult setRoles(RoleList roleList) throws IllegalArgumentException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException Sets the given roles. Will check the role according to its corresponding role definition provided in relation's relation type Will send one notification (RelationNotification with type RELATION_BASIC_UPDATE or RELATION_MBEAN_UPDATE, depending if the relation is a MBean or not) per updated role.
|