jdk/src/share/classes/javax/management/relation/RelationServiceMBean.java
author rriggs
Tue, 12 Nov 2013 14:03:28 -0500
changeset 21656 d4c777ccb1db
parent 21278 ef8a3a2a72f2
child 23010 6dadb192ad81
permissions -rw-r--r--
8028014: Doclint warning/error cleanup in javax.management Summary: Improve generated html by fixing doclint warnings Reviewed-by: sla, jbachorik
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.management.relation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import javax.management.ObjectName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.management.InstanceNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.util.List;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * The Relation Service is in charge of creating and deleting relation types
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * and relations, of handling the consistency and of providing query
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * mechanisms.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
public interface RelationServiceMBean {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
     * Checks if the Relation Service is active.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
     * Current condition is that the Relation Service must be registered in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
     * MBean Server
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
     * @exception RelationServiceNotRegisteredException  if it is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
     * registered
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    public void isActive()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        throws RelationServiceNotRegisteredException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    // Accessors
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * Returns the flag to indicate if when a notification is received for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * unregistration of an MBean referenced in a relation, if an immediate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * "purge" of the relations (look for the relations no longer valid)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * has to be performed, or if that will be performed only when the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * purgeRelations method is explicitly called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * <P>true is immediate purge.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * @return true if purges are immediate.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * @see #setPurgeFlag
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    public boolean getPurgeFlag();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * Sets the flag to indicate if when a notification is received for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * unregistration of an MBean referenced in a relation, if an immediate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * "purge" of the relations (look for the relations no longer valid)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * has to be performed, or if that will be performed only when the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * purgeRelations method is explicitly called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * <P>true is immediate purge.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * @param purgeFlag  flag
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * @see #getPurgeFlag
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    public void setPurgeFlag(boolean purgeFlag);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    // Relation type handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * Creates a relation type (RelationTypeSupport object) with given
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * role infos (provided by the RoleInfo objects), and adds it in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * Relation Service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * @param relationTypeName  name of the relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * @param roleInfoArray  array of role infos
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * @exception InvalidRelationTypeException  If:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * <P>- there is already a relation type with that name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * <P>- the same name has been used for two different role infos
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * <P>- no role info provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * <P>- one null role info provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    public void createRelationType(String relationTypeName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                                   RoleInfo[] roleInfoArray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
               InvalidRelationTypeException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * Adds given object as a relation type. The object is expected to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * implement the RelationType interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * @param relationTypeObj  relation type object (implementing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * RelationType interface)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * @exception IllegalArgumentException  if null parameter or if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * {@link RelationType#getRelationTypeName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * relationTypeObj.getRelationTypeName()} returns null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * @exception InvalidRelationTypeException  if there is already a relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * type with that name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    public void addRelationType(RelationType relationTypeObj)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
               InvalidRelationTypeException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * Retrieves names of all known relation types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * @return ArrayList of relation type names (Strings)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    public List<String> getAllRelationTypeNames();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * Retrieves list of role infos (RoleInfo objects) of a given relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * @param relationTypeName  name of relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * @return ArrayList of RoleInfo.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * @exception RelationTypeNotFoundException  if there is no relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * with that name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    public List<RoleInfo> getRoleInfos(String relationTypeName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
               RelationTypeNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * Retrieves role info for given role of a given relation type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * @param relationTypeName  name of relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * @param roleInfoName  name of role
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * @return RoleInfo object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * @exception RelationTypeNotFoundException  if the relation type is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * known in the Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * @exception RoleInfoNotFoundException  if the role is not part of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * relation type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    public RoleInfo getRoleInfo(String relationTypeName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                                String roleInfoName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
               RelationTypeNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
               RoleInfoNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * Removes given relation type from Relation Service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * <P>The relation objects of that type will be removed from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * Relation Service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * @param relationTypeName  name of the relation type to be removed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * @exception RelationServiceNotRegisteredException  if the Relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * Service is not registered in the MBean Server
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * @exception RelationTypeNotFoundException  If there is no relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * with that name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    public void removeRelationType(String relationTypeName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        throws RelationServiceNotRegisteredException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
               IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
               RelationTypeNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    // Relation handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * Creates a simple relation (represented by a RelationSupport object) of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * given relation type, and adds it in the Relation Service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * <P>Roles are initialized according to the role list provided in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * parameter. The ones not initialized in this way are set to an empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * ArrayList of ObjectNames.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * <P>A RelationNotification, with type RELATION_BASIC_CREATION, is sent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * @param relationId  relation identifier, to identify uniquely the relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * inside the Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * @param relationTypeName  name of the relation type (has to be created
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * in the Relation Service)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * @param roleList  role list to initialize roles of the relation (can
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * be null).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * @exception RelationServiceNotRegisteredException  if the Relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * Service is not registered in the MBean Server
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * @exception RoleNotFoundException  if a value is provided for a role
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * that does not exist in the relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * @exception InvalidRelationIdException  if relation id already used
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * @exception RelationTypeNotFoundException  if relation type not known in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * @exception InvalidRoleValueException if:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * <P>- the same role name is used for two different roles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * <P>- the number of referenced MBeans in given value is less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * expected minimum degree
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * <P>- the number of referenced MBeans in provided value exceeds expected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * maximum degree
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * <P>- one referenced MBean in the value is not an Object of the MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * class expected for that role
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * <P>- an MBean provided for that role does not exist
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    public void createRelation(String relationId,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                               String relationTypeName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                               RoleList roleList)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
        throws RelationServiceNotRegisteredException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
               IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
               RoleNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
               InvalidRelationIdException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
               RelationTypeNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
               InvalidRoleValueException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * Adds an MBean created by the user (and registered by him in the MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * Server) as a relation in the Relation Service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * <P>To be added as a relation, the MBean must conform to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * <P>- implement the Relation interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * <P>- have for RelationService ObjectName the ObjectName of current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * <P>- have a relation id that is unique and unused in current Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * <P>- have for relation type a relation type created in the Relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     * Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * <P>- have roles conforming to the role info provided in the relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * @param relationObjectName  ObjectName of the relation MBean to be added.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * @exception RelationServiceNotRegisteredException  if the Relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * Service is not registered in the MBean Server
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * @exception NoSuchMethodException  If the MBean does not implement the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * Relation interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * @exception InvalidRelationIdException  if:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * <P>- no relation identifier in MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * <P>- the relation identifier is already used in the Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * @exception InstanceNotFoundException  if the MBean for given ObjectName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * has not been registered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * @exception InvalidRelationServiceException  if:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * <P>- no Relation Service name in MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * <P>- the Relation Service name in the MBean is not the one of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * current Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * @exception RelationTypeNotFoundException  if:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * <P>- no relation type name in MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * <P>- the relation type name in MBean does not correspond to a relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * type created in the Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * @exception InvalidRoleValueException  if:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * <P>- the number of referenced MBeans in a role is less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * expected minimum degree
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * <P>- the number of referenced MBeans in a role exceeds expected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * maximum degree
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     * <P>- one referenced MBean in the value is not an Object of the MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * class expected for that role
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * <P>- an MBean provided for a role does not exist
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     * @exception RoleNotFoundException  if a value is provided for a role
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * that does not exist in the relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    public void addRelation(ObjectName relationObjectName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
               RelationServiceNotRegisteredException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
               NoSuchMethodException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
               InvalidRelationIdException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
               InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
               InvalidRelationServiceException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
               RelationTypeNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
               RoleNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
               InvalidRoleValueException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * If the relation is represented by an MBean (created by the user and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * added as a relation in the Relation Service), returns the ObjectName of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * @param relationId  relation id identifying the relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * @return ObjectName of the corresponding relation MBean, or null if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * the relation is not an MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * @exception RelationNotFoundException there is no relation associated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * to that id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    public ObjectName isRelationMBean(String relationId)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
               RelationNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * Returns the relation id associated to the given ObjectName if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * MBean has been added as a relation in the Relation Service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * @param objectName  ObjectName of supposed relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * @return relation id (String) or null (if the ObjectName is not a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * relation handled by the Relation Service)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
    public String isRelation(ObjectName objectName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
        throws IllegalArgumentException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * Checks if there is a relation identified in Relation Service with given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * relation id.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * @param relationId  relation id identifying the relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * @return boolean: true if there is a relation, false else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
    public Boolean hasRelation(String relationId)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
        throws IllegalArgumentException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     * Returns all the relation ids for all the relations handled by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * Relation Service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     * @return ArrayList of String
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
    public List<String> getAllRelationIds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * Checks if given Role can be read in a relation of the given type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * @param roleName  name of role to be checked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * @param relationTypeName  name of the relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * @return an Integer wrapping an integer corresponding to possible
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * problems represented as constants in RoleUnresolved:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * <P>- 0 if role can be read
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * <P>- integer corresponding to RoleStatus.NO_ROLE_WITH_NAME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * <P>- integer corresponding to RoleStatus.ROLE_NOT_READABLE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     * @exception RelationTypeNotFoundException  if the relation type is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * known in the Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
    public Integer checkRoleReading(String roleName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
                                    String relationTypeName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
               RelationTypeNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * Checks if given Role can be set in a relation of given type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * @param role  role to be checked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * @param relationTypeName  name of relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * @param initFlag  flag to specify that the checking is done for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     * initialization of a role, write access shall not be verified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * @return an Integer wrapping an integer corresponding to possible
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * problems represented as constants in RoleUnresolved:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * <P>- 0 if role can be set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * <P>- integer corresponding to RoleStatus.NO_ROLE_WITH_NAME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * <P>- integer for RoleStatus.ROLE_NOT_WRITABLE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * <P>- integer for RoleStatus.LESS_THAN_MIN_ROLE_DEGREE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * <P>- integer for RoleStatus.MORE_THAN_MAX_ROLE_DEGREE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * <P>- integer for RoleStatus.REF_MBEAN_OF_INCORRECT_CLASS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * <P>- integer for RoleStatus.REF_MBEAN_NOT_REGISTERED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * @exception RelationTypeNotFoundException  if unknown relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    public Integer checkRoleWriting(Role role,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
                                    String relationTypeName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
                                    Boolean initFlag)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
               RelationTypeNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * Sends a notification (RelationNotification) for a relation creation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * The notification type is:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     * <P>- RelationNotification.RELATION_BASIC_CREATION if the relation is an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * object internal to the Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     * <P>- RelationNotification.RELATION_MBEAN_CREATION if the relation is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * MBean added as a relation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * <P>The source object is the Relation Service itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * <P>It is called in Relation Service createRelation() and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * addRelation() methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * @param relationId  relation identifier of the updated relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * @exception RelationNotFoundException  if there is no relation for given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
    public void sendRelationCreationNotification(String relationId)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
               RelationNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * Sends a notification (RelationNotification) for a role update in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * given relation. The notification type is:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     * <P>- RelationNotification.RELATION_BASIC_UPDATE if the relation is an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * object internal to the Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * <P>- RelationNotification.RELATION_MBEAN_UPDATE if the relation is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * MBean added as a relation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * <P>The source object is the Relation Service itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * <P>It is called in relation MBean setRole() (for given role) and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * setRoles() (for each role) methods (implementation provided in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * RelationSupport class).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * <P>It is also called in Relation Service setRole() (for given role) and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * setRoles() (for each role) methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * @param relationId  relation identifier of the updated relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * @param newRole  new role (name and new value)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * @param oldRoleValue  old role value (List of ObjectName objects)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * @exception RelationNotFoundException  if there is no relation for given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
    public void sendRoleUpdateNotification(String relationId,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
                                           Role newRole,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
                                           List<ObjectName> oldRoleValue)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
               RelationNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * Sends a notification (RelationNotification) for a relation removal.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * The notification type is:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * <P>- RelationNotification.RELATION_BASIC_REMOVAL if the relation is an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * object internal to the Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * <P>- RelationNotification.RELATION_MBEAN_REMOVAL if the relation is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * MBean added as a relation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     * <P>The source object is the Relation Service itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * <P>It is called in Relation Service removeRelation() method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     * @param relationId  relation identifier of the updated relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * @param unregMBeanList  List of ObjectNames of MBeans expected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * to be unregistered due to relation removal (can be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * @exception RelationNotFoundException  if there is no relation for given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
    public void sendRelationRemovalNotification(String relationId,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
                                                List<ObjectName> unregMBeanList)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
               RelationNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * Handles update of the Relation Service role map for the update of given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * role in given relation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * <P>It is called in relation MBean setRole() (for given role) and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     * setRoles() (for each role) methods (implementation provided in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     * RelationSupport class).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
     * <P>It is also called in Relation Service setRole() (for given role) and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * setRoles() (for each role) methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * <P>To allow the Relation Service to maintain the consistency (in case
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * of MBean unregistration) and to be able to perform queries, this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * must be called when a role is updated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * @param relationId  relation identifier of the updated relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     * @param newRole  new role (name and new value)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     * @param oldRoleValue  old role value (List of ObjectName objects)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     * @exception RelationServiceNotRegisteredException  if the Relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     * Service is not registered in the MBean Server
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     * @exception RelationNotFoundException  if no relation for given id.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
    public void updateRoleMap(String relationId,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
                              Role newRole,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
                              List<ObjectName> oldRoleValue)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
               RelationServiceNotRegisteredException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
               RelationNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     * Removes given relation from the Relation Service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     * <P>A RelationNotification notification is sent, its type being:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     * <P>- RelationNotification.RELATION_BASIC_REMOVAL if the relation was
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     * only internal to the Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     * <P>- RelationNotification.RELATION_MBEAN_REMOVAL if the relation is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * registered as an MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * <P>For MBeans referenced in such relation, nothing will be done,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * @param relationId  relation id of the relation to be removed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * @exception RelationServiceNotRegisteredException  if the Relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * Service is not registered in the MBean Server
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * @exception RelationNotFoundException  if no relation corresponding to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     * given relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
    public void removeRelation(String relationId)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
        throws RelationServiceNotRegisteredException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
               IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
               RelationNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     * Purges the relations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     * <P>Depending on the purgeFlag value, this method is either called
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * automatically when a notification is received for the unregistration of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * an MBean referenced in a relation (if the flag is set to true), or not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * (if the flag is set to false).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * <P>In that case it is up to the user to call it to maintain the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * consistency of the relations. To be kept in mind that if an MBean is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * unregistered and the purge not done immediately, if the ObjectName is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     * reused and assigned to another MBean referenced in a relation, calling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * manually this purgeRelations() method will cause trouble, as will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     * consider the ObjectName as corresponding to the unregistered MBean, not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     * seeing the new one.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * <P>The behavior depends on the cardinality of the role where the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * unregistered MBean is referenced:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * <P>- if removing one MBean reference in the role makes its number of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * references less than the minimum degree, the relation has to be removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     * <P>- if the remaining number of references after removing the MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * reference is still in the cardinality range, keep the relation and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     * update it calling its handleMBeanUnregistration() callback.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * @exception RelationServiceNotRegisteredException  if the Relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * Service is not registered in the MBean Server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
    public void purgeRelations()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
        throws RelationServiceNotRegisteredException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * Retrieves the relations where a given MBean is referenced.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     * <P>This corresponds to the CIM "References" and "ReferenceNames"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * operations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * @param mbeanName  ObjectName of MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * @param relationTypeName  can be null; if specified, only the relations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     * of that type will be considered in the search. Else all relation types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     * are considered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     * @param roleName  can be null; if specified, only the relations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     * where the MBean is referenced in that role will be returned. Else all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     * roles are considered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * @return an HashMap, where the keys are the relation ids of the relations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     * where the MBean is referenced, and the value is, for each key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     * an ArrayList of role names (as an MBean can be referenced in several
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     * roles in the same relation).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
    public Map<String,List<String>>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
        findReferencingRelations(ObjectName mbeanName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
                                 String relationTypeName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
                                 String roleName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
            throws IllegalArgumentException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     * Retrieves the MBeans associated to given one in a relation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     * <P>This corresponds to CIM Associators and AssociatorNames operations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     * @param mbeanName  ObjectName of MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     * @param relationTypeName  can be null; if specified, only the relations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     * of that type will be considered in the search. Else all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     * relation types are considered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     * @param roleName  can be null; if specified, only the relations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     * where the MBean is referenced in that role will be considered. Else all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     * roles are considered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     * @return an HashMap, where the keys are the ObjectNames of the MBeans
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
     * associated to given MBean, and the value is, for each key, an ArrayList
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
     * of the relation ids of the relations where the key MBean is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     * associated to given one (as they can be associated in several different
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * relations).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
    public Map<ObjectName,List<String>>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
        findAssociatedMBeans(ObjectName mbeanName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
                             String relationTypeName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
                             String roleName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
            throws IllegalArgumentException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     * Returns the relation ids for relations of the given type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     * @param relationTypeName  relation type name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     * @return an ArrayList of relation ids.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
     * @exception RelationTypeNotFoundException  if there is no relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     * with that name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
    public List<String> findRelationsOfType(String relationTypeName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
               RelationTypeNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
     * Retrieves role value for given role name in given relation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
     * @param relationId  relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
     * @param roleName  name of role
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     * @return the ArrayList of ObjectName objects being the role value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     * @exception RelationServiceNotRegisteredException  if the Relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
     * Service is not registered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     * @exception RelationNotFoundException  if no relation with given id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     * @exception RoleNotFoundException  if:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     * <P>- there is no role with given name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     * <P>or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
     * <P>- the role is not readable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
     * @see #setRole
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
    public List<ObjectName> getRole(String relationId,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
                                    String roleName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
        throws RelationServiceNotRegisteredException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
               IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
               RelationNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
               RoleNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
     * Retrieves values of roles with given names in given relation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
     * @param relationId  relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
     * @param roleNameArray  array of names of roles to be retrieved
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
     * @return a RoleResult object, including a RoleList (for roles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
     * successfully retrieved) and a RoleUnresolvedList (for roles not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
     * retrieved).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     * @exception RelationServiceNotRegisteredException  if the Relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
     * Service is not registered in the MBean Server
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
     * @exception RelationNotFoundException  if no relation with given id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     * @see #setRoles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
    public RoleResult getRoles(String relationId,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
                               String[] roleNameArray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
        throws RelationServiceNotRegisteredException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
               IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
               RelationNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
     * Returns all roles present in the relation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     * @param relationId  relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     * @return a RoleResult object, including a RoleList (for roles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     * successfully retrieved) and a RoleUnresolvedList (for roles not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     * readable).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     * @exception RelationNotFoundException  if no relation for given id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
     * @exception RelationServiceNotRegisteredException  if the Relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
     * Service is not registered in the MBean Server
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
    public RoleResult getAllRoles(String relationId)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
               RelationNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
               RelationServiceNotRegisteredException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
     * Retrieves the number of MBeans currently referenced in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
     * given role.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
     * @param relationId  relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
     * @param roleName  name of role
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
     * @return the number of currently referenced MBeans in that role
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
     * @exception RelationNotFoundException  if no relation with given id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     * @exception RoleNotFoundException  if there is no role with given name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
    public Integer getRoleCardinality(String relationId,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
                                      String roleName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
               RelationNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
               RoleNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
     * Sets the given role in given relation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
     * <P>Will check the role according to its corresponding role definition
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
     * provided in relation's relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
     * <P>The Relation Service will keep track of the change to keep the
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 5506
diff changeset
   702
     * consistency of relations by handling referenced MBean deregistrations.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
     * @param relationId  relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     * @param role  role to be set (name and new value)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
     * @exception RelationServiceNotRegisteredException  if the Relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
     * Service is not registered in the MBean Server
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
     * @exception RelationNotFoundException  if no relation with given id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
     * @exception RoleNotFoundException  if:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
     * <P>- internal relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     * <P>and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
     * <P>- the role does not exist or is not writable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
     * @exception InvalidRoleValueException  if internal relation and value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
     * provided for role is not valid:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
     * <P>- the number of referenced MBeans in given value is less than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
     * expected minimum degree
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
     * <P>or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
     * <P>- the number of referenced MBeans in provided value exceeds expected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     * maximum degree
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     * <P>or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     * <P>- one referenced MBean in the value is not an Object of the MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     * class expected for that role
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     * <P>or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
     * <P>- an MBean provided for that role does not exist
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
     * @exception RelationTypeNotFoundException  if unknown relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
     * @see #getRole
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
    public void setRole(String relationId,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
                        Role role)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
        throws RelationServiceNotRegisteredException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
               IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
               RelationNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
               RoleNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
               InvalidRoleValueException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
               RelationTypeNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
     * Sets the given roles in given relation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
     * <P>Will check the role according to its corresponding role definition
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
     * provided in relation's relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
     * <P>The Relation Service keeps track of the changes to keep the
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 5506
diff changeset
   745
     * consistency of relations by handling referenced MBean deregistrations.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
     * @param relationId  relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
     * @param roleList  list of roles to be set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
     * @return a RoleResult object, including a RoleList (for roles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
     * successfully set) and a RoleUnresolvedList (for roles not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
     * set).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
     * @exception RelationServiceNotRegisteredException  if the Relation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
     * Service is not registered in the MBean Server
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
     * @exception RelationNotFoundException  if no relation with given id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
     * @see #getRoles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
    public RoleResult setRoles(String relationId,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
                               RoleList roleList)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
        throws RelationServiceNotRegisteredException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
               IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
               RelationNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
     * Retrieves MBeans referenced in the various roles of the relation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
     * @param relationId  relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
     * @return a HashMap mapping:
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 21278
diff changeset
   773
     * <P> ObjectName {@literal ->} ArrayList of String (role
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
     * names)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
     * @exception RelationNotFoundException  if no relation for given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
     * relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
    public Map<ObjectName,List<String>> getReferencedMBeans(String relationId)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
               RelationNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
     * Returns name of associated relation type for given relation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
     * @param relationId  relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
     * @return the name of the associated relation type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
     * @exception RelationNotFoundException  if no relation for given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
     * relation id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
    public String getRelationTypeName(String relationId)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
               RelationNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
}