|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines the management interface for a relation service.
The relation service performs the following functions:
Revisions:
20020312 Adrian Brock:
Method Summary | |
void |
addRelation(ObjectName (src) relation)
Add a manually created relation to the relation service. |
void |
addRelationType(RelationType (src) relationType)
Add a relation type to the relation service. |
java.lang.Integer |
checkRoleReading(java.lang.String roleName,
java.lang.String relationTypeName)
Checks whether the passed role can be read in the given relation type. |
java.lang.Integer |
checkRoleWriting(Role (src) role,
java.lang.String relationTypeName,
java.lang.Boolean initFlag)
Checks whether the passed role can be written in the given relation type. |
void |
createRelation(java.lang.String relationId,
java.lang.String relationTypeName,
RoleList (src) roleList)
Create a simple relation using RelationSupport (src) for a relation
type within the relation service. |
void |
createRelationType(java.lang.String relationTypeName,
RoleInfo (src) [] roleInfos)
Create a relation type within the relation service. |
java.util.Map |
findAssociatedMBeans(ObjectName (src) mbeanName,
java.lang.String relationTypeName,
java.lang.String roleName)
Retrieves MBeans associated with the passed MBean in the passed relation type and role. |
java.util.Map |
findReferencingRelations(ObjectName (src) mbeanName,
java.lang.String relationTypeName,
java.lang.String roleName)
Retrieves MBeans referencing the passed MBean in the passed relation type and role. |
java.util.List |
findRelationsOfType(java.lang.String relationTypeName)
Retrieves the relation ids for relations of the passed type. |
java.util.List |
getAllRelationIds()
Retrieves all the relation ids. |
java.util.List |
getAllRelationTypeNames()
Retrieves all the relation type names. |
RoleResult (src) |
getAllRoles(java.lang.String relationId)
Retrieves all the roles for a given relation id. |
boolean |
getPurgeFlag()
Retrieves the purge flag. |
java.util.Map |
getReferencedMBeans(java.lang.String relationId)
Retrieves all the MBeans referenced in all the roles of a relation. |
java.lang.String |
getRelationTypeName(java.lang.String relationId)
Retrieves the relation type name for the passed relation. |
java.util.List |
getRole(java.lang.String relationId,
java.lang.String roleName)
Retrieves MBeans in a role for a given relation id. |
java.lang.Integer |
getRoleCardinality(java.lang.String relationId,
java.lang.String roleName)
Retrieves the number of MBeans in a role for a given relation id. |
RoleInfo (src) |
getRoleInfo(java.lang.String relationTypeName,
java.lang.String roleInfoName)
Retrieves the role information for a given relation type. |
java.util.List |
getRoleInfos(java.lang.String relationTypeName)
Retrieves all the role information for a given relation type. |
RoleResult (src) |
getRoles(java.lang.String relationId,
java.lang.String[] roleNames)
Retrieves selected roles for a relation. |
java.lang.Boolean |
hasRelation(java.lang.String relationId)
Checks whether the relation service has the passed relation id. |
void |
isActive()
Checks whether the relation service is active, i.e. |
java.lang.String |
isRelation(ObjectName (src) objectName)
Checks whether the passed object name is a relation in this relation service. |
ObjectName (src) |
isRelationMBean(java.lang.String relationId)
Checks whether the passed relation id is an MBean created by a user or has been internally created by the relation service. |
void |
purgeRelations()
Purge relations. |
void |
removeRelation(java.lang.String relationId)
Removes a relation from the relation service. |
void |
removeRelationType(java.lang.String relationTypeName)
Removes a relation type from the relation service. |
void |
sendRelationCreationNotification(java.lang.String relationId)
Sends a relation creation notification For internally created relations, a RELATION_BASIC_CREATION notification is sent. |
void |
sendRelationRemovalNotification(java.lang.String relationId,
java.util.List unregMBeans)
Sends a relation removal notification For internally created relations, a RELATION_BASIC_REMOVAL notification is sent. |
void |
sendRoleUpdateNotification(java.lang.String relationId,
Role (src) newRole,
java.util.List oldRoleValue)
Sends a relation update notification For internally created relations, a RELATION_BASIC_UPDATE notification is sent. |
void |
setPurgeFlag(boolean value)
Sets the purge flag. |
void |
setRole(java.lang.String relationId,
Role (src) role)
Sets the role in the passed relation. |
RoleResult (src) |
setRoles(java.lang.String relationId,
RoleList (src) roles)
Sets the roles in the passed relation. |
void |
updateRoleMap(java.lang.String relationId,
Role (src) newRole,
java.util.List oldRoleValue)
Handles the update of the relation service role map when a role is changed. |
Method Detail |
public void isActive() throws RelationServiceNotRegisteredException (src)
RelationServiceNotRegisteredException (src)
- when the relation
service is not registered with an MBeanServer.public boolean getPurgeFlag()
public void setPurgeFlag(boolean value)
value
- true for an immediate purge on unregistration, false
otherwise.public void createRelationType(java.lang.String relationTypeName, RoleInfo (src) [] roleInfos) throws java.lang.IllegalArgumentException, InvalidRelationTypeException (src)
relationTypeName
- the relation type name.roleInfos
- an array of role infos.
java.lang.IllegalArgumentException
- for a null relation type.
InvalidRelationTypeException (src)
- if a relation type already
exists in the relation service with the given name, there
are problems with the role infos.public void addRelationType(RelationType (src) relationType) throws java.lang.IllegalArgumentException, InvalidRelationTypeException (src)
relationType
- the relation type.
java.lang.IllegalArgumentException
- for a null relation type.
InvalidRelationTypeException (src)
- if a relation type already
exists in the relation service with the given name.public java.util.List getAllRelationTypeNames()
public java.util.List getRoleInfos(java.lang.String relationTypeName) throws java.lang.IllegalArgumentException, RelationTypeNotFoundException (src)
relationTypeName
- the relation type name
java.lang.IllegalArgumentException
- for a null parameter.
RelationTypeNotFoundException (src)
- when the relation id does not
exist.public RoleInfo (src) getRoleInfo(java.lang.String relationTypeName, java.lang.String roleInfoName) throws java.lang.IllegalArgumentException, RelationTypeNotFoundException (src) , RoleInfoNotFoundException (src)
relationTypeName
- the relation type nameroleInfoName
- the role information name
java.lang.IllegalArgumentException
- for a null parameter.
RelationTypeNotFoundException (src)
- when the relation type does not
exist.
RoleInfoNotFoundException (src)
- when the role information does not
exist for the relation type.public void removeRelationType(java.lang.String relationTypeName) throws RelationServiceNotRegisteredException (src) , java.lang.IllegalArgumentException, RelationTypeNotFoundException (src)
Any relations using this relation type are also removed.
relationTypeName
- the relation type name
java.lang.IllegalArgumentException
- for a null parameter.
RelationTypeNotFoundException (src)
- when the relation type does not
exist.
RelationServiceNotRegisteredException (src)
- when the relation
service is not registered with an MBeanServer.public void createRelation(java.lang.String relationId, java.lang.String relationTypeName, RoleList (src) roleList) throws RelationServiceNotRegisteredException (src) , java.lang.IllegalArgumentException, RoleNotFoundException (src) , InvalidRelationIdException (src) , RelationTypeNotFoundException (src) , InvalidRoleValueException (src)
RelationSupport
(src) for a relation
type within the relation service.Roles not initialised are set to an empty ArrayList.
A RELATION_BASIC_CREATION notification is sent.
relationId
- the relation id of the relationrelationTypeName
- the relation type of the relationroleList
- the roles to initialise in the relation (can be null)
java.lang.IllegalArgumentException
- for a null parameter.
RelationServiceNotRegisteredException (src)
- when the relation
service is not registered with the MBeanServer.
InvalidRelationIdException (src)
- if the relation id
is already used by another relation.
RelationTypeNotFoundException (src)
- if there is no relation type in
the relation or the relation type has not been registered
with the relation service.
InvalidRoleValueException (src)
- if the number of MBeans in a
role is outside the bounds of the RoleInfo defined in the
relation type, one of the MBeans is not of the correct
class, an MBean does not exist, the same role name is
used in two different relations.
RoleNotFoundException (src)
- if a role in the relation is not
in the relation type.public void addRelation(ObjectName (src) relation) throws java.lang.IllegalArgumentException, RelationServiceNotRegisteredException (src) , java.lang.NoSuchMethodException, InvalidRelationIdException (src) , InstanceNotFoundException (src) , InvalidRelationServiceException (src) , RelationTypeNotFoundException (src) , RoleNotFoundException (src) , InvalidRoleValueException (src)
relation
- the object name of the relation
java.lang.IllegalArgumentException
- for a null object name.
java.lang.NoSuchMethodException
- if the mbean does not implement the
Relation interface.
RelationServiceNotRegisteredException (src)
- when the relation
service is not registered with the MBeanServer.
InstanceNotFoundException (src)
- when the relation is not
registered in the MBeanServer.
InvalidRelationIdException (src)
- if the relation id
is already used by another relation.
InvalidRelationServiceException (src)
- if the relation service in
the relation is null or is not the relation service to which
it is being added.
RelationTypeNotFoundException (src)
- if there is no relation type in
the relation or the relation type has not been registered
with the relation service.
InvalidRoleValueException (src)
- if the number of MBeans in a
role is outside the bounds of the RoleInfo defined in the
relation type, one of the MBeans is not of the correct
class or an MBean does not exist.
RoleNotFoundException (src)
- if a role in the relation is not
in the relation type.public ObjectName (src) isRelationMBean(java.lang.String relationId) throws java.lang.IllegalArgumentException, RelationNotFoundException (src)
relationId
- the relation id to check
java.lang.IllegalArgumentException
- for a null object name.
RelationNotFoundException (src)
- when the relation id does not
exist.public java.lang.String isRelation(ObjectName (src) objectName) throws java.lang.IllegalArgumentException
objectName
- the name of the MBean to check
java.lang.IllegalArgumentException
- for a null object name.public java.lang.Boolean hasRelation(java.lang.String relationId) throws java.lang.IllegalArgumentException
relationId
- the relation id
java.lang.IllegalArgumentException
- for a null parameter.public java.util.List getAllRelationIds()
public java.lang.Integer checkRoleReading(java.lang.String roleName, java.lang.String relationTypeName) throws java.lang.IllegalArgumentException, RelationTypeNotFoundException (src)
The return value is either zero when readable or a value from
RoleStatus
(src) .
roleName
- the name of the role to check.relationTypeName
- the relation type to check.
java.lang.IllegalArgumentException
- for a null parameters.
RelationTypeNotFoundException (src)
- if the relation type does
exist in the relation service.public java.lang.Integer checkRoleWriting(Role (src) role, java.lang.String relationTypeName, java.lang.Boolean initFlag) throws java.lang.IllegalArgumentException, RelationTypeNotFoundException (src)
The return value is either zero when writable or a value from
RoleStatus
(src) .
role
- the role to check.relationTypeName
- the relation type to check.initFlag
- write access is not check when this flag is true.
java.lang.IllegalArgumentException
- for a null parameters.
RelationTypeNotFoundException (src)
- if the relation type does
exist in the relation service.public void sendRelationCreationNotification(java.lang.String relationId) throws java.lang.IllegalArgumentException, RelationNotFoundException (src)
For externally created relations, a RELATION_MBEAN_CREATION notification is sent.
The source is this relation service.
This method is called by addRelation() and createRelation()
relationId
- the relation id
java.lang.IllegalArgumentException
- for a null parameter.
RelationNotFoundException (src)
- when the relation id does not
exist.public void sendRoleUpdateNotification(java.lang.String relationId, Role (src) newRole, java.util.List oldRoleValue) throws java.lang.IllegalArgumentException, RelationNotFoundException (src)
For externally created relations, a RELATION_MBEAN_UPDATE notification is sent.
The source is this relation service.
This method is called from the RelationSupport setRole() and setRoles() methods.
relationId
- the relation idnewRole
- the new roleoldRoleValue
- a list of MBeans in the old role
java.lang.IllegalArgumentException
- for a null parameter.
RelationNotFoundException (src)
- when the relation id does not
exist.public void sendRelationRemovalNotification(java.lang.String relationId, java.util.List unregMBeans) throws java.lang.IllegalArgumentException, RelationNotFoundException (src)
For externally created relations, a RELATION_MBEAN_REMOVAL notification is sent.
The source is this relation service.
This method is called by removeRelation()
relationId
- the relation idunregMBeans
- a list of MBeans to be unregistered due to this
removal (can be null)
java.lang.IllegalArgumentException
- for a null parameter.
RelationNotFoundException (src)
- when the relation id does not
exist.public void updateRoleMap(java.lang.String relationId, Role (src) newRole, java.util.List oldRoleValue) throws java.lang.IllegalArgumentException, RelationServiceNotRegisteredException (src) , RelationNotFoundException (src)
It is called from RelationSupport setRole() and setRoles() and the relation service's setRole() and setRoles() methods.
The relation service will keep track the MBeans unregistration to maintain the consistency of the relation.
relationId
- the relation idnewRole
- the new roleoldRoleValue
- a list of MBeans in the old role
java.lang.IllegalArgumentException
- for a null parameter.
RelationNotFoundException (src)
- when the relation id does not
exist.
RelationServiceNotRegisteredException (src)
- when the relation
service has not been registered with an MBeanServerpublic void removeRelation(java.lang.String relationId) throws RelationServiceNotRegisteredException (src) , java.lang.IllegalArgumentException, RelationNotFoundException (src)
For internally created relations, a RELATION_BASIC_REMOVAL notification is sent.
For externally created relations, a RELATION_MBEAN_REMOVAL notification is sent.
The MBeans referenced in the relation are unaffected.
relationId
- the relation id
java.lang.IllegalArgumentException
- for a null parameter.
RelationNotFoundException (src)
- when the relation id does not
exist.
RelationServiceNotRegisteredException (src)
- when the relation
service is not registered with an MBeanServer.public void purgeRelations() throws RelationServiceNotRegisteredException (src)
Not purging relations automatically can lead to problems when the same object name is reused.
If the unregistration causes a role to go below its minimal cardinality, the relation is removed. Otherwise the relation's handleMBeanUnregistration() is called.
RelationServiceNotRegisteredException (src)
- when the relation
service is not registered with an MBeanServer.public java.util.Map findReferencingRelations(ObjectName (src) mbeanName, java.lang.String relationTypeName, java.lang.String roleName) throws java.lang.IllegalArgumentException
mbeanName
- the name of the referenced MBeanrelationTypeName
- the relation type, null means check all
relation types.roleName
- the role, null means check all roles.
java.lang.IllegalArgumentException
- for a null object name.public java.util.Map findAssociatedMBeans(ObjectName (src) mbeanName, java.lang.String relationTypeName, java.lang.String roleName) throws java.lang.IllegalArgumentException
mbeanName
- the name of the reference MBeanrelationTypeName
- the relation type, null means check all
relation types.roleName
- the role, null means check all roles.
java.lang.IllegalArgumentException
- for a null object name.public java.util.List findRelationsOfType(java.lang.String relationTypeName) throws java.lang.IllegalArgumentException, RelationTypeNotFoundException (src)
relationTypeName
- the relation type.
java.lang.IllegalArgumentException
- for a null relation type name.
RelationTypeNotFoundException (src)
- if there is no relation type
with the passed name.public java.util.List getRole(java.lang.String relationId, java.lang.String roleName) throws RelationServiceNotRegisteredException (src) , java.lang.IllegalArgumentException, RelationNotFoundException (src) , RoleNotFoundException (src)
relationId
- the relation idroleName
- the role name
java.lang.IllegalArgumentException
- for a null parameter.
RelationNotFoundException (src)
- when the relation id does not
exist.
RelationServiceNotRegisteredException (src)
- when the relation
service is not registered with an MBeanServer.
RoleNotFoundException (src)
- when the role does not exist or
is not readable.public RoleResult (src) getRoles(java.lang.String relationId, java.lang.String[] roleNames) throws RelationServiceNotRegisteredException (src) , java.lang.IllegalArgumentException, RelationNotFoundException (src)
relationId
- the relation idroleNames
- an array of role name
java.lang.IllegalArgumentException
- for a null parameter.
RelationNotFoundException (src)
- when the relation id does not
exist.
RelationServiceNotRegisteredException (src)
- when the relation
service is not registered with an MBeanServer.public RoleResult (src) getAllRoles(java.lang.String relationId) throws java.lang.IllegalArgumentException, RelationNotFoundException (src) , RelationServiceNotRegisteredException (src)
relationId
- the relation id
java.lang.IllegalArgumentException
- for a null relation id.
RelationNotFoundException (src)
- when the relation id does not
exist.
RelationServiceNotRegisteredException (src)
- when the relation
service is not registered with an MBeanServer.public java.lang.Integer getRoleCardinality(java.lang.String relationId, java.lang.String roleName) throws java.lang.IllegalArgumentException, RelationNotFoundException (src) , RoleNotFoundException (src)
relationId
- the relation idroleName
- the role name
java.lang.IllegalArgumentException
- for a null parameter.
RelationNotFoundException (src)
- when the relation id does not
exist.
RoleNotFoundException (src)
- when the role does not exist or
is not readable.public void setRole(java.lang.String relationId, Role (src) role) throws RelationServiceNotRegisteredException (src) , java.lang.IllegalArgumentException, RelationNotFoundException (src) , RoleNotFoundException (src) , InvalidRoleValueException (src) , RelationTypeNotFoundException (src)
The role will be validated according to information in the relation type.
The relation service will keep track the MBeans unregistration to maintain the consistency of the relation.
relationId
- the relation to change the role for.role
- the new role
java.lang.IllegalArgumentException
- for null parameters
RelationServiceNotRegisteredException (src)
- when the relation service
has not been registered with an MBeanServer
RelationNotFoundException (src)
- when the relation does not exist in
the relation service.
RoleNotFoundException (src)
- when this is an internal relation or
the role does not exist or it is not writable.
InvalidRoleValueException (src)
- when the role is not valid according
to information in the relation type.
RelationTypeNotFoundException (src)
- if the relation type is not known.public RoleResult (src) setRoles(java.lang.String relationId, RoleList (src) roles) throws RelationServiceNotRegisteredException (src) , java.lang.IllegalArgumentException, RelationNotFoundException (src)
The roles will be validated according to information in the relation type.
The relation service will keep track the MBeans unregistration to maintain the consistency of the relation.
relationId
- the relation to change the role for.roles
- the list of roles
java.lang.IllegalArgumentException
- for null parameters
RelationServiceNotRegisteredException (src)
- when the relation service
has not been registered with an MBeanServer
RelationNotFoundException (src)
- when the relation does not exist in
the relation service.public java.util.Map getReferencedMBeans(java.lang.String relationId) throws java.lang.IllegalArgumentException, RelationNotFoundException (src)
relationId
- the relation id
java.lang.IllegalArgumentException
- for a null relation id.
RelationNotFoundException (src)
- when the relation id does not
exist.public java.lang.String getRelationTypeName(java.lang.String relationId) throws java.lang.IllegalArgumentException, RelationNotFoundException (src)
relationId
- the relation id
java.lang.IllegalArgumentException
- for a null relation id.
RelationNotFoundException (src)
- when the relation id does not
exist.
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |