Package Summary  Overview Summary

class:RelationServiceMBean [NONE]

  • All Known Implementing Classes:
    RelationService

    public interface RelationServiceMBean
    
    The Relation Service is in charge of creating and deleting relation types and relations, of handling the consistency and of providing query mechanisms.
    Since:
    1.5

method:isActive() [NONE]

method:getPurgeFlag() [NONE]

  • getPurgeFlag

    boolean getPurgeFlag()
    Returns the flag to indicate if when a notification is received for the unregistration of an MBean referenced in a relation, if an immediate "purge" of the relations (look for the relations no longer valid) has to be performed, or if that will be performed only when the purgeRelations method is explicitly called.

    true is immediate purge.

    Returns:
    true if purges are immediate.
    See Also:
    setPurgeFlag(boolean)

method:setPurgeFlag(boolean) [NONE]

  • setPurgeFlag

    void setPurgeFlag​(boolean purgeFlag)
    Sets the flag to indicate if when a notification is received for the unregistration of an MBean referenced in a relation, if an immediate "purge" of the relations (look for the relations no longer valid) has to be performed, or if that will be performed only when the purgeRelations method is explicitly called.

    true is immediate purge.

    Parameters:
    purgeFlag - flag
    See Also:
    getPurgeFlag()

method:createRelationType(java.lang.String,javax.management.relation.RoleInfo[]) [NONE]

  • createRelationType

    void createRelationType​(String relationTypeName,
                            RoleInfo[] roleInfoArray)
                     throws IllegalArgumentException,
                            InvalidRelationTypeException
    
    Creates a relation type (RelationTypeSupport object) with given role infos (provided by the RoleInfo objects), and adds it in the Relation Service.
    Parameters:
    relationTypeName - name of the relation type
    roleInfoArray - array of role infos
    Throws:
    IllegalArgumentException - if null parameter
    InvalidRelationTypeException - If:

    - there is already a relation type with that name

    - the same name has been used for two different role infos

    - no role info provided

    - one null role info provided

method:addRelationType(javax.management.relation.RelationType) [NONE]

method:getAllRelationTypeNames() [NONE]

  • getAllRelationTypeNames

    List<String> getAllRelationTypeNames()
    Retrieves names of all known relation types.
    Returns:
    ArrayList of relation type names (Strings)

method:getRoleInfos(java.lang.String) [NONE]

method:getRoleInfo(java.lang.String,java.lang.String) [NONE]

method:removeRelationType(java.lang.String) [NONE]

method:createRelation(java.lang.String,java.lang.String,javax.management.relation.RoleList) [NONE]

method:addRelation(javax.management.ObjectName) [NONE]

method:isRelationMBean(java.lang.String) [NONE]

method:isRelation(javax.management.ObjectName) [NONE]

  • isRelation

    String isRelation​(ObjectName objectName)
               throws IllegalArgumentException
    
    Returns the relation id associated to the given ObjectName if the MBean has been added as a relation in the Relation Service.
    Parameters:
    objectName - ObjectName of supposed relation
    Returns:
    relation id (String) or null (if the ObjectName is not a relation handled by the Relation Service)
    Throws:
    IllegalArgumentException - if null parameter

method:hasRelation(java.lang.String) [NONE]

  • hasRelation

    Boolean hasRelation​(String relationId)
                 throws IllegalArgumentException
    
    Checks if there is a relation identified in Relation Service with given relation id.
    Parameters:
    relationId - relation id identifying the relation
    Returns:
    boolean: true if there is a relation, false else
    Throws:
    IllegalArgumentException - if null parameter

method:getAllRelationIds() [NONE]

  • getAllRelationIds

    List<String> getAllRelationIds()
    Returns all the relation ids for all the relations handled by the Relation Service.
    Returns:
    ArrayList of String

method:checkRoleReading(java.lang.String,java.lang.String) [NONE]

  • checkRoleReading

    Integer checkRoleReading​(String roleName,
                             String relationTypeName)
                      throws IllegalArgumentException,
                             RelationTypeNotFoundException
    
    Checks if given Role can be read in a relation of the given type.
    Parameters:
    roleName - name of role to be checked
    relationTypeName - name of the relation type
    Returns:
    an Integer wrapping an integer corresponding to possible problems represented as constants in RoleUnresolved:

    - 0 if role can be read

    - integer corresponding to RoleStatus.NO_ROLE_WITH_NAME

    - integer corresponding to RoleStatus.ROLE_NOT_READABLE

    Throws:
    IllegalArgumentException - if null parameter
    RelationTypeNotFoundException - if the relation type is not known in the Relation Service

method:checkRoleWriting(javax.management.relation.Role,java.lang.String,java.lang.Boolean) [NONE]

  • checkRoleWriting

    Integer checkRoleWriting​(Role role,
                             String relationTypeName,
                             Boolean initFlag)
                      throws IllegalArgumentException,
                             RelationTypeNotFoundException
    
    Checks if given Role can be set in a relation of given type.
    Parameters:
    role - role to be checked
    relationTypeName - name of relation type
    initFlag - flag to specify that the checking is done for the initialization of a role, write access shall not be verified.
    Returns:
    an Integer wrapping an integer corresponding to possible problems represented as constants in RoleUnresolved:

    - 0 if role can be set

    - integer corresponding to RoleStatus.NO_ROLE_WITH_NAME

    - integer for RoleStatus.ROLE_NOT_WRITABLE

    - integer for RoleStatus.LESS_THAN_MIN_ROLE_DEGREE

    - integer for RoleStatus.MORE_THAN_MAX_ROLE_DEGREE

    - integer for RoleStatus.REF_MBEAN_OF_INCORRECT_CLASS

    - integer for RoleStatus.REF_MBEAN_NOT_REGISTERED

    Throws:
    IllegalArgumentException - if null parameter
    RelationTypeNotFoundException - if unknown relation type

method:sendRelationCreationNotification(java.lang.String) [NONE]

  • sendRelationCreationNotification

    void sendRelationCreationNotification​(String relationId)
                                   throws IllegalArgumentException,
                                          RelationNotFoundException
    
    Sends a notification (RelationNotification) for a relation creation. The notification type is:

    - RelationNotification.RELATION_BASIC_CREATION if the relation is an object internal to the Relation Service

    - RelationNotification.RELATION_MBEAN_CREATION if the relation is a MBean added as a relation.

    The source object is the Relation Service itself.

    It is called in Relation Service createRelation() and addRelation() methods.

    Parameters:
    relationId - relation identifier of the updated relation
    Throws:
    IllegalArgumentException - if null parameter
    RelationNotFoundException - if there is no relation for given relation id

method:sendRoleUpdateNotification(java.lang.String,javax.management.relation.Role,java.util.List) [NONE]

  • sendRoleUpdateNotification

    void sendRoleUpdateNotification​(String relationId,
                                    Role newRole,
                                    List<ObjectName> oldRoleValue)
                             throws IllegalArgumentException,
                                    RelationNotFoundException
    
    Sends a notification (RelationNotification) for a role update in the given relation. The notification type is:

    - RelationNotification.RELATION_BASIC_UPDATE if the relation is an object internal to the Relation Service

    - RelationNotification.RELATION_MBEAN_UPDATE if the relation is a MBean added as a relation.

    The source object is the Relation Service itself.

    It is called in relation MBean setRole() (for given role) and setRoles() (for each role) methods (implementation provided in RelationSupport class).

    It is also called in Relation Service setRole() (for given role) and setRoles() (for each role) methods.

    Parameters:
    relationId - relation identifier of the updated relation
    newRole - new role (name and new value)
    oldRoleValue - old role value (List of ObjectName objects)
    Throws:
    IllegalArgumentException - if null parameter
    RelationNotFoundException - if there is no relation for given relation id

method:sendRelationRemovalNotification(java.lang.String,java.util.List) [NONE]

  • sendRelationRemovalNotification

    void sendRelationRemovalNotification​(String relationId,
                                         List<ObjectName> unregMBeanList)
                                  throws IllegalArgumentException,
                                         RelationNotFoundException
    
    Sends a notification (RelationNotification) for a relation removal. The notification type is:

    - RelationNotification.RELATION_BASIC_REMOVAL if the relation is an object internal to the Relation Service

    - RelationNotification.RELATION_MBEAN_REMOVAL if the relation is a MBean added as a relation.

    The source object is the Relation Service itself.

    It is called in Relation Service removeRelation() method.

    Parameters:
    relationId - relation identifier of the updated relation
    unregMBeanList - List of ObjectNames of MBeans expected to be unregistered due to relation removal (can be null)
    Throws:
    IllegalArgumentException - if null parameter
    RelationNotFoundException - if there is no relation for given relation id

method:updateRoleMap(java.lang.String,javax.management.relation.Role,java.util.List) [NONE]

  • updateRoleMap

    void updateRoleMap​(String relationId,
                       Role newRole,
                       List<ObjectName> oldRoleValue)
                throws IllegalArgumentException,
                       RelationServiceNotRegisteredException,
                       RelationNotFoundException
    
    Handles update of the Relation Service role map for the update of given role in given relation.

    It is called in relation MBean setRole() (for given role) and setRoles() (for each role) methods (implementation provided in RelationSupport class).

    It is also called in Relation Service setRole() (for given role) and setRoles() (for each role) methods.

    To allow the Relation Service to maintain the consistency (in case of MBean unregistration) and to be able to perform queries, this method must be called when a role is updated.

    Parameters:
    relationId - relation identifier of the updated relation
    newRole - new role (name and new value)
    oldRoleValue - old role value (List of ObjectName objects)
    Throws:
    IllegalArgumentException - if null parameter
    RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server
    RelationNotFoundException - if no relation for given id.

method:removeRelation(java.lang.String) [NONE]

method:purgeRelations() [NONE]

  • purgeRelations

    void purgeRelations()
                 throws RelationServiceNotRegisteredException
    
    Purges the relations.

    Depending on the purgeFlag value, this method is either called automatically when a notification is received for the unregistration of an MBean referenced in a relation (if the flag is set to true), or not (if the flag is set to false).

    In that case it is up to the user to call it to maintain the consistency of the relations. To be kept in mind that if an MBean is unregistered and the purge not done immediately, if the ObjectName is reused and assigned to another MBean referenced in a relation, calling manually this purgeRelations() method will cause trouble, as will consider the ObjectName as corresponding to the unregistered MBean, not seeing the new one.

    The behavior depends on the cardinality of the role where the unregistered MBean is referenced:

    - if removing one MBean reference in the role makes its number of references less than the minimum degree, the relation has to be removed.

    - if the remaining number of references after removing the MBean reference is still in the cardinality range, keep the relation and update it calling its handleMBeanUnregistration() callback.

    Throws:
    RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server.

method:findReferencingRelations(javax.management.ObjectName,java.lang.String,java.lang.String) [NONE]

  • findReferencingRelations

    Map<String,List<String>> findReferencingRelations​(ObjectName mbeanName,
                                                      String relationTypeName,
                                                      String roleName)
                                               throws IllegalArgumentException
    
    Retrieves the relations where a given MBean is referenced.

    This corresponds to the CIM "References" and "ReferenceNames" operations.

    Parameters:
    mbeanName - ObjectName of MBean
    relationTypeName - can be null; if specified, only the relations of that type will be considered in the search. Else all relation types are considered.
    roleName - can be null; if specified, only the relations where the MBean is referenced in that role will be returned. Else all roles are considered.
    Returns:
    an HashMap, where the keys are the relation ids of the relations where the MBean is referenced, and the value is, for each key, an ArrayList of role names (as an MBean can be referenced in several roles in the same relation).
    Throws:
    IllegalArgumentException - if null parameter

method:findAssociatedMBeans(javax.management.ObjectName,java.lang.String,java.lang.String) [NONE]

  • findAssociatedMBeans

    Map<ObjectName,List<String>> findAssociatedMBeans​(ObjectName mbeanName,
                                                      String relationTypeName,
                                                      String roleName)
                                               throws IllegalArgumentException
    
    Retrieves the MBeans associated to given one in a relation.

    This corresponds to CIM Associators and AssociatorNames operations.

    Parameters:
    mbeanName - ObjectName of MBean
    relationTypeName - can be null; if specified, only the relations of that type will be considered in the search. Else all relation types are considered.
    roleName - can be null; if specified, only the relations where the MBean is referenced in that role will be considered. Else all roles are considered.
    Returns:
    an HashMap, where the keys are the ObjectNames of the MBeans associated to given MBean, and the value is, for each key, an ArrayList of the relation ids of the relations where the key MBean is associated to given one (as they can be associated in several different relations).
    Throws:
    IllegalArgumentException - if null parameter

method:findRelationsOfType(java.lang.String) [NONE]

method:getRole(java.lang.String,java.lang.String) [NONE]

method:getRoles(java.lang.String,java.lang.String[]) [NONE]

method:getAllRoles(java.lang.String) [NONE]

method:getRoleCardinality(java.lang.String,java.lang.String) [NONE]

method:setRole(java.lang.String,javax.management.relation.Role) [NONE]

method:setRoles(java.lang.String,javax.management.relation.RoleList) [NONE]

method:getReferencedMBeans(java.lang.String) [NONE]

method:getRelationTypeName(java.lang.String) [NONE]

© 2019 Oracle Corporation and/or its affiliates