com.sun.xml.wss.impl
Class SecurableSoapMessage

java.lang.Object
  extended by javax.xml.soap.SOAPMessage
      extended by com.sun.xml.wss.impl.SecurableSoapMessage

public final class SecurableSoapMessage
extends SOAPMessage


Field Summary
 
Fields inherited from class javax.xml.soap.SOAPMessage
CHARACTER_SET_ENCODING, WRITE_XML_DECLARATION
 
Constructor Summary
SecurableSoapMessage()
           
SecurableSoapMessage(SOAPMessage soapMessage)
           
 
Method Summary
 void addAttachmentPart(AttachmentPart AttachmentPart)
           
 int countAttachments()
           
 AttachmentPart createAttachmentPart()
           
 AttachmentPart createAttachmentPart(DataHandler dataHandler)
           
 AttachmentPart createAttachmentPart(Object content, String contentType)
           
 void deleteSecurityHeader()
          Delete security header
 boolean equals(Object obj)
           
 SecurityHeader findOrCreateSecurityHeader()
          Finds or creates wsse:Security Header
 SecurityHeader findSecurityHeader()
          Finds wsse:Security Header
 SecurityHeader findWsseSecurityHeaderBlock(boolean doCreate, boolean mustUnderstand)
          Finds wsse:Security Header Block.
 void generateFault(WssSoapFaultException sfe)
           
 String generateId()
           
 void generateSecurityHeaderException(String exceptionMessage)
          Create and initialize a SecurityHeaderException, and throw a fault based on it.
 void generateWsuId(Element element)
           
 void generateWsuId(Element element, String id)
           
 AttachmentPart getAttachment(SOAPElement element)
           
 AttachmentPart getAttachmentPart(String uri)
           
 Iterator getAttachments()
           
 Iterator getAttachments(MimeHeaders headers)
           
 String getContentDescription()
           
 Element getElementById(String id)
           
 SOAPElement getElementByWsuId(String id)
           
 SOAPEnvelope getEnvelope()
           
static String getIdFromFragmentRef(String ref)
           
 Object getMessageParts(Target target)
           
 MimeHeaders getMimeHeaders()
           
 NamespaceContext getNamespaceContext()
           
 Object getProperty(String property)
           
 SOAPBody getSOAPBody()
           
 SOAPHeader getSOAPHeader()
           
 SOAPMessage getSOAPMessage()
           
 SOAPPart getSOAPPart()
           
 int hashCode()
           
 void init(SOAPMessage soapMessage)
           
 boolean isOptimized()
           
static WssSoapFaultException newSOAPFaultException(QName faultCode, String faultstring, Throwable th)
          Create and initialize a WssSoapFaultException.
static WssSoapFaultException newSOAPFaultException(String faultstring, Throwable th)
          Create and initialize a WssSoapFaultException.
 void removeAllAttachments()
           
 void removeAttachments(MimeHeaders hdrs)
           
 void resetMustUnderstandOnSecHeader()
          Make Security Header Non-MustUnderstand
 void saveChanges()
           
 boolean saveRequired()
           
 void setContentDescription(String description)
           
 void setDoNotSetMU(boolean doNotSetMU)
           
 void setOptimized(boolean optimized)
           
 void setProperty(String property, Object value)
           
 void setSOAPMessage(SOAPMessage soapMsg)
           
 String toString()
           
 void writeTo(OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SecurableSoapMessage

public SecurableSoapMessage()

SecurableSoapMessage

public SecurableSoapMessage(SOAPMessage soapMessage)
                     throws XWSSecurityException
Parameters:
soapMessage -
Throws:
XWSSecurityException
Method Detail

init

public void init(SOAPMessage soapMessage)
          throws XWSSecurityException
Throws:
XWSSecurityException

getEnvelope

public SOAPEnvelope getEnvelope()
                         throws XWSSecurityException
Throws:
XWSSecurityException

findWsseSecurityHeaderBlock

public SecurityHeader findWsseSecurityHeaderBlock(boolean doCreate,
                                                  boolean mustUnderstand)
                                           throws XWSSecurityException
Finds wsse:Security Header Block.

Parameters:
doCreate - create one if none exists
Returns:
wsse:Security header
Throws:
XWSSecurityException

findSecurityHeader

public SecurityHeader findSecurityHeader()
                                  throws XWSSecurityException
Finds wsse:Security Header

Returns:
returns null if wsse:Security header not found
Throws:
XWSSecurityException

findOrCreateSecurityHeader

public SecurityHeader findOrCreateSecurityHeader()
                                          throws XWSSecurityException
Finds or creates wsse:Security Header

Returns:
wsse:Security header
Throws:
XWSSecurityException

deleteSecurityHeader

public void deleteSecurityHeader()
Delete security header


resetMustUnderstandOnSecHeader

public void resetMustUnderstandOnSecHeader()
Make Security Header Non-MustUnderstand


generateSecurityHeaderException

public void generateSecurityHeaderException(String exceptionMessage)
                                     throws SecurityHeaderException,
                                            XWSSecurityException
Create and initialize a SecurityHeaderException, and throw a fault based on it. The faultstring for this exception is wsse:InvalidSecurity as per section 12 on Error Handling of the wss SOAPMessageSecurity spec (draft 17). This fault stands for An error was discovered processing the wsse:Security header.

Throws:
SecurityHeaderException
XWSSecurityException

newSOAPFaultException

public static WssSoapFaultException newSOAPFaultException(String faultstring,
                                                          Throwable th)
Create and initialize a WssSoapFaultException. This method is used in conjunction with generateClientFault.


newSOAPFaultException

public static WssSoapFaultException newSOAPFaultException(QName faultCode,
                                                          String faultstring,
                                                          Throwable th)
Create and initialize a WssSoapFaultException. This method is used in conjunction with generateClientFault.


generateFault

public void generateFault(WssSoapFaultException sfe)
                   throws XWSSecurityException
Parameters:
sfe -
Throws:
XWSSecurityException

getSOAPPart

public SOAPPart getSOAPPart()
Specified by:
getSOAPPart in class SOAPMessage

getSOAPBody

public SOAPBody getSOAPBody()
                     throws SOAPException
Overrides:
getSOAPBody in class SOAPMessage
Throws:
SOAPException

getSOAPMessage

public SOAPMessage getSOAPMessage()

setSOAPMessage

public void setSOAPMessage(SOAPMessage soapMsg)
                    throws XWSSecurityException
Throws:
XWSSecurityException

addAttachmentPart

public void addAttachmentPart(AttachmentPart AttachmentPart)
Specified by:
addAttachmentPart in class SOAPMessage

countAttachments

public int countAttachments()
Specified by:
countAttachments in class SOAPMessage

createAttachmentPart

public AttachmentPart createAttachmentPart()
Specified by:
createAttachmentPart in class SOAPMessage

createAttachmentPart

public AttachmentPart createAttachmentPart(Object content,
                                           String contentType)
Overrides:
createAttachmentPart in class SOAPMessage

createAttachmentPart

public AttachmentPart createAttachmentPart(DataHandler dataHandler)
Overrides:
createAttachmentPart in class SOAPMessage

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getAttachments

public Iterator getAttachments()
Specified by:
getAttachments in class SOAPMessage

getAttachments

public Iterator getAttachments(MimeHeaders headers)
Specified by:
getAttachments in class SOAPMessage

getContentDescription

public String getContentDescription()
Specified by:
getContentDescription in class SOAPMessage

getMimeHeaders

public MimeHeaders getMimeHeaders()
Specified by:
getMimeHeaders in class SOAPMessage

getProperty

public Object getProperty(String property)
                   throws SOAPException
Overrides:
getProperty in class SOAPMessage
Throws:
SOAPException

getSOAPHeader

public SOAPHeader getSOAPHeader()
                         throws SOAPException
Overrides:
getSOAPHeader in class SOAPMessage
Throws:
SOAPException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

removeAllAttachments

public void removeAllAttachments()
Specified by:
removeAllAttachments in class SOAPMessage

saveRequired

public boolean saveRequired()
Specified by:
saveRequired in class SOAPMessage

setContentDescription

public void setContentDescription(String description)
Specified by:
setContentDescription in class SOAPMessage

setProperty

public void setProperty(String property,
                        Object value)
                 throws SOAPException
Overrides:
setProperty in class SOAPMessage
Throws:
SOAPException

toString

public String toString()
Overrides:
toString in class Object

writeTo

public void writeTo(OutputStream out)
             throws SOAPException,
                    IOException
Specified by:
writeTo in class SOAPMessage
Throws:
SOAPException
IOException

saveChanges

public void saveChanges()
                 throws SOAPException
Specified by:
saveChanges in class SOAPMessage
Throws:
SOAPException

getNamespaceContext

public NamespaceContext getNamespaceContext()
                                     throws XWSSecurityException
Throws:
XWSSecurityException

generateId

public String generateId()
                  throws XWSSecurityException
Returns:
an ID unique w.r.t this SOAPMessage
Throws:
XWSSecurityException

generateWsuId

public void generateWsuId(Element element)
                   throws XWSSecurityException
Parameters:
element -
Throws:
XWSSecurityException

generateWsuId

public void generateWsuId(Element element,
                          String id)
                   throws XWSSecurityException
Parameters:
element -
id - ID specified should be unique in the message.
Throws:
XWSSecurityException

getElementByWsuId

public SOAPElement getElementByWsuId(String id)
                              throws XWSSecurityException
Throws:
XWSSecurityException

getElementById

public Element getElementById(String id)
                       throws XWSSecurityException
Throws:
XWSSecurityException

getAttachmentPart

public AttachmentPart getAttachmentPart(String uri)
                                 throws XWSSecurityException
Throws:
XWSSecurityException

getIdFromFragmentRef

public static String getIdFromFragmentRef(String ref)

getMessageParts

public Object getMessageParts(Target target)
                       throws XWSSecurityException
Throws:
XWSSecurityException

getAttachment

public AttachmentPart getAttachment(SOAPElement element)
                             throws SOAPException
Specified by:
getAttachment in class SOAPMessage
Throws:
SOAPException

removeAttachments

public void removeAttachments(MimeHeaders hdrs)
Specified by:
removeAttachments in class SOAPMessage

isOptimized

public boolean isOptimized()

setOptimized

public void setOptimized(boolean optimized)

setDoNotSetMU

public void setDoNotSetMU(boolean doNotSetMU)


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.