/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Represents a role: includes a role name and referenced MBeans (via their
* ObjectNames). The role value is always represented as an ArrayList
* collection (of ObjectNames) to homogenize the access.
*
* <p>The <b>serialVersionUID</b> of this class is <code>-279985518429862552L</code>.
*
* @since 1.5
*/
// Serialization compatibility stuff:
// Two serial forms are supported in this class. The selected form depends
// on system property "jmx.serial.form":
// - "1.0" for JMX 1.0
// - any other value for JMX 1.1 and higher
//
// Serial version for old serial form
//
// Serial version for new serial form
//
// Serializable fields in old serial form
{
};
//
// Serializable fields in new serial form
{
};
//
// Actual serial version and serial form
private static final long serialVersionUID;
/**
* @serialField name String Role name
* @serialField objectNameList List {@link List} of {@link ObjectName}s of referenced MBeans
*/
private static boolean compat = false;
static {
try {
} catch (Exception e) {
// OK : Too bad, no compat with 1.0
}
if (compat) {
} else {
}
}
//
// END Serialization compatibility stuff
//
// Private members
//
/**
* @serial Role name
*/
/**
* @serial {@link List} of {@link ObjectName}s of referenced MBeans
*/
//
// Constructors
//
/**
* <p>Make a new Role object.
* No check is made that the ObjectNames in the role value exist in
* an MBean server. That check will be made when the role is set
* in a relation.
*
* @param roleName role name
* @param roleValue role value (List of ObjectName objects)
*
* @exception IllegalArgumentException if null parameter
*/
throws IllegalArgumentException {
throw new IllegalArgumentException(excMsg);
}
return;
}
//
// Accessors
//
/**
* Retrieves role name.
*
* @return the role name.
*
* @see #setRoleName
*/
return name;
}
/**
* Retrieves role value.
*
* @return ArrayList of ObjectName objects for referenced MBeans.
*
* @see #setRoleValue
*/
return objectNameList;
}
/**
* Sets role name.
*
* @param roleName role name
*
* @exception IllegalArgumentException if null parameter
*
* @see #getRoleName
*/
throws IllegalArgumentException {
throw new IllegalArgumentException(excMsg);
}
return;
}
/**
* Sets role value.
*
* @param roleValue List of ObjectName objects for referenced
* MBeans.
*
* @exception IllegalArgumentException if null parameter
*
* @see #getRoleValue
*/
throws IllegalArgumentException {
throw new IllegalArgumentException(excMsg);
}
return;
}
/**
* Returns a string describing the role.
*
* @return the description of the role.
*/
objNameIter.hasNext();) {
if (objNameIter.hasNext()) {
}
}
}
//
// Misc
//
/**
* Clone the role object.
*
* @return a Role that is an independent copy of the current Role object.
*/
try {
} catch (IllegalArgumentException exc) {
return null; // can't happen
}
}
/**
* Returns a string for the given role value.
*
* @param roleValue List of ObjectName objects
*
* @return A String consisting of the ObjectNames separated by
* newlines (\n).
*
* @exception IllegalArgumentException if null parameter
*/
throws IllegalArgumentException {
throw new IllegalArgumentException(excMsg);
}
}
}
/**
* Deserializes a {@link Role} from an {@link ObjectInputStream}.
*/
throws IOException, ClassNotFoundException {
if (compat)
{
// Read an object serialized in the old serial form
//
{
throw new NullPointerException("myName");
}
{
throw new NullPointerException("myObjNameList");
}
}
else
{
// Read an object serialized in the new serial form
//
}
}
/**
* Serializes a {@link Role} to an {@link ObjectOutputStream}.
*/
throws IOException {
if (compat)
{
// Serializes this instance in the old serial form
//
out.writeFields();
}
else
{
// Serializes this instance in the new serial form
//
}
}
}