|
|||||||||
| Home >> All >> javax >> management >> [ relation overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
javax.management.relation
Interface RelationServiceMBean

- All Known Implementing Classes:
- RelationService
- public interface RelationServiceMBean
This interface defines the management interface for a relation service.
The relation service performs the following functions:
Creating and deleting relation types and relations.
Making sure relations are consistent as defined by information
in their relation types/roles.
Allowing relations to be queried.
Revisions:
20020312 Adrian Brock:
- Fixed wrong exception types thrown
- Add missing method getRoles(String, String[])
- Version:
- $Revision: 1.5 $
| Method Summary | |
void |
addRelation(javax.management.ObjectName relation)
Add a manually created relation to the relation service. |
void |
addRelationType(RelationType 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 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 roleList)
Create a simple relation using RelationSupport for a relation type within the relation service. |
void |
createRelationType(java.lang.String relationTypeName,
RoleInfo[] roleInfos)
Create a relation type within the relation service. |
java.util.Map |
findAssociatedMBeans(javax.management.ObjectName 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(javax.management.ObjectName 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 |
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 |
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 |
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(javax.management.ObjectName objectName)
Checks whether the passed object name is a relation in this relation service. |
javax.management.ObjectName |
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 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 role)
Sets the role in the passed relation. |
RoleResult |
setRoles(java.lang.String relationId,
RoleList roles)
Sets the roles in the passed relation. |
void |
updateRoleMap(java.lang.String relationId,
Role newRole,
java.util.List oldRoleValue)
Handles the update of the relation service role map when a role is changed. |
| Method Detail |
addRelation
public void addRelation(javax.management.ObjectName relation) throws java.lang.IllegalArgumentException, java.lang.NoSuchMethodException, RelationServiceNotRegisteredException, InvalidRelationIdException, InvalidRelationServiceException, RelationTypeNotFoundException, InvalidRoleValueException, RoleNotFoundException, javax.management.InstanceNotFoundException
- Add a manually created relation to the relation service. It must
be registered with the same MBeanService as the relation service.
A RELATION_MBEAN_CREATION notification is sent.
addRelationType
public void addRelationType(RelationType relationType) throws java.lang.IllegalArgumentException, InvalidRelationTypeException
- Add a relation type to the relation service.
checkRoleReading
public java.lang.Integer checkRoleReading(java.lang.String roleName, java.lang.String relationTypeName) throws java.lang.IllegalArgumentException, RelationTypeNotFoundException
- Checks whether the passed role can be read in the given
relation type.
The return value is either zero when readable or a value from RoleStatus.
checkRoleWriting
public java.lang.Integer checkRoleWriting(Role role, java.lang.String relationTypeName, java.lang.Boolean initFlag) throws java.lang.IllegalArgumentException, RelationTypeNotFoundException
- Checks whether the passed role can be written in the given
relation type.
The return value is either zero when writable or a value from RoleStatus.
createRelation
public void createRelation(java.lang.String relationId, java.lang.String relationTypeName, RoleList roleList) throws java.lang.IllegalArgumentException, RelationServiceNotRegisteredException, InvalidRelationIdException, RelationTypeNotFoundException, InvalidRoleValueException, RoleNotFoundException
- Create a simple relation using RelationSupport for a relation
type within the relation service.
Roles not initialised are set to an empty ArrayList.
A RELATION_BASIC_CREATION notification is sent.
createRelationType
public void createRelationType(java.lang.String relationTypeName, RoleInfo[] roleInfos) throws java.lang.IllegalArgumentException, InvalidRelationTypeException
- Create a relation type within the relation service.
findAssociatedMBeans
public java.util.Map findAssociatedMBeans(javax.management.ObjectName mbeanName, java.lang.String relationTypeName, java.lang.String roleName) throws java.lang.IllegalArgumentException
- Retrieves MBeans associated with the passed MBean in the passed
relation type and role.
findReferencingRelations
public java.util.Map findReferencingRelations(javax.management.ObjectName mbeanName, java.lang.String relationTypeName, java.lang.String roleName) throws java.lang.IllegalArgumentException
- Retrieves MBeans referencing the passed MBean in the passed
relation type and role.
findRelationsOfType
public java.util.List findRelationsOfType(java.lang.String relationTypeName) throws java.lang.IllegalArgumentException, RelationTypeNotFoundException
- Retrieves the relation ids for relations of the passed type.
getAllRelationIds
public java.util.List getAllRelationIds()
- Retrieves all the relation ids.
getAllRelationTypeNames
public java.util.List getAllRelationTypeNames()
- Retrieves all the relation type names.
getAllRoles
public RoleResult getAllRoles(java.lang.String relationId) throws java.lang.IllegalArgumentException, RelationNotFoundException, RelationServiceNotRegisteredException
- Retrieves all the roles for a given relation id.
getPurgeFlag
public boolean getPurgeFlag()
- Retrieves the purge flag. This flag controls whether all relations
have to validated when notification is received of an MBeans
unregistration or whether the purgeRelations() method has to be
called.
getReferencedMBeans
public java.util.Map getReferencedMBeans(java.lang.String relationId) throws java.lang.IllegalArgumentException, RelationNotFoundException
- Retrieves all the MBeans referenced in all the roles of a
relation.
getRelationTypeName
public java.lang.String getRelationTypeName(java.lang.String relationId) throws java.lang.IllegalArgumentException, RelationNotFoundException
- Retrieves the relation type name for the passed relation.
getRole
public java.util.List getRole(java.lang.String relationId, java.lang.String roleName) throws java.lang.IllegalArgumentException, RelationNotFoundException, RelationServiceNotRegisteredException, RoleNotFoundException
- Retrieves MBeans in a role for a given relation id.
getRoleCardinality
public java.lang.Integer getRoleCardinality(java.lang.String relationId, java.lang.String roleName) throws java.lang.IllegalArgumentException, RelationNotFoundException, RoleNotFoundException
- Retrieves the number of MBeans in a role for a given relation id.
getRoleInfo
public RoleInfo getRoleInfo(java.lang.String relationTypeName, java.lang.String roleInfoName) throws java.lang.IllegalArgumentException, RelationTypeNotFoundException, RoleInfoNotFoundException
- Retrieves the role information for a given relation type.
getRoleInfos
public java.util.List getRoleInfos(java.lang.String relationTypeName) throws java.lang.IllegalArgumentException, RelationTypeNotFoundException
- Retrieves all the role information for a given relation type.
getRoles
public RoleResult getRoles(java.lang.String relationId, java.lang.String[] roleNames) throws java.lang.IllegalArgumentException, RelationNotFoundException, RelationServiceNotRegisteredException
- Retrieves selected roles for a relation.
hasRelation
public java.lang.Boolean hasRelation(java.lang.String relationId) throws java.lang.IllegalArgumentException
- Checks whether the relation service has the passed relation id.
isActive
public void isActive()
throws RelationServiceNotRegisteredException
- Checks whether the relation service is active, i.e. it is registered
with an MBeanServer.
isRelation
public java.lang.String isRelation(javax.management.ObjectName objectName) throws java.lang.IllegalArgumentException
- Checks whether the passed object name is a relation in this relation
service.
isRelationMBean
public javax.management.ObjectName isRelationMBean(java.lang.String relationId) throws java.lang.IllegalArgumentException, RelationNotFoundException
- Checks whether the passed relation id is an MBean created by a user
or has been internally created by the relation service.
purgeRelations
public void purgeRelations()
throws RelationServiceNotRegisteredException
- Purge relations. This method is called automatically when the purge
flag is true and an MBean in a relation is unregistered.
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.
removeRelation
public void removeRelation(java.lang.String relationId) throws java.lang.IllegalArgumentException, RelationNotFoundException, RelationServiceNotRegisteredException
- Removes a relation from the relation service.
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.
removeRelationType
public void removeRelationType(java.lang.String relationTypeName) throws java.lang.IllegalArgumentException, RelationTypeNotFoundException, RelationServiceNotRegisteredException
- Removes a relation type from the relation service.
Any relations using this relation type are also removed.
sendRelationCreationNotification
public void sendRelationCreationNotification(java.lang.String relationId) throws java.lang.IllegalArgumentException, RelationNotFoundException
- Sends a relation creation notification
For internally created relations, a RELATION_BASIC_CREATION
notification is sent.
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()
sendRelationRemovalNotification
public void sendRelationRemovalNotification(java.lang.String relationId, java.util.List unregMBeans) throws java.lang.IllegalArgumentException, RelationNotFoundException
- Sends a relation removal notification
For internally created relations, a RELATION_BASIC_REMOVAL
notification is sent.
For externally created relations, a RELATION_MBEAN_REMOVAL notification is sent.
The source is this relation service.
This method is called by removeRelation()
sendRoleUpdateNotification
public void sendRoleUpdateNotification(java.lang.String relationId, Role newRole, java.util.List oldRoleValue) throws java.lang.IllegalArgumentException, RelationNotFoundException
- Sends a relation update notification
For internally created relations, a RELATION_BASIC_UPDATE
notification is sent.
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.
setPurgeFlag
public void setPurgeFlag(boolean value)
- Sets the purge flag. This flag controls whether all relations
have to validated when notification is received of an MBeans
unregistration or whether the purgeRelations() method has to be
called.
setRole
public void setRole(java.lang.String relationId, Role role) throws java.lang.IllegalArgumentException, RelationServiceNotRegisteredException, RelationNotFoundException, RoleNotFoundException, InvalidRoleValueException, RelationTypeNotFoundException
- Sets the role in the passed relation.
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.
setRoles
public RoleResult setRoles(java.lang.String relationId, RoleList roles) throws java.lang.IllegalArgumentException, RelationServiceNotRegisteredException, RelationNotFoundException
- Sets the roles in the passed relation.
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.
updateRoleMap
public void updateRoleMap(java.lang.String relationId, Role newRole, java.util.List oldRoleValue) throws java.lang.IllegalArgumentException, RelationServiceNotRegisteredException, RelationNotFoundException
- Handles the update of the relation service role map when a role
is changed.
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.
|
|||||||||
| Home >> All >> javax >> management >> [ relation overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC