org.apache.ws.sandbox.security.trust.message.token
Class RequestSecurityToken

java.lang.Object
  extended byorg.apache.ws.sandbox.security.trust.message.token.AbstractToken
      extended byorg.apache.ws.sandbox.security.trust.message.token.CompositeElement
          extended byorg.apache.ws.sandbox.security.trust.message.token.RequestSecurityToken
Direct Known Subclasses:
CancelRequestSecurityToken, IssueRequestSecurityToken, RenewRequestSecurityToken, ValidateRequestSecurityToken

public abstract class RequestSecurityToken
extends CompositeElement


Field Summary
protected  RequestType requestTypeElement
           
static javax.xml.namespace.QName TOKEN
           
protected  TokenType tokenTypeElement
           
 
Fields inherited from class org.apache.ws.sandbox.security.trust.message.token.AbstractToken
document, element
 
Constructor Summary
RequestSecurityToken(org.w3c.dom.Document doc, java.lang.String requestType)
          Creates a new wst:RequestSecurityToken with the given request type
RequestSecurityToken(org.w3c.dom.Element elem)
          Instanciate a new RequestSecurityToken with a wst:RequestSecurityToken token's element
 
Method Summary
 void addAttribute(java.lang.String attribute, java.lang.String value)
          This is provided as an extensibility mechnism to ass any attrbute to the wst:RequestSecyrityToken element
 void addToken(org.w3c.dom.Element childToken)
          This is provided as an extensibility mechanism to add any child element to the wst:RequestSecyrityToken element
protected  void deserializeChildElement(org.w3c.dom.Element elem)
          This is called for each of the immediate child elements of type Node.ELEMENT_NODE of this token
 java.lang.String getAttributeValue(java.lang.String attribute)
          This is to be used to retrieve the value of the custom attrbutes added to the wst:RequestSecyrityToken
 org.w3c.dom.Element getElement()
          Returns the root element of this token TODO: This should be removed
 java.lang.String getRequesType()
          Returns the value of the RequestType element
protected  javax.xml.namespace.QName getToken()
          Returns the QName of this type
 org.w3c.dom.NodeList getTokensByTagNameNS(java.lang.String namespace, java.lang.String tagName)
          This is provided to be used to extract custom elements from the wst:RequestSecyrityToken
 java.lang.String getTokenType()
          Returns the value of the TokenType element
protected abstract  void handleSpecificChildren(org.w3c.dom.Element elem)
          This is used to handle the specific child elements for the four types of requests Issue @see TrustConstants#ISSUE_SECURITY_TOKEN Renew @see TrustConstants#RENEW_SECURITY_TOKEN Cancel @see TrustConstants#CANCEL_SECURITY_TOKEN Validate @see TrustConstants#VALIDATE_SECURITY_TOKEN
 void setContextAttr(java.lang.String contextAttrValue)
           
 void setRequestType(java.lang.String requestType)
          Sets the wst:RequestType value of this wst:RequestSecurityToken
 void setTokenType(java.lang.String tokenType)
          Sets the wst:TokenType value of this wst:RequestSecurityToken
 
Methods inherited from class org.apache.ws.sandbox.security.trust.message.token.CompositeElement
setElementTextValue
 
Methods inherited from class org.apache.ws.sandbox.security.trust.message.token.AbstractToken
addChild, parse, removeChild, setElement, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tokenTypeElement

protected TokenType tokenTypeElement

requestTypeElement

protected RequestType requestTypeElement

TOKEN

public static final javax.xml.namespace.QName TOKEN
Constructor Detail

RequestSecurityToken

public RequestSecurityToken(org.w3c.dom.Document doc,
                            java.lang.String requestType)
Creates a new wst:RequestSecurityToken with the given request type

Parameters:
doc -
requestType -

RequestSecurityToken

public RequestSecurityToken(org.w3c.dom.Element elem)
                     throws WSTrustException
Instanciate a new RequestSecurityToken with a wst:RequestSecurityToken token's element

Parameters:
elem -
Throws:
WSSecurityException
WSTrustException
Method Detail

setTokenType

public void setTokenType(java.lang.String tokenType)
Sets the wst:TokenType value of this wst:RequestSecurityToken

Parameters:
tokenType - The wst:TokenType uri as a String

getTokenType

public java.lang.String getTokenType()
Returns the value of the TokenType element

Returns:

setRequestType

public void setRequestType(java.lang.String requestType)
Sets the wst:RequestType value of this wst:RequestSecurityToken

Parameters:
requestType - The wst:RequestType uri as a String

getRequesType

public java.lang.String getRequesType()
Returns the value of the RequestType element

Returns:

setContextAttr

public void setContextAttr(java.lang.String contextAttrValue)

addToken

public void addToken(org.w3c.dom.Element childToken)
This is provided as an extensibility mechanism to add any child element to the wst:RequestSecyrityToken element

Parameters:
childToken -

addAttribute

public void addAttribute(java.lang.String attribute,
                         java.lang.String value)
This is provided as an extensibility mechnism to ass any attrbute to the wst:RequestSecyrityToken element

Parameters:
attribute -
value -

getTokensByTagNameNS

public org.w3c.dom.NodeList getTokensByTagNameNS(java.lang.String namespace,
                                                 java.lang.String tagName)
This is provided to be used to extract custom elements from the wst:RequestSecyrityToken

Parameters:
namespace -
tagName -
Returns:

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String attribute)
This is to be used to retrieve the value of the custom attrbutes added to the wst:RequestSecyrityToken

Parameters:
attribute -
Returns:

getToken

protected javax.xml.namespace.QName getToken()
Returns the QName of this type

Specified by:
getToken in class AbstractToken
Returns:
See Also:
AbstractToken.getToken()

getElement

public org.w3c.dom.Element getElement()
Returns the root element of this token TODO: This should be removed

Overrides:
getElement in class AbstractToken
Returns:

deserializeChildElement

protected void deserializeChildElement(org.w3c.dom.Element elem)
                                throws WSTrustException
Description copied from class: AbstractToken
This is called for each of the immediate child elements of type Node.ELEMENT_NODE of this token

Specified by:
deserializeChildElement in class AbstractToken
Parameters:
elem - The child element
Throws:
WSTrustException

handleSpecificChildren

protected abstract void handleSpecificChildren(org.w3c.dom.Element elem)
                                        throws WSTrustException
This is used to handle the specific child elements for the four types of requests
  • Issue
  • @see TrustConstants#ISSUE_SECURITY_TOKEN
  • Renew
  • @see TrustConstants#RENEW_SECURITY_TOKEN
  • Cancel
  • @see TrustConstants#CANCEL_SECURITY_TOKEN
  • Validate
  • @see TrustConstants#VALIDATE_SECURITY_TOKEN

Parameters:
elem -
Throws:
WSTrustException


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