javax.management.relation
Class RelationTypeSupport

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.management.relation.RelationTypeSupport
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , RelationType sample code for javax.management.relation.RelationType definition code for javax.management.relation.RelationType

public class RelationTypeSupport
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements RelationType sample code for javax.management.relation.RelationType definition code for javax.management.relation.RelationType

A RelationTypeSupport object implements the RelationType interface.

It represents a relation type, providing role information for each role expected to be supported in every relation of that type.

A relation type includes a relation type name and a list of role infos (represented by RoleInfo objects).

A relation type has to be declared in the Relation Service:

- either using the createRelationType() method, where a RelationTypeSupport object will be created and kept in the Relation Service

- either using the addRelationType() method where the user has to create an object implementing the RelationType interface, and this object will be used as representing a relation type in the Relation Service.

Since:
1.5
See Also:
Serialized Form

Constructor Summary
protected RelationTypeSupport sample code for javax.management.relation.RelationTypeSupport.RelationTypeSupport(java.lang.String) definition code for javax.management.relation.RelationTypeSupport.RelationTypeSupport(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  theRelTypeName)
          Constructor to be used for subclasses.
  RelationTypeSupport sample code for javax.management.relation.RelationTypeSupport.RelationTypeSupport(java.lang.String, javax.management.relation.RoleInfo[]) definition code for javax.management.relation.RelationTypeSupport.RelationTypeSupport(java.lang.String, javax.management.relation.RoleInfo[]) (String sample code for java.lang.String definition code for java.lang.String  theRelTypeName, RoleInfo sample code for javax.management.relation.RoleInfo definition code for javax.management.relation.RoleInfo [] theRoleInfoArray)
          Constructor where all role definitions are dynamically created and passed as parameter.
 
Method Summary
protected  void addRoleInfo sample code for javax.management.relation.RelationTypeSupport.addRoleInfo(javax.management.relation.RoleInfo) definition code for javax.management.relation.RelationTypeSupport.addRoleInfo(javax.management.relation.RoleInfo) (RoleInfo sample code for javax.management.relation.RoleInfo definition code for javax.management.relation.RoleInfo  theRoleInfo)
          Add a role info.
 String sample code for java.lang.String definition code for java.lang.String getRelationTypeName sample code for javax.management.relation.RelationTypeSupport.getRelationTypeName() definition code for javax.management.relation.RelationTypeSupport.getRelationTypeName() ()
          Returns the relation type name.
 RoleInfo sample code for javax.management.relation.RoleInfo definition code for javax.management.relation.RoleInfo getRoleInfo sample code for javax.management.relation.RelationTypeSupport.getRoleInfo(java.lang.String) definition code for javax.management.relation.RelationTypeSupport.getRoleInfo(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  theRoleInfoName)
          Returns the role info (RoleInfo object) for the given role info name (null if not found).
 List sample code for java.util.List definition code for java.util.List getRoleInfos sample code for javax.management.relation.RelationTypeSupport.getRoleInfos() definition code for javax.management.relation.RelationTypeSupport.getRoleInfos() ()
          Returns the list of role definitions (ArrayList of RoleInfo objects).
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

RelationTypeSupport sample code for javax.management.relation.RelationTypeSupport(java.lang.String, javax.management.relation.RoleInfo[]) definition code for javax.management.relation.RelationTypeSupport(java.lang.String, javax.management.relation.RoleInfo[])

public RelationTypeSupport(String sample code for java.lang.String definition code for java.lang.String  theRelTypeName,
                           RoleInfo sample code for javax.management.relation.RoleInfo definition code for javax.management.relation.RoleInfo [] theRoleInfoArray)
                    throws IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException ,
                           InvalidRelationTypeException sample code for javax.management.relation.InvalidRelationTypeException definition code for javax.management.relation.InvalidRelationTypeException 
Constructor where all role definitions are dynamically created and passed as parameter.

Parameters:
theRelTypeName - Name of relation type
theRoleInfoArray - List of role definitions (RoleInfo objects)
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if null parameter
InvalidRelationTypeException sample code for javax.management.relation.InvalidRelationTypeException definition code for javax.management.relation.InvalidRelationTypeException - if:

- the same name has been used for two different roles

- no role info provided

- one null role info provided


RelationTypeSupport sample code for javax.management.relation.RelationTypeSupport(java.lang.String) definition code for javax.management.relation.RelationTypeSupport(java.lang.String)

protected RelationTypeSupport(String sample code for java.lang.String definition code for java.lang.String  theRelTypeName)
Constructor to be used for subclasses.

Parameters:
theRelTypeName - Name of relation type.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if null parameter.
Method Detail

getRelationTypeName sample code for javax.management.relation.RelationTypeSupport.getRelationTypeName() definition code for javax.management.relation.RelationTypeSupport.getRelationTypeName()

public String sample code for java.lang.String definition code for java.lang.String  getRelationTypeName()
Returns the relation type name.

Specified by:
getRelationTypeName sample code for javax.management.relation.RelationType.getRelationTypeName() definition code for javax.management.relation.RelationType.getRelationTypeName() in interface RelationType sample code for javax.management.relation.RelationType definition code for javax.management.relation.RelationType
Returns:
the relation type name.

getRoleInfos sample code for javax.management.relation.RelationTypeSupport.getRoleInfos() definition code for javax.management.relation.RelationTypeSupport.getRoleInfos()

public List sample code for java.util.List definition code for java.util.List  getRoleInfos()
Returns the list of role definitions (ArrayList of RoleInfo objects).

Specified by:
getRoleInfos sample code for javax.management.relation.RelationType.getRoleInfos() definition code for javax.management.relation.RelationType.getRoleInfos() in interface RelationType sample code for javax.management.relation.RelationType definition code for javax.management.relation.RelationType
Returns:
an ArrayList sample code for java.util.ArrayList definition code for java.util.ArrayList of RoleInfo sample code for javax.management.relation.RoleInfo definition code for javax.management.relation.RoleInfo .

getRoleInfo sample code for javax.management.relation.RelationTypeSupport.getRoleInfo(java.lang.String) definition code for javax.management.relation.RelationTypeSupport.getRoleInfo(java.lang.String)

public RoleInfo sample code for javax.management.relation.RoleInfo definition code for javax.management.relation.RoleInfo  getRoleInfo(String sample code for java.lang.String definition code for java.lang.String  theRoleInfoName)
                     throws IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException ,
                            RoleInfoNotFoundException sample code for javax.management.relation.RoleInfoNotFoundException definition code for javax.management.relation.RoleInfoNotFoundException 
Returns the role info (RoleInfo object) for the given role info name (null if not found).

Specified by:
getRoleInfo sample code for javax.management.relation.RelationType.getRoleInfo(java.lang.String) definition code for javax.management.relation.RelationType.getRoleInfo(java.lang.String) in interface RelationType sample code for javax.management.relation.RelationType definition code for javax.management.relation.RelationType
Parameters:
theRoleInfoName - role info name
Returns:
RoleInfo object providing role definition does not exist
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if null parameter
RoleInfoNotFoundException sample code for javax.management.relation.RoleInfoNotFoundException definition code for javax.management.relation.RoleInfoNotFoundException - if no role info with that name in relation type.

addRoleInfo sample code for javax.management.relation.RelationTypeSupport.addRoleInfo(javax.management.relation.RoleInfo) definition code for javax.management.relation.RelationTypeSupport.addRoleInfo(javax.management.relation.RoleInfo)

protected void addRoleInfo(RoleInfo sample code for javax.management.relation.RoleInfo definition code for javax.management.relation.RoleInfo  theRoleInfo)
                    throws IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException ,
                           InvalidRelationTypeException sample code for javax.management.relation.InvalidRelationTypeException definition code for javax.management.relation.InvalidRelationTypeException 
Add a role info. This method of course should not be used after the creation of the relation type, because updating it would invalidate that the relations created associated to that type still conform to it. Can throw a RuntimeException if trying to update a relation type declared in the Relation Service.

Parameters:
theRoleInfo - role info to be added.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if null parameter.
InvalidRelationTypeException sample code for javax.management.relation.InvalidRelationTypeException definition code for javax.management.relation.InvalidRelationTypeException - if there is already a role info in current relation type with the same name.