com.metamatrix.platform.security.api
Class UserEntitlementInfo

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

public class UserEntitlementInfo
extends java.lang.Object
implements java.io.Serializable

Information about a particular entitled Resource (Group or table, Element or column), this class specifies a collection of Principals (users or user groups) - Grantees that have been granted certain Allowed Actions (one or more of {CREATE, READ, UPDATE, DELETE}) on the given Resource by one or more Grantors (granting authority).

There may be multiple Grantees that have multiple Allowed Actions they are entitled to perform on this Group or Element by multiple Grantors. This means we have an independantly varying triplet. We take a user-centered approach so this object contains a Set of GranteeEntitlementEntrys

See Also:
Serialized Form

Constructor Summary
UserEntitlementInfo(AuthorizationRealm realm, java.lang.String groupName, java.lang.String eleName)
          ctor
 
Method Summary
 void addTriplet(GranteeEntitlementEntry newEntry)
          Add a GranteeEntitlementEntry object.
 void addTriplet(MetaMatrixPrincipalName grantee, java.lang.String grantor, int allowedActions)
          Add a Grantee -> Grantor -> Allowed Actions triplet.
 boolean contains(java.lang.String grantee)
          Is the given grantee entitled to perform any action on the Resource represented by this object?
 java.lang.String getElementName()
          Get the element (column) of this entitlement.
 java.util.Collection getGrantees()
          Get the collection of Grantee names possessing this entitlement.
 java.lang.String getGroupName()
          Get the group (table) of this entitlement.
 java.lang.String getVDBName()
          Get the name of the VDB this entitlement falls under.
 java.lang.String getVDBVersion()
          Get the version of the VDB this entitlement falls under.
 boolean isGroupEntitlement()
          Does this represent a group or an element entitlement?
 java.util.Iterator iterator()
          Get an iterator over the Grantees possessing this entitlement.
 int size()
          Get the number of Grantees in this entitlement.
 java.lang.String toString()
          Pretty print this Object to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserEntitlementInfo

public UserEntitlementInfo(AuthorizationRealm realm,
                           java.lang.String groupName,
                           java.lang.String eleName)
ctor

Method Detail

isGroupEntitlement

public boolean isGroupEntitlement()
Does this represent a group or an element entitlement?

Returns:
true if this object pertains to a group entitlement, false if it's an element entitlement.

getVDBName

public java.lang.String getVDBName()
Get the name of the VDB this entitlement falls under.

Returns:
The VDB name.

getVDBVersion

public java.lang.String getVDBVersion()
Get the version of the VDB this entitlement falls under.

Returns:
The VDB version.

getGroupName

public java.lang.String getGroupName()
Get the group (table) of this entitlement.

Returns:
The group name this entitlement pertains to.

getElementName

public java.lang.String getElementName()
Get the element (column) of this entitlement.

Note: Will be null if this is a group entitlement.

Returns:
The element name this entitlement pertains to.

size

public int size()
Get the number of Grantees in this entitlement.

Returns:
The number of Grantees this entitlement pertains to.

contains

public boolean contains(java.lang.String grantee)
Is the given grantee entitled to perform any action on the Resource represented by this object?

Parameters:
grantee - The user (or user group) name of inquery.
Returns:
true if the grantee can perform one or more actions on this Resource, false if he can perform none.

getGrantees

public java.util.Collection getGrantees()
Get the collection of Grantee names possessing this entitlement.

Elements of the collection are of type GranteeEntitlementEntry and are sorted.

Returns:
The collection of Grantee names.

iterator

public java.util.Iterator iterator()
Get an iterator over the Grantees possessing this entitlement.
Note that when iterating over elements, sort order is not guaranteed.

Elements of the iterator are of type GranteeEntitlementEntry.

Returns:
The Iterator of Grantees.

addTriplet

public void addTriplet(MetaMatrixPrincipalName grantee,
                       java.lang.String grantor,
                       int allowedActions)
Add a Grantee -> Grantor -> Allowed Actions triplet.

Parameters:
grantee - A Grantee.
grantor - A Grantor.
allowedActions - The Allowed Actions on the resource granted by the Grantor to the Grantee.

addTriplet

public void addTriplet(GranteeEntitlementEntry newEntry)
Add a GranteeEntitlementEntry object.

Parameters:
newEntry - A new entry.

toString

public java.lang.String toString()
Pretty print this Object to a String.
  1. VDB Name, VDB Version
  2. Group Name (fully qualified)
  3. Element Name (fully qualified)
    • Grantee Name; Grantor Name; Allowed Actions (A String[] of one or more of {CREATE, READ, UPDATE, DELETE})
    • ...

Overrides:
toString in class java.lang.Object


Copyright © 2009. All Rights Reserved.