javax.management.relation
Class RelationTypeSupport

java.lang.Object
  extended byjavax.management.relation.RelationTypeSupport
All Implemented Interfaces:
RelationType (src) , java.io.Serializable

public class RelationTypeSupport
extends java.lang.Object
implements RelationType (src)

This class can be used to implement relation types.

It holds RoleInfo objects for all roles in the relation.

Revisions:

20020312 Adrian Brock:

20020715 Adrian Brock:

See Also:
Serialized Form

Constructor Summary
protected RelationTypeSupport(java.lang.String name)
          Create a relation type with a name but no role infos.
  RelationTypeSupport(java.lang.String name, RoleInfo (src) [] infos)
          Create a relation type with a name and the passed role infos.
 
Method Summary
protected  void addRoleInfo(RoleInfo (src)  roleInfo)
          Add a role information object to the relation type.
 java.lang.String getRelationTypeName()
          Retrieves the name of this relation type.
 RoleInfo (src) getRoleInfo(java.lang.String roleInfoName)
          Retrieves the role info for a role name.
 java.util.List getRoleInfos()
          Retrieves the list of role definitions in this relation type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationTypeSupport

protected RelationTypeSupport(java.lang.String name)
Create a relation type with a name but no role infos.

WARNING: No check is made on the arguments.

Parameters:
name - the relation type name.

RelationTypeSupport

public RelationTypeSupport(java.lang.String name,
                           RoleInfo (src) [] infos)
                    throws java.lang.IllegalArgumentException,
                           InvalidRelationTypeException (src) 
Create a relation type with a name and the passed role infos.

A relation type is invalid if the same name is used in two different role infos, no role information is provided or a null role is passed.

Parameters:
name - the relation type name.
Throws:
java.lang.IllegalArgumentException - for null parameters
InvalidRelationTypeException (src) - for an invalid relation
Method Detail

getRelationTypeName

public java.lang.String getRelationTypeName()
Description copied from interface: RelationType (src)
Retrieves the name of this relation type.

Specified by:
getRelationTypeName in interface RelationType (src)
Returns:
the name.

getRoleInfos

public java.util.List getRoleInfos()
Description copied from interface: RelationType (src)
Retrieves the list of role definitions in this relation type.

The return value is a list of RoleInfo objects. The list must be an ArrayList.

Specified by:
getRoleInfos in interface RelationType (src)
Returns:
the list of Role Infos.

getRoleInfo

public RoleInfo (src)  getRoleInfo(java.lang.String roleInfoName)
                     throws java.lang.IllegalArgumentException,
                            RoleInfoNotFoundException (src) 
Description copied from interface: RelationType (src)
Retrieves the role info for a role name.

Specified by:
getRoleInfo in interface RelationType (src)
Returns:
the role info or null.
Throws:
RoleInfoNotFoundException (src) - for no role info with the passed name in the relation type.
java.lang.IllegalArgumentException - for a null role info name.

addRoleInfo

protected void addRoleInfo(RoleInfo (src)  roleInfo)
                    throws java.lang.IllegalArgumentException,
                           InvalidRelationTypeException (src) 
Add a role information object to the relation type.

Throws:
java.lang.IllegalArgumentException - for null parameters
InvalidRelationTypeException (src) - for a duplicate role name.