com.metamatrix.platform.security.api
Class AuthorizationPolicyID

java.lang.Object
  extended by com.metamatrix.platform.security.api.AuthorizationPolicyID
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class AuthorizationPolicyID
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

See Also:
Serialized Form

Field Summary
static char DELIMITER
           
static int DESCRIPTION_LEN
           
 
Constructor Summary
AuthorizationPolicyID(java.lang.String name, java.lang.String description)
          ctor Meant to be used only by JDBCAuthorizationTransaction to populate AuthorizationPolicyIDs when retrieving them from the authorization store.
AuthorizationPolicyID(java.lang.String theDisplayName, java.lang.String description, AuthorizationRealm theRealm)
          Construct a policy ID that is tied to an AuthorizationRealm.
AuthorizationPolicyID(java.lang.String theDisplayName, java.lang.String vdbName, int vdbVersion)
          Construct a policy ID that is tied to a VDB.
AuthorizationPolicyID(java.lang.String theDisplayName, java.lang.String vdbName, java.lang.String vdbVersion)
          Construct a policy ID that is tied to a VDB.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this AuthorizationPolicyID to another Object.
 boolean equals(java.lang.Object obj)
          Returns true if the specified object is semantically equal to this instance.
static java.lang.String formName(java.lang.String displayName, java.lang.String vdbName, java.lang.String vdbVersion)
           
 java.lang.String getDescription()
          Obtain the description for this policy which may be null.
 java.lang.String getDisplayName()
          Returns the Console display name for the policy.
 java.lang.String getName()
          Returns the name for the policy.
 AuthorizationRealm getRealm()
          Get the AuthorizationRealm this policy belongs in.
 java.lang.String getVDBName()
          Returns the Console's VDB name for the policy.
 int getVDBVersion()
          Return the Console's VDB version for the policy.
 java.lang.String getVDBVersionString()
          Return the Stringified Console's VDB version for the policy.
 int hashCode()
          Overrides Object hashCode method.
static java.lang.String parseRealm(AuthorizationRealm aRealm)
           
 void setDescription(java.lang.String desc)
          Define the set of description for this policy.
 java.lang.String toString()
          Returns a string representing the current state of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DELIMITER

public static final char DELIMITER
See Also:
Constant Field Values

DESCRIPTION_LEN

public static final int DESCRIPTION_LEN
See Also:
Constant Field Values
Constructor Detail

AuthorizationPolicyID

public AuthorizationPolicyID(java.lang.String name,
                             java.lang.String description)
ctor Meant to be used only by JDBCAuthorizationTransaction to populate AuthorizationPolicyIDs when retrieving them from the authorization store. Construct a policy ID with the specified name and description.

Parameters:
name - the identifier (name) for the policy composed of
description - the policy description.

AuthorizationPolicyID

public AuthorizationPolicyID(java.lang.String theDisplayName,
                             java.lang.String description,
                             AuthorizationRealm theRealm)
Construct a policy ID that is tied to an AuthorizationRealm.

Parameters:
theDisplayName - the identifier that the Console will display.
description - The policy description - may be null.
theRealm - The AuthorizationRealm this policy should be tied to - may not be null.

AuthorizationPolicyID

public AuthorizationPolicyID(java.lang.String theDisplayName,
                             java.lang.String vdbName,
                             int vdbVersion)
Construct a policy ID that is tied to a VDB.

Parameters:
theDisplayName - the identifier that the Console will display.
vdbName - The name of the VDB this policy should be tied to.
vdbVersion - The version of the VDB this policy should be tied to.

AuthorizationPolicyID

public AuthorizationPolicyID(java.lang.String theDisplayName,
                             java.lang.String vdbName,
                             java.lang.String vdbVersion)
Construct a policy ID that is tied to a VDB.

Parameters:
theDisplayName - the identifier that the Console will display.
vdbName - The name of the VDB this policy should be tied to.
vdbVersion - The version of the VDB this policy should be tied to.
Method Detail

getRealm

public AuthorizationRealm getRealm()
Get the AuthorizationRealm this policy belongs in.

Returns:
the policy's realm.

getName

public java.lang.String getName()
Returns the name for the policy.

Returns:
the policy's name

getDescription

public java.lang.String getDescription()
Obtain the description for this policy which may be null.

Returns:
the description. May be null.

getDisplayName

public java.lang.String getDisplayName()
Returns the Console display name for the policy. May return the same as getName().

Returns:
the Console display name

getVDBName

public java.lang.String getVDBName()
Returns the Console's VDB name for the policy. (Console limits policy to one version of one VDB.) May be null.

Returns:
The VDB name or null if the policy that this ID represents is not tied to a VDB.

getVDBVersion

public int getVDBVersion()
Return the Console's VDB version for the policy. (Console limits policy to one version of one VDB.)

Returns:
The VDB version or -1 if the policy that this ID represents is not tied to a VDB.

getVDBVersionString

public java.lang.String getVDBVersionString()
Return the Stringified Console's VDB version for the policy. (Console limits policy to one version of one VDB.)

Returns:
The VDB version or -1 if the policy that this ID represents is not tied to a VDB.

setDescription

public void setDescription(java.lang.String desc)
Define the set of description for this policy.

Parameters:
desc - the new description for this policy.

toString

public java.lang.String toString()
Returns a string representing the current state of the object.

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides Object hashCode method.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.
See Also:
Object.hashCode(), Object.equals(Object)

equals

public boolean equals(java.lang.Object obj)
Returns true if the specified object is semantically equal to this instance. Note: this method is consistent with compareTo().

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object that this instance is to be compared to.
Returns:
whether the object is equal to this object.

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Compares this AuthorizationPolicyID to another Object. If the Object is an AuthorizationPolicyID, this function compares the name. Otherwise, it throws a ClassCastException (as policyID instances are comparable only to other policyID instances). Note: this method is consistent with equals().

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the object that this instance is to be compared to.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object, respectively.
Throws:
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this AuthorizationPolicyID.

parseRealm

public static java.lang.String parseRealm(AuthorizationRealm aRealm)

formName

public static java.lang.String formName(java.lang.String displayName,
                                        java.lang.String vdbName,
                                        java.lang.String vdbVersion)


Copyright © 2009. All Rights Reserved.