deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.security.drm.model
Class RightSet

java.lang.Object
  extended by org.deegree.security.drm.model.RightSet

public class RightSet
extends Object

A RightSet encapsulates a number of Right objects. This are grouped by the SecurableObject for which they apply to support an efficient implementation of the merge()-operation. The merge()-operation results in a RightSet that contains the logical rights of boths sets, but only one Right object of each RightType (and SecurableObject). This is accomplished by merging the constraints of the Rights of the same type (and object).

Version:
$Revision: 18195 $
Author:
Markus Schneider

Constructor Summary
RightSet()
           
RightSet(Right[] rights)
           
 
Method Summary
 boolean applies(SecurableObject object, RightType type)
          Checks if the RightSet contains the (unrestricted) permissions for a SecurableObject and a certain type of right.
 boolean applies(SecurableObject object, RightType type, Feature situation)
          Checks if the RightSet contains the permissions for a SecurableObject and a concrete situation (the situation is represented by the given Feature).
 Right getRight(SecurableObject secObject, RightType type)
           
 RightSet merge(RightSet that)
          Produces the logical disjunction of two RightSets.
 Right[] toArray(SecurableObject secObject)
           
 Right[][] toArray2()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RightSet

RightSet()

RightSet

public RightSet(Right[] rights)
Parameters:
rights -
Method Detail

applies

public boolean applies(SecurableObject object,
                       RightType type,
                       Feature situation)
                throws GeneralSecurityException
Checks if the RightSet contains the permissions for a SecurableObject and a concrete situation (the situation is represented by the given Feature).

Parameters:
object -
type -
situation -
Returns:
true, if the right applies
Throws:
GeneralSecurityException

applies

public boolean applies(SecurableObject object,
                       RightType type)
Checks if the RightSet contains the (unrestricted) permissions for a SecurableObject and a certain type of right.

Parameters:
object -
type -
Returns:
true, if the right applies

getRight

public Right getRight(SecurableObject secObject,
                      RightType type)
Parameters:
secObject -
type -
Returns:
the Right of the specified RightType that this RightSet defines on the specified SecurableObject.

toArray

public Right[] toArray(SecurableObject secObject)
Parameters:
secObject -
Returns:
the encapulated Rights (for one SecurableObject) as an one-dimensional array.

toArray2

public Right[][] toArray2()
Returns:
the encapulated Rights as a two-dimensional array:
  • first index: runs the different SecurableObjects
  • second index: runs the different Rights

merge

public RightSet merge(RightSet that)
Produces the logical disjunction of two RightSets.

Parameters:
that -
Returns:
the new right set

toString

public String toString()
Overrides:
toString in class Object

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org