org.apache.ws.security.message
Class WSSecHeader

java.lang.Object
  extended byorg.apache.ws.security.message.WSSecHeader

public class WSSecHeader
extends java.lang.Object

This class implements WS Security header. Setup a Security header with a specified actor and mustunderstand flag.

The defaults for actor and mustunderstand are: empty actor and mustunderstand is true.

Author:
Werner Dittmann (Werner.Dittmann@apache.org)

Field Summary
protected  java.lang.String actor
           
protected  boolean doDebug
           
protected  boolean mustunderstand
           
 
Constructor Summary
WSSecHeader()
          Constructor.
WSSecHeader(java.lang.String actor)
          Constructor.
WSSecHeader(java.lang.String act, boolean mu)
          Constructor.
 
Method Summary
 org.w3c.dom.Element getSecurityHeader()
          Get the security header element of this instance.
 org.w3c.dom.Element insertSecurityHeader(org.w3c.dom.Document doc)
          Creates a security header and inserts it as child into the SOAP Envelope.
 boolean isEmpty(org.w3c.dom.Document doc)
          Returns whether the security header is empty
 void removeSecurityHeader(org.w3c.dom.Document doc)
           
 void setActor(java.lang.String act)
          set actor name.
 void setMustUnderstand(boolean mu)
          Set the mustUnderstand flag for the wsse:Security header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actor

protected java.lang.String actor

mustunderstand

protected boolean mustunderstand

doDebug

protected boolean doDebug
Constructor Detail

WSSecHeader

public WSSecHeader()
Constructor.


WSSecHeader

public WSSecHeader(java.lang.String actor)
Constructor.

Parameters:
actor - The actor name of the wsse:Security header

WSSecHeader

public WSSecHeader(java.lang.String act,
                   boolean mu)
Constructor.

Parameters:
act - The actor name of the wsse:Security header
mu - Set mustUnderstand to true or false
Method Detail

setActor

public void setActor(java.lang.String act)
set actor name.

Parameters:
act - The actor name of the wsse:Security header

setMustUnderstand

public void setMustUnderstand(boolean mu)
Set the mustUnderstand flag for the wsse:Security header.

Parameters:
mu - Set mustUnderstand to true or false

getSecurityHeader

public org.w3c.dom.Element getSecurityHeader()
Get the security header element of this instance.

Returns:
The security header element.

isEmpty

public boolean isEmpty(org.w3c.dom.Document doc)
Returns whether the security header is empty

Returns:
true if empty or if there is no security header false if non empty security header

insertSecurityHeader

public org.w3c.dom.Element insertSecurityHeader(org.w3c.dom.Document doc)
Creates a security header and inserts it as child into the SOAP Envelope.

Check if a WS Security header block for an actor is already available in the document. If a header block is found return it, otherwise a new wsse:Security header block is created and the attributes set

Parameters:
doc - A SOAP envelope as Document
Returns:
A wsse:Security element

removeSecurityHeader

public void removeSecurityHeader(org.w3c.dom.Document doc)


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.