Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sun.xacml
Class Target  view Target download Target.java

java.lang.Object
  extended bycom.sun.xacml.Target

public class Target
extends java.lang.Object

Represents the TargetType XML type in XACML. This also stores several other XML types: Subjects, Resources, and Actions. The target is used to quickly identify whether the parent element (a policy set, policy, or rule) is applicable to a given request.

Since:
1.0

Field Summary
private  java.util.List actions
           
private static java.util.logging.Logger logger
           
private  java.util.List resources
           
private  java.util.List subjects
           
 
Constructor Summary
Target(java.util.List subjects, java.util.List resources, java.util.List actions)
          Constructor that creates a Target from components.
 
Method Summary
private  MatchResult checkSet(java.util.List matchList, EvaluationCtx context)
          Helper function that determines whether there is at least one positive match between each section of the Target element and the input request
 void encode(java.io.OutputStream output)
          Encodes this Target into its XML representation and writes this encoding to the given OutputStream with no indentation.
 void encode(java.io.OutputStream output, Indenter indenter)
          Encodes this Target into its XML representation and writes this encoding to the given OutputStream with indentation.
private  void encodeSection(java.io.PrintStream output, Indenter indenter, java.lang.String name, java.util.List list)
          Helper function that encodes a section of the target.
 java.util.List getActions()
          Returns an unmodifiable List that represents the Actions section of this target.
private static java.util.List getAttributes(org.w3c.dom.Node root, java.lang.String prefix, java.lang.String xpathVersion)
          Helper method that parses the contents of the Subjects, Resources, or Actions types, depending on the input prefix, which must be either "Subject", "Resource", or "Action".
static Target getInstance(org.w3c.dom.Node root, java.lang.String xpathVersion)
          Creates a Target by parsing a node.
private static java.util.List getMatches(org.w3c.dom.Node root, java.lang.String prefix, java.lang.String xpathVersion)
          Helper method that parses the contents of a SubjectMatch, ResourceMatch, or ActionMatch type, depending on the input prefix, which must be either "Subject", "Resource" or "Action"
 java.util.List getResources()
          Returns an unmodifiable List that represents the Resources section of this target.
 java.util.List getSubjects()
          Returns an unmodifiable List that represents the Subjects section of this target.
 MatchResult match(EvaluationCtx context)
          Determines whether this Target matches the input request (whether it is applicable).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subjects

private java.util.List subjects

resources

private java.util.List resources

actions

private java.util.List actions

logger

private static final java.util.logging.Logger logger
Constructor Detail

Target

public Target(java.util.List subjects,
              java.util.List resources,
              java.util.List actions)
Constructor that creates a Target from components.

Method Detail

getInstance

public static Target getInstance(org.w3c.dom.Node root,
                                 java.lang.String xpathVersion)
                          throws ParsingException
Creates a Target by parsing a node.


getAttributes

private static java.util.List getAttributes(org.w3c.dom.Node root,
                                            java.lang.String prefix,
                                            java.lang.String xpathVersion)
                                     throws ParsingException
Helper method that parses the contents of the Subjects, Resources, or Actions types, depending on the input prefix, which must be either "Subject", "Resource", or "Action". A null List specifies any attributes will match; it represents AnySubject, AnyResource, or AnyAction.


getMatches

private static java.util.List getMatches(org.w3c.dom.Node root,
                                         java.lang.String prefix,
                                         java.lang.String xpathVersion)
                                  throws ParsingException
Helper method that parses the contents of a SubjectMatch, ResourceMatch, or ActionMatch type, depending on the input prefix, which must be either "Subject", "Resource" or "Action"


getSubjects

public java.util.List getSubjects()
Returns an unmodifiable List that represents the Subjects section of this target. Each entry in the List is another List that represents the Subject section. In turn, each of these Lists contains TargetMatch objects that represent SubjectMatch XML structures.

Note that future versions of this code may use intermediary classes to make the structure clearer, but this depends on the future structure of XACML Targets.


getResources

public java.util.List getResources()
Returns an unmodifiable List that represents the Resources section of this target. Each entry in the List is another List that represents the Resource section. In turn, each of these Lists contains TargetMatch objects that represent ResourceMatch XML structures.

Note that future versions of this code may use intermediary classes to make the structure clearer, but this depends on the future structure of XACML Targets.


getActions

public java.util.List getActions()
Returns an unmodifiable List that represents the Actions section of this target. Each entry in the List is another List that represents the Action section. In turn, each of these Lists contains TargetMatch objects that represent ActionMatch XML structures.

Note that future versions of this code may use intermediary classes to make the structure clearer, but this depends on the future structure of XACML Targets.


match

public MatchResult match(EvaluationCtx context)
Determines whether this Target matches the input request (whether it is applicable).


checkSet

private MatchResult checkSet(java.util.List matchList,
                             EvaluationCtx context)
Helper function that determines whether there is at least one positive match between each section of the Target element and the input request


encode

public void encode(java.io.OutputStream output)
Encodes this Target into its XML representation and writes this encoding to the given OutputStream with no indentation.


encode

public void encode(java.io.OutputStream output,
                   Indenter indenter)
Encodes this Target into its XML representation and writes this encoding to the given OutputStream with indentation.


encodeSection

private void encodeSection(java.io.PrintStream output,
                           Indenter indenter,
                           java.lang.String name,
                           java.util.List list)
Helper function that encodes a section of the target.