Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.management.relation
Interface Relation  view Relation download Relation.java

All Known Subinterfaces:
RelationSupportMBean
All Known Implementing Classes:
RelationSupport

public interface Relation

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.

Version:
$Revision: 1.2 $

Method Summary
 RoleResult getAllRoles()
          Retrieves all the roles in this relation.
 java.util.Map getReferencedMBeans()
          Retrieves MBeans referenced by roles of this relation.
 java.lang.String getRelationId()
          Retrieves the relation id used to identify the relation within the relation service.
 javax.management.ObjectName getRelationServiceName()
          Retrieves the object name of the relation service this relation is registered with.
 java.lang.String getRelationTypeName()
          Retrieves the relation type for this relation.
 java.util.List getRole(java.lang.String roleName)
          Retrieves the role for the passed role name.
 java.lang.Integer getRoleCardinality(java.lang.String roleName)
          Retrieves the number of MBeans in a given role.
 RoleResult getRoles(java.lang.String[] roleNames)
          Retrieves the roles in this relation with the passed names.
 void handleMBeanUnregistration(javax.management.ObjectName objectName, java.lang.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

getAllRoles

public RoleResult getAllRoles()
                       throws RelationServiceNotRegisteredException
Retrieves all the roles in this relation.


getReferencedMBeans

public java.util.Map getReferencedMBeans()
Retrieves MBeans referenced by roles of this relation.

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.


getRelationId

public java.lang.String getRelationId()
Retrieves the relation id used to identify the relation within the relation service.


getRelationServiceName

public javax.management.ObjectName getRelationServiceName()
Retrieves the object name of the relation service this relation is registered with.


getRelationTypeName

public java.lang.String getRelationTypeName()
Retrieves the relation type for this relation.


getRole

public java.util.List getRole(java.lang.String roleName)
                       throws java.lang.IllegalArgumentException,
                              RoleNotFoundException,
                              RelationServiceNotRegisteredException
Retrieves the role for the passed role name. The role must exist and be readable.

The return value is an ArrayList of object names in the role.


getRoleCardinality

public java.lang.Integer getRoleCardinality(java.lang.String roleName)
                                     throws java.lang.IllegalArgumentException,
                                            RoleNotFoundException
Retrieves the number of MBeans in a given role.


getRoles

public RoleResult getRoles(java.lang.String[] roleNames)
                    throws java.lang.IllegalArgumentException,
                           RelationServiceNotRegisteredException
Retrieves the roles in this relation with the passed names.


handleMBeanUnregistration

public void handleMBeanUnregistration(javax.management.ObjectName objectName,
                                      java.lang.String roleName)
                               throws RoleNotFoundException,
                                      InvalidRoleValueException,
                                      RelationServiceNotRegisteredException,
                                      RelationTypeNotFoundException,
                                      RelationNotFoundException
The relation service will call this service when an MBean referenced in a role is unregistered.

The object name should be removed from the role.

Calling this method manually may result in incorrect behaviour


retrieveAllRoles

public RoleList retrieveAllRoles()
Retrieve all the roles in this relation without checking the role mode.


setRole

public void setRole(Role role)
             throws java.lang.IllegalArgumentException,
                    InvalidRoleValueException,
                    RoleNotFoundException,
                    RelationServiceNotRegisteredException,
                    RelationTypeNotFoundException,
                    RelationNotFoundException
Sets the passed role for this relation.

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.


setRoles

public RoleResult setRoles(RoleList roleList)
                    throws java.lang.IllegalArgumentException,
                           RelationServiceNotRegisteredException,
                           RelationTypeNotFoundException,
                           RelationNotFoundException
Sets the roles.

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.