org.apache.ws.security.policy.parser
Class SecurityPolicyToken

java.lang.Object
  extended byorg.apache.ws.security.policy.parser.SecurityPolicyToken

public class SecurityPolicyToken
extends java.lang.Object


Field Summary
static int COMPLEX_TOKEN
          The following values describe the type of the security token.
static int SIMPLE_TOKEN
           
static int WITH_CONTENT
           
 
Constructor Summary
SecurityPolicyToken(java.lang.String token, int type, java.lang.String[] attribs)
          Create a SecurityPolicyToken data structure.
SecurityPolicyToken(java.lang.String token, int type, java.lang.String[] attribs, java.lang.Object h)
          Create a SecurityPolicyToken data structure.
 
Method Summary
 SecurityPolicyToken copy()
          Copy this SecurityPolicyToken and return the copy.
 java.lang.String[] getAttributes()
           
 SecurityPolicyToken getChildToken(java.lang.String sptName)
          Gets a named child token,
 java.lang.String getTokenName()
           
 int getTokenType()
           
 boolean invokeProcessTokenMethod(SecurityProcessorContext spc)
          Invoke the processing method for this token.
 void removeChildToken(java.lang.String sptName)
          Remove a named child token,
 void setChildToken(SecurityPolicyToken spt)
          Add a Child token to this complex token.
 void setProcessTokenMethod(java.lang.Object h)
          Set the method which processes this security token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPLEX_TOKEN

public static final int COMPLEX_TOKEN
The following values describe the type of the security token. A complex token starts a transaction because it contains nested tokens. A simple token does not contain nested tokens but stands allone an defines a simple assertion or property. If Content is set then this token contains additional text content, e.g. XPath expressions.

See Also:
Constant Field Values

SIMPLE_TOKEN

public static final int SIMPLE_TOKEN
See Also:
Constant Field Values

WITH_CONTENT

public static final int WITH_CONTENT
See Also:
Constant Field Values
Constructor Detail

SecurityPolicyToken

public SecurityPolicyToken(java.lang.String token,
                           int type,
                           java.lang.String[] attribs,
                           java.lang.Object h)
                    throws java.lang.SecurityException,
                           java.lang.NoSuchMethodException
Create a SecurityPolicyToken data structure.

Parameters:
token - The name of the token, equals to to local name of the XML element
type - Type of the token. Either complex or simple. Can have a flag if the token containes some data.
attribs - The names of allowed attributes on this token
h - The handler object that implements the processing method. The name of a processing method is constructed by prepending a "do" to the token name
Throws:
java.lang.SecurityException
java.lang.NoSuchMethodException

SecurityPolicyToken

public SecurityPolicyToken(java.lang.String token,
                           int type,
                           java.lang.String[] attribs)
Create a SecurityPolicyToken data structure.

Parameters:
token - The name of the token, equals to to local name of the XML element
type - Type of the token. Either complex or simple. Can have a flag if the token containes some data.
attribs - The names of allowed attributes on this token processing method is constructed by prepending a "do" to the token name
Method Detail

getAttributes

public java.lang.String[] getAttributes()
Returns:
Returns the attributes.

setProcessTokenMethod

public void setProcessTokenMethod(java.lang.Object h)
                           throws java.lang.NoSuchMethodException
Set the method which processes this security token.

Parameters:
h - The handler object that implements the processing method. The name of a processing method is constructed by prepending a "do" to the token name.
Throws:
java.lang.NoSuchMethodException

invokeProcessTokenMethod

public boolean invokeProcessTokenMethod(SecurityProcessorContext spc)
                                 throws java.lang.IllegalArgumentException,
                                        java.lang.IllegalAccessException,
                                        java.lang.reflect.InvocationTargetException
Invoke the processing method for this token.

Parameters:
spc - The SecurityProcessContext handed over to the processing method
Returns:
True if the token is processed successfully
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

getTokenName

public java.lang.String getTokenName()
Returns:
Returns the tokenName.

setChildToken

public void setChildToken(SecurityPolicyToken spt)
Add a Child token to this complex token.

Parameters:
spt - The child token to add to this Complex token

getChildToken

public SecurityPolicyToken getChildToken(java.lang.String sptName)
Gets a named child token,

Parameters:
sptName - The token name to check for
Returns:
the SecurityPolicyToken if this token contains the named token as child token, null otherwise.

removeChildToken

public void removeChildToken(java.lang.String sptName)
Remove a named child token,

Parameters:
sptName - The token name to remove

copy

public SecurityPolicyToken copy()
Copy this SecurityPolicyToken and return the copy. Produce a copy of this SPT. The imutable fields (token name, token type, and attributes) are copied by reference. The child tokens are copied by value thus they can be modified. The handler object and the associated processing method are not copied and must be intialized.

Returns:
A new SecurityPolicyToken

getTokenType

public int getTokenType()


Copyright © 2004-2008 Apache Web Services. All Rights Reserved.