|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is implemented by an MBean that represents a relation.
Relations with only roles can be created by the relation service using a
RelationSupport
object.More complicated relations have to implemented manually. The
RelationSupport
can be used to help in the implementation.Any properties or methods must be exposed for management by the implementing MBean.
Method Summary | |
RoleResult |
getAllRoles()
Retrieves all the roles in this relation. |
Map |
getReferencedMBeans()
Retrieves MBeans referenced by roles of this relation. |
String |
getRelationId()
Retrieves the relation id used to identify the relation within the relation service. |
ObjectName |
getRelationServiceName()
Retrieves the object name of the relation service this relation is registered with. |
String |
getRelationTypeName()
Retrieves the relation type for this relation. |
List |
getRole(String roleName)
Retrieves the role for the passed role name. |
Integer |
getRoleCardinality(String roleName)
Retrieves the number of MBeans in a given role. |
RoleResult |
getRoles(String[] roleNames)
Retrieves the roles in this relation with the passed names. |
void |
handleMBeanUnregistration(ObjectName objectName,
String roleName)
The relation service will call this service when an MBean referenced in a role is unregistered. |
RoleList |
retrieveAllRoles()
Retrieve all the roles in this relation without checking the role mode. |
void |
setRole(Role role)
Sets the passed role for this relation. |
RoleResult |
setRoles(RoleList roleList)
Sets the roles. |
Method Detail |
public List getRole(String roleName) throws IllegalArgumentException, RoleNotFoundException, RelationServiceNotRegisteredException
The return value is an ArrayList of object names in the role.
roleName
- the role name.
IllegalArgumentException
- for a null role name.
RoleNotFoundException
- when there is no such role or
it is not readable.
RelationServiceNotRegisteredException
- when the relation service
is not registered with an MBeanServer.public RoleResult getRoles(String[] roleNames) throws IllegalArgumentException, RelationServiceNotRegisteredException
roleNames
- an array of role names
IllegalArgumentException
- for a null role names.
RelationServiceNotRegisteredException
- when the relation service
is not registered with an MBeanServer.public Integer getRoleCardinality(String roleName) throws IllegalArgumentException, RoleNotFoundException
roleName
- the role name.
IllegalArgumentException
- for a null role name.
RoleNotFoundException
- when there is no such role.public RoleResult getAllRoles() throws RelationServiceNotRegisteredException
RelationServiceNotRegisteredException
- when the relation service
is not registered with an MBeanServer.public RoleList retrieveAllRoles()
public void setRole(Role role) throws IllegalArgumentException, RoleNotFoundException, RelationTypeNotFoundException, InvalidRoleValueException, RelationServiceNotRegisteredException, RelationNotFoundException
The role is checked according to its role definition in the relation type. The role is not valid if there are the wrong number of MBeans, an MBean is of an incorrect class or an MBean does not exist.
The notification RELATION_BASIC_UPDATE is sent when the relation is not an MBean or RELATION_MBEAN_UPDATE when it is.
role
- the new role.
IllegalArgumentException
- for a null role.
InvalidRoleValueException
- if the role is not valid.
RoleNotFoundException
- if the role is not writable.
This test is not performed at initialisation.
RelationServiceNotRegisteredException
- when the relation service
is not registered with an MBeanServer.
RelationTypeNotFoundException
- when the relation type has
not been registered in the relation service.
RelationNotFoundException
- when this method is called for
for an MBean not registered with the relation service.public RoleResult setRoles(RoleList roleList) throws IllegalArgumentException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException
The roles are checked according to its role definition in the relation type. The role is not valid if there are the wrong number of MBeans, an MBean is of an incorrect class or an MBean does not exist.
A notification RELATION_BASIC_UPDATE is sent when the relation is not an MBean or RELATION_MBEAN_UPDATE when it is for every updated role.
The return role result has a role list for successfully updated roles and an unresolved list for roles not set.
roleList
- the new roles.
IllegalArgumentException
- for a null role name.
RelationServiceNotRegisteredException
- when the relation service
is not registered with an MBeanServer.
RelationTypeNotFoundException
- when the relation type has
not been registered in the relation service.
RelationNotFoundException
- when this method is called for
for an MBean not registered with the relation service.public void handleMBeanUnregistration(ObjectName objectName, String roleName) throws IllegalArgumentException, RoleNotFoundException, InvalidRoleValueException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException
The object name should be removed from the role.
Calling this method manually may result in incorrect behaviour
objectName
- the object name unregistered.roleName
- the role the containing the object.
RoleNotFoundException
- if the role does exist or it is not
writable.
InvalidRoleValueException
- when the role does not conform
to the associated role info.
RelationServiceNotRegisteredException
- when the relation service
is not registered with an MBeanServer.
RelationTypeNotFoundException
- when the relation type has
not been registered in the relation service.
RelationNotFoundException
- when this method is called for
for an MBean not registered with the relation service.
IllegalArgumentException
public Map getReferencedMBeans()
The return value is a map keyed by MBean object names. The objects are associated with an ArrayList that contains all the role names the MBean has within this relation.
public String getRelationTypeName()
public ObjectName getRelationServiceName()
public String getRelationId()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |