javax.management.relation
public class: RoleUnresolved [javadoc |
source]
java.lang.Object
javax.management.relation.RoleUnresolved
All Implemented Interfaces:
java$io$Serializable
Represents an unresolved role: a role not retrieved from a relation due
to a problem. It provides the role name, value (if problem when trying to
set the role) and an integer defining the problem (constants defined in
RoleStatus).
The serialVersionUID of this class is -48350262537070138L
.
Constructor: |
public RoleUnresolved(String name,
List<ObjectName> value,
int pbType) throws IllegalArgumentException {
if (name == null) {
String excMsg = "Invalid parameter.";
throw new IllegalArgumentException(excMsg);
}
setRoleName(name);
setRoleValue(value);
// Can throw IllegalArgumentException
setProblemType(pbType);
return;
}
Parameters:
name - name of the role
value - value of the role (if problem when setting the
role)
pbType - type of problem (according to known problem types,
listed as static final members).
Throws:
IllegalArgumentException - if null parameter or incorrect
problem type
- exception:
IllegalArgumentException - if null parameter or incorrect
problem type
|
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from javax.management.relation.RoleUnresolved Detail: |
public Object clone() {
try {
return new RoleUnresolved(roleName, roleValue, problemType);
} catch (IllegalArgumentException exc) {
return null; // :)
}
}
|
public int getProblemType() {
return problemType;
}
|
public String getRoleName() {
return roleName;
}
|
public List<ObjectName> getRoleValue() {
return roleValue;
}
|
public void setProblemType(int pbType) throws IllegalArgumentException {
if (!(RoleStatus.isRoleStatus(pbType))) {
String excMsg = "Incorrect problem type.";
throw new IllegalArgumentException(excMsg);
}
problemType = pbType;
return;
}
|
public void setRoleName(String name) throws IllegalArgumentException {
if (name == null) {
String excMsg = "Invalid parameter.";
throw new IllegalArgumentException(excMsg);
}
roleName = name;
return;
}
|
public void setRoleValue(List<ObjectName> value) {
if (value != null) {
roleValue = new ArrayList< ObjectName >(value);
} else {
roleValue = null;
}
return;
}
|
public String toString() {
StringBuilder result = new StringBuilder();
result.append("role name: " + roleName);
if (roleValue != null) {
result.append("; value: ");
for (Iterator< ObjectName > objNameIter = roleValue.iterator();
objNameIter.hasNext();) {
ObjectName currObjName = objNameIter.next();
result.append(currObjName.toString());
if (objNameIter.hasNext()) {
result.append(", ");
}
}
}
result.append("; problem type: " + problemType);
return result.toString();
}
Return a string describing this object. |