com.metamatrix.platform.security.api
Class GranteeEntitlementEntry

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

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

This object contains one entry for an entitlement entry in UserEntitlementInfo. It comprises the triplet of Grantee the Grantor that assigned him the Allowed Actions and the Allowed Actions on the Resource of the entitlement.

This is not a standalone object. These objects are returned as elements of UserEntitlementInfo.iterator(). Specifically, the Resource and VDB name and version are constant over iteration and are contained in UserEntitlementInfo.

See Also:
Serialized Form

Constructor Summary
GranteeEntitlementEntry(MetaMatrixPrincipalName grantee, GranteeEntitlementEntry clone)
          
ctor.
Uses another GranteeEntitlementEntry as a pattern to clone only changing the Grantee.
GranteeEntitlementEntry(MetaMatrixPrincipalName grantee, java.lang.String grantor, int allowedActions)
          
ctor.
Used when creating in the Authorization JDBC layer.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this GranteeEntitlementEntry to another Object.
 boolean equals(java.lang.Object obj)
          Returns true if the specified object is semantically equal to this instance.
 java.lang.String[] getAllowedActions()
          Get the Allowed Actions.
 java.lang.String getGrantee()
          Get the Grantee.
 java.lang.String getGrantor()
          Get the Grantor.
 int hashCode()
          Overrides Object method of the same name
 boolean isUserGroup()
          Does this Grantee represent a user group? If not, it's a user.
 java.lang.String toString()
          String representation of object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GranteeEntitlementEntry

public GranteeEntitlementEntry(MetaMatrixPrincipalName grantee,
                               java.lang.String grantor,
                               int allowedActions)

ctor.
Used when creating in the Authorization JDBC layer.

Parameters:
grantee -
grantor -
alloweActions -

GranteeEntitlementEntry

public GranteeEntitlementEntry(MetaMatrixPrincipalName grantee,
                               GranteeEntitlementEntry clone)

ctor.
Uses another GranteeEntitlementEntry as a pattern to clone only changing the Grantee. Used specifically when clone is a user group and grantee was determined to be one of the group members.

Parameters:
grantee - The new principal this object will represent.
clone - All other inforamtion comes from this clone.
Method Detail

getGrantee

public java.lang.String getGrantee()
Get the Grantee.

Returns:
The Grantee.

isUserGroup

public boolean isUserGroup()
Does this Grantee represent a user group? If not, it's a user.

Returns:
true if the Grantee represents a user group, false if it's of type user.

getGrantor

public java.lang.String getGrantor()
Get the Grantor.

Returns:
The Grantor.

getAllowedActions

public java.lang.String[] getAllowedActions()
Get the Allowed Actions.

Returns:
The Allowed Actions.

hashCode

public int hashCode()
Overrides Object method of the same name

Overrides:
hashCode in class java.lang.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 GranteeEntitlementEntry to another Object. If the Object is an GranteeEntitlementEntry, this function compares the name. Otherwise, it throws a ClassCastException (as GranteeEntitlementEntry instances are comparable only to other GranteeEntitlementEntry instances). Note: this method is consistent with equals().

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - 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 GranteeEntitlementEntry.

toString

public java.lang.String toString()
String representation of object.

Overrides:
toString in class java.lang.Object


Copyright © 2009. All Rights Reserved.