org.opends.server.authorization.dseecompat
Class TargetAttr

java.lang.Object
  extended by org.opends.server.authorization.dseecompat.TargetAttr

public class TargetAttr
extends java.lang.Object

A class representing an ACI's targetattr keyword.


Method Summary
static TargetAttr decode(EnumTargetOperator operator, java.lang.String expr)
          Decodes an targetattr expression string into a targetattr class suitable for evaluation.
 java.util.HashSet<AttributeType> getAttributes()
          Return array holding each attribute type to be evaluated in the expression.
 java.util.HashSet<AttributeType> getOpAttributes()
          Return array holding operational attribute types to be evaluated in the expression.
 EnumTargetOperator getOperator()
          Returns the operator enumeration of the targetattr expression.
 boolean isAllOpAttributes()
          This flag is set if the parsing code saw: targetattr="+" or targetattr != "+".
 boolean isAllUserAttributes()
          This flag is set if the parsing code saw: targetattr="*" or targetattr != "*".
static boolean isApplicable(AttributeType a, TargetAttr targetAttr)
          Performs test to see if the specified is applicable to the specified TargetAttr.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getOperator

public EnumTargetOperator getOperator()
Returns the operator enumeration of the targetattr expression.

Returns:
The operator enumeration.

isAllUserAttributes

public boolean isAllUserAttributes()
This flag is set if the parsing code saw: targetattr="*" or targetattr != "*".

Returns:
True if all attributes was seen.

isAllOpAttributes

public boolean isAllOpAttributes()
This flag is set if the parsing code saw: targetattr="+" or targetattr != "+".

Returns:
True if all attributes was seen.

getAttributes

public java.util.HashSet<AttributeType> getAttributes()
Return array holding each attribute type to be evaluated in the expression.

Returns:
Array holding each attribute types.

getOpAttributes

public java.util.HashSet<AttributeType> getOpAttributes()
Return array holding operational attribute types to be evaluated in the expression.

Returns:
Array holding attribute types.

decode

public static TargetAttr decode(EnumTargetOperator operator,
                                java.lang.String expr)
                         throws AciException
Decodes an targetattr expression string into a targetattr class suitable for evaluation.

Parameters:
operator - The operator enumeration of the expression.
expr - The expression string to be decoded.
Returns:
A TargetAttr suitable to evaluate this ACI's targetattrs.
Throws:
AciException - If the expression string is invalid.

isApplicable

public static boolean isApplicable(AttributeType a,
                                   TargetAttr targetAttr)
Performs test to see if the specified is applicable to the specified TargetAttr. First a check if the TargetAttr parsing code saw an expression like: (targetattrs="+ || *), (targetattrs != "* || +) where both shorthand tokens where parsed. IF so then the attribute type matches automatically (or not matches if NOT_EQUALITY). If there isn't a match, then the method evalAttrType is called to further evaluate the attribute type and targetAttr combination.

Parameters:
a - The attribute type to evaluate.
targetAttr - The ACI's TargetAttr class to evaluate against.
Returns:
The boolean result of the above tests and application TargetAttr's operator value applied to the test result.