com.metamatrix.platform.security.api
Class DataAccessResource

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

public class DataAccessResource
extends java.lang.Object
implements AuthorizationResource, java.io.Serializable

Defines a resource associated with a BasicAuthorizationPermission.

See Also:
Serialized Form

Field Summary
static java.lang.String RECURSIVE
           
static java.lang.String SEPARATOR_WITH_RECURSIVE
           
 
Constructor Summary
DataAccessResource(java.lang.String name)
          ctor
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this DataAccessResource to another Object.
 boolean equals(java.lang.Object obj)
          Overrides method defined in Object.
 java.lang.String getCanonicalName()
          Get the canonical name for this resource - used internally for comparing.
 java.lang.String getID()
          Get the identifier of this resource.
 java.lang.String getName()
          Get the resource name.
 java.lang.String getUUID()
          Get the UUID of this resource.
 int hashCode()
          Overrides method defined in Object.
 boolean implies(AuthorizationResource thatResource)
          Does this resource "imply" another?
 boolean isCannonicallyEquivalent(AuthorizationResource resource)
          Are these resources equal exception for recursion?
 boolean isRecursive()
          Determine if the Actions applies to this resource should be applied recursively to sub resources.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RECURSIVE

public static final java.lang.String RECURSIVE
See Also:
Constant Field Values

SEPARATOR_WITH_RECURSIVE

public static final java.lang.String SEPARATOR_WITH_RECURSIVE
See Also:
Constant Field Values
Constructor Detail

DataAccessResource

public DataAccessResource(java.lang.String name)
ctor

Parameters:
name - The resource name
Method Detail

hashCode

public int hashCode()
Overrides method defined in Object.

Overrides:
hashCode in class java.lang.Object
Returns:
The hashCode of this object.

equals

public boolean equals(java.lang.Object obj)
Overrides method defined in Object. Note: this method is consistent with compareTo().

Overrides:
equals in class java.lang.Object
Parameters:
obj - The Object to compare.
Returns:
true if two DataAccessResource instances are semantically equal.

isCannonicallyEquivalent

public boolean isCannonicallyEquivalent(AuthorizationResource resource)
Are these resources equal exception for recursion?

Specified by:
isCannonicallyEquivalent in interface AuthorizationResource
Parameters:
resource - The resource to compare with this one disregarding recursion.
Returns:
true if these two resources differ only be recursion.

getName

public java.lang.String getName()
Get the resource name.

Specified by:
getName in interface AuthorizationResource
Returns:
The resource name.

getID

public java.lang.String getID()
Get the identifier of this resource. Will not be null. This is the identifier used to store and retrieve this resource from the Authorization store.

Specified by:
getID in interface AuthorizationResource
Returns:
The resource identifier.

getUUID

public java.lang.String getUUID()
Get the UUID of this resource. May be null. This is a payload of UUID for MetaBase authorization code.

Specified by:
getUUID in interface AuthorizationResource
Returns:
The resource's UUID, if present, else null.

getCanonicalName

public java.lang.String getCanonicalName()
Get the canonical name for this resource - used internally for comparing.

Specified by:
getCanonicalName in interface AuthorizationResource
Returns:
The resource's canonical name.

isRecursive

public boolean isRecursive()
Determine if the Actions applies to this resource should be applied recursively to sub resources.

Specified by:
isRecursive in interface AuthorizationResource
Returns:
Whether the actions are to be applied recursivly.

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Compares this DataAccessResource to another Object. If the Object is an DataAccessResource, this function compares the name. Otherwise, it throws a ClassCastException (as DataAccessResource instances are comparable only to other DataAccessResource 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 DataAccessResource.

implies

public boolean implies(AuthorizationResource thatResource)
Does this resource "imply" another?

Specified by:
implies in interface AuthorizationResource
Parameters:
thatResource - The other resource

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009. All Rights Reserved.