Package com.sun.xml.wss
Class ProcessingContext
- java.lang.Object
-
- com.sun.xml.wss.ProcessingContext
-
- All Implemented Interfaces:
SecurityProcessingContext
- Direct Known Subclasses:
ProcessingContextImpl
public class ProcessingContext extends Object implements SecurityProcessingContext
This class represents a Context that is used by the XWS-Security Runtime to apply/verify Security Policies on an Outgoing/Incoming SOAP Message. The context contains among other things- The SOAP Message to be operated upon
- The Message direction (incoming or outgoing)
- The security policy to be applied by XWS-Security on the message
- A randomly generated Message-Identifier that can be used for request-response correlation,
by a CallbackHandler, the handles
DynamicPolicyCallback - A list of properties associated with the calling Application Runtime, that can be used to make Dynamic Policy decisions.
- A concrete implementation of the SecurityEnvironment interface OR a CallbackHandler
-
-
Field Summary
Fields Modifier and Type Field Description static StringOPERATION_RESOLVERprotected Mappropertiesprotected SecurableSoapMessagesecureMessageprotected MessageLayoutsecurityHeaderLayout
-
Constructor Summary
Constructors Constructor Description ProcessingContext()Default constructorProcessingContext(StaticPolicyContext context, SecurityPolicy securityPolicy, jakarta.xml.soap.SOAPMessage message)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopy(ProcessingContext ctx1, ProcessingContext ctx2)copy operatorvoidcopy(SecurityProcessingContext ctx1, SecurityProcessingContext ctx2)copy operatorstatic voidcopy(Map p1, Map p2)intgetConfigType()This method is used for internal purposesMapgetExtraneousProperties()Properties extraneously defined by XWSS runtime - can contain application's runtime context (like JAXRPCContext etc)ObjectgetExtraneousProperty(String name)CallbackHandlergetHandler()StringgetMessageIdentifier()StaticPolicyContextgetPolicyContext()protected SecurableSoapMessagegetSecureMessage()SecurityEnvironmentgetSecurityEnvironment()MessageLayoutgetSecurityHeaderLayout()SecurityPolicygetSecurityPolicy()jakarta.xml.soap.SOAPMessagegetSOAPMessage()booleanisClient()voidisClient(boolean isClient)booleanisExpired()voidisExpired(boolean value)booleanisInboundMessage()voidisInboundMessage(boolean inBound)set the message flow direction (to true if inbound, false if outbound)voidremoveExtraneousProperty(String name)remove the named extraneous property if presentvoidreset()This method is used for internal purposesbooleanresetMustUnderstand()voidresetMustUnderstand(boolean b)booleanretainSecurityHeader()voidretainSecurityHeader(boolean arg)voidsetConfigType(int type)This method is used for internal purposesvoidsetExtraneousProperty(String name, Object value)set the extraneous property into the context Extraneous Properties are properties extraneously defined by XWSS runtime and can contain application's runtime context (like JAXRPCContext etc)voidsetHandler(CallbackHandler handler)set the CallbackHandler for the contextvoidsetMessageIdentifier(String identifier)Allow for message identifier to be generated externallyvoidsetPolicyContext(StaticPolicyContext context)set the StaticPolicyContext for this ProcessingContext.protected voidsetSecureMessage(SecurableSoapMessage msg)voidsetSecurityEnvironment(SecurityEnvironment handler)set the SecurityEnvironment Handler for the contextvoidsetSecurityHeaderLayout(MessageLayout layout)voidsetSecurityPolicy(SecurityPolicy securityPolicy)set the SecurityPolicy for the contextvoidsetSOAPMessage(jakarta.xml.soap.SOAPMessage message)set the SOAP Message into the ProcessingContext.
-
-
-
Field Detail
-
secureMessage
protected SecurableSoapMessage secureMessage
-
properties
protected Map properties
-
securityHeaderLayout
protected MessageLayout securityHeaderLayout
-
OPERATION_RESOLVER
public static final String OPERATION_RESOLVER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProcessingContext
public ProcessingContext()
Default constructor
-
ProcessingContext
public ProcessingContext(StaticPolicyContext context, SecurityPolicy securityPolicy, jakarta.xml.soap.SOAPMessage message) throws XWSSecurityException
Constructor- Parameters:
context- the static policy context for this requestsecurityPolicy- the SecurityPolicy to be applied for this requestmessage- the SOAPMessage- Throws:
XWSSecurityException- if there was an error in creating the ProcessingContext
-
-
Method Detail
-
resetMustUnderstand
public void resetMustUnderstand(boolean b)
-
resetMustUnderstand
public boolean resetMustUnderstand()
-
setSecurityPolicy
public void setSecurityPolicy(SecurityPolicy securityPolicy) throws XWSSecurityException
set the SecurityPolicy for the context- Specified by:
setSecurityPolicyin interfaceSecurityProcessingContext- Parameters:
securityPolicy- SecurityPolicy- Throws:
XWSSecurityException- if the securityPolicy is of invalid type
-
getSecurityPolicy
public SecurityPolicy getSecurityPolicy()
- Specified by:
getSecurityPolicyin interfaceSecurityProcessingContext- Returns:
- SecurityPolicy for this context
-
setPolicyContext
public void setPolicyContext(StaticPolicyContext context)
set the StaticPolicyContext for this ProcessingContext.- Specified by:
setPolicyContextin interfaceSecurityProcessingContext- Parameters:
context- StaticPolicyContext for this context
-
getPolicyContext
public StaticPolicyContext getPolicyContext()
- Specified by:
getPolicyContextin interfaceSecurityProcessingContext- Returns:
- StaticPolicyContext associated with this ProcessingContext, null otherwise
-
setSOAPMessage
public void setSOAPMessage(jakarta.xml.soap.SOAPMessage message) throws XWSSecurityExceptionset the SOAP Message into the ProcessingContext.- Specified by:
setSOAPMessagein interfaceSecurityProcessingContext- Parameters:
message- SOAPMessage- Throws:
XWSSecurityException- if there was an error in setting the SOAPMessage
-
getSOAPMessage
public jakarta.xml.soap.SOAPMessage getSOAPMessage()
- Specified by:
getSOAPMessagein interfaceSecurityProcessingContext- Returns:
- the SOAPMessage from the context
-
setHandler
public void setHandler(CallbackHandler handler)
set the CallbackHandler for the context- Specified by:
setHandlerin interfaceSecurityProcessingContext- Parameters:
handler- The CallbackHandler
-
setSecurityEnvironment
public void setSecurityEnvironment(SecurityEnvironment handler)
set the SecurityEnvironment Handler for the context- Specified by:
setSecurityEnvironmentin interfaceSecurityProcessingContext- Parameters:
handler- The SecurityEnvironment Handler
-
getHandler
public CallbackHandler getHandler()
- Specified by:
getHandlerin interfaceSecurityProcessingContext- Returns:
- the CallbackHandler set for the context
-
getSecurityEnvironment
public SecurityEnvironment getSecurityEnvironment()
- Specified by:
getSecurityEnvironmentin interfaceSecurityProcessingContext- Returns:
- The SecurityEnvironment Handler set for the context
-
getExtraneousProperties
public Map getExtraneousProperties()
Properties extraneously defined by XWSS runtime - can contain application's runtime context (like JAXRPCContext etc)- Specified by:
getExtraneousPropertiesin interfaceSecurityProcessingContext- Returns:
- Map of extraneous properties
-
isInboundMessage
public void isInboundMessage(boolean inBound)
set the message flow direction (to true if inbound, false if outbound)- Specified by:
isInboundMessagein interfaceSecurityProcessingContext- Parameters:
inBound- message flow direction
-
isInboundMessage
public boolean isInboundMessage()
- Specified by:
isInboundMessagein interfaceSecurityProcessingContext- Returns:
- message flow direction, true if incoming, false otherwise
-
setMessageIdentifier
public void setMessageIdentifier(String identifier)
Allow for message identifier to be generated externally- Specified by:
setMessageIdentifierin interfaceSecurityProcessingContext- Parameters:
identifier- the Message Identifier value
-
getMessageIdentifier
public String getMessageIdentifier()
- Specified by:
getMessageIdentifierin interfaceSecurityProcessingContext- Returns:
- message identifier for the Message in the context
-
setExtraneousProperty
public void setExtraneousProperty(String name, Object value)
set the extraneous property into the context Extraneous Properties are properties extraneously defined by XWSS runtime and can contain application's runtime context (like JAXRPCContext etc)- Specified by:
setExtraneousPropertyin interfaceSecurityProcessingContext- Parameters:
name- the property namevalue- the property value
-
getExtraneousProperty
public Object getExtraneousProperty(String name)
- Specified by:
getExtraneousPropertyin interfaceSecurityProcessingContext- Returns:
- the value for the named extraneous property.
-
removeExtraneousProperty
public void removeExtraneousProperty(String name)
remove the named extraneous property if present- Specified by:
removeExtraneousPropertyin interfaceSecurityProcessingContext- Parameters:
name- the Extraneous Property to be removed
-
copy
public void copy(ProcessingContext ctx1, ProcessingContext ctx2) throws XWSSecurityException
copy operator- Parameters:
ctx1- the ProcessingContext to which to copyctx2- the ProcessingContext from which to copy- Throws:
XWSSecurityException- if there was an error during the copy operation
-
reset
public void reset()
This method is used for internal purposes- Specified by:
resetin interfaceSecurityProcessingContext
-
getConfigType
public int getConfigType()
This method is used for internal purposes- Specified by:
getConfigTypein interfaceSecurityProcessingContext
-
setConfigType
public void setConfigType(int type)
This method is used for internal purposes- Specified by:
setConfigTypein interfaceSecurityProcessingContext
-
getSecureMessage
protected SecurableSoapMessage getSecureMessage()
-
setSecureMessage
protected void setSecureMessage(SecurableSoapMessage msg)
-
copy
public void copy(SecurityProcessingContext ctx1, SecurityProcessingContext ctx2) throws XWSSecurityException
Description copied from interface:SecurityProcessingContextcopy operator- Specified by:
copyin interfaceSecurityProcessingContext- Parameters:
ctx1- the ProcessingContext to which to copyctx2- the ProcessingContext from which to copy- Throws:
XWSSecurityException- if there was an error during the copy operation
-
setSecurityHeaderLayout
public void setSecurityHeaderLayout(MessageLayout layout)
-
getSecurityHeaderLayout
public MessageLayout getSecurityHeaderLayout()
-
retainSecurityHeader
public boolean retainSecurityHeader()
-
retainSecurityHeader
public void retainSecurityHeader(boolean arg)
-
isClient
public void isClient(boolean isClient)
-
isClient
public boolean isClient()
-
isExpired
public boolean isExpired()
-
isExpired
public void isExpired(boolean value)
-
-