Package org.apache.cxf.ws.security.wss4j
Class AbstractWSS4JStaxInterceptor
- java.lang.Object
-
- org.apache.cxf.ws.security.wss4j.AbstractWSS4JStaxInterceptor
-
- All Implemented Interfaces:
org.apache.cxf.binding.soap.interceptor.SoapInterceptor,Interceptor<org.apache.cxf.binding.soap.SoapMessage>,PhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>
- Direct Known Subclasses:
WSS4JStaxInInterceptor,WSS4JStaxOutInterceptor
public abstract class AbstractWSS4JStaxInterceptor extends Object implements org.apache.cxf.binding.soap.interceptor.SoapInterceptor, PhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>
-
-
Constructor Summary
Constructors Constructor Description AbstractWSS4JStaxInterceptor()AbstractWSS4JStaxInterceptor(Map<String,Object> properties)AbstractWSS4JStaxInterceptor(WSSSecurityProperties securityProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigureCallbackHandler(org.apache.cxf.binding.soap.SoapMessage soapMessage, WSSSecurityProperties securityProperties)protected WSSSecurityPropertiescreateSecurityProperties()Collection<PhaseInterceptor<? extends Message>>getAdditionalInterceptors()Returns a collection of Interceptors that should be added to the chain whenever this interceptor is added.Set<String>getAfter()Returns a set containing the IDs of the interceptors that should be executed before this interceptor.Set<String>getBefore()Returns a set containing the IDs of the interceptors that should be executed after this interceptor.protected CryptogetEncryptionCrypto(Object e, org.apache.cxf.binding.soap.SoapMessage message, WSSSecurityProperties securityProperties)StringgetId()Returns the ID of this interceptor.ObjectgetOption(String key)protected StringgetPassword(Object msgContext)protected PasswordEncryptorgetPasswordEncryptor(org.apache.cxf.binding.soap.SoapMessage soapMessage, WSSSecurityProperties securityProperties)StringgetPhase()Returns the phase in which this interceptor is excecuted.Map<String,Object>getProperties()ObjectgetProperty(Object msgContext, String key)Set<URI>getRoles()protected CryptogetSignatureCrypto(Object s, org.apache.cxf.binding.soap.SoapMessage message, WSSSecurityProperties securityProperties)Set<QName>getUnderstoodHeaders()voidhandleFault(org.apache.cxf.binding.soap.SoapMessage message)Called for all interceptors (in reverse order) on which handleMessage had been successfully invoked, when normal execution of the chain was aborted for some reason.protected booleanisRequestor(org.apache.cxf.binding.soap.SoapMessage message)protected CryptoloadCrypto(org.apache.cxf.binding.soap.SoapMessage soapMessage, String cryptoPropertyFile, String cryptoPropertyRefId, WSSSecurityProperties securityProperties)Load a Crypto instance.protected CryptoloadCryptoFromPropertiesFile(org.apache.cxf.binding.soap.SoapMessage soapMessage, String propFilename, WSSSecurityProperties securityProperties)voidpostHandleMessage(org.apache.cxf.binding.soap.SoapMessage message)voidsetId(String id)voidsetPassword(Object msgContext, String password)voidsetPhase(String phase)voidsetProperty(Object msgContext, String key, Object value)protected voidtranslateProperties(org.apache.cxf.binding.soap.SoapMessage msg, WSSSecurityProperties securityProperties)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cxf.interceptor.Interceptor
handleMessage
-
-
-
-
Constructor Detail
-
AbstractWSS4JStaxInterceptor
public AbstractWSS4JStaxInterceptor(WSSSecurityProperties securityProperties)
-
AbstractWSS4JStaxInterceptor
public AbstractWSS4JStaxInterceptor()
-
-
Method Detail
-
createSecurityProperties
protected WSSSecurityProperties createSecurityProperties()
-
translateProperties
protected void translateProperties(org.apache.cxf.binding.soap.SoapMessage msg, WSSSecurityProperties securityProperties)
-
configureCallbackHandler
protected void configureCallbackHandler(org.apache.cxf.binding.soap.SoapMessage soapMessage, WSSSecurityProperties securityProperties) throws WSSecurityException- Throws:
WSSecurityException
-
getRoles
public Set<URI> getRoles()
- Specified by:
getRolesin interfaceorg.apache.cxf.binding.soap.interceptor.SoapInterceptor
-
handleFault
public void handleFault(org.apache.cxf.binding.soap.SoapMessage message)
Description copied from interface:InterceptorCalled for all interceptors (in reverse order) on which handleMessage had been successfully invoked, when normal execution of the chain was aborted for some reason.- Specified by:
handleFaultin interfaceInterceptor<org.apache.cxf.binding.soap.SoapMessage>
-
postHandleMessage
public void postHandleMessage(org.apache.cxf.binding.soap.SoapMessage message) throws Fault- Throws:
Fault
-
getAdditionalInterceptors
public Collection<PhaseInterceptor<? extends Message>> getAdditionalInterceptors()
Description copied from interface:PhaseInterceptorReturns a collection of Interceptors that should be added to the chain whenever this interceptor is added. May return null.- Specified by:
getAdditionalInterceptorsin interfacePhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>- Returns:
- the collection of interceptors
-
getPhase
public String getPhase()
Description copied from interface:PhaseInterceptorReturns the phase in which this interceptor is excecuted.- Specified by:
getPhasein interfacePhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>- Returns:
- the phase
-
setPhase
public void setPhase(String phase)
-
getId
public String getId()
Description copied from interface:PhaseInterceptorReturns the ID of this interceptor.- Specified by:
getIdin interfacePhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>- Returns:
- the ID
-
setId
public void setId(String id)
-
getUnderstoodHeaders
public Set<QName> getUnderstoodHeaders()
- Specified by:
getUnderstoodHeadersin interfaceorg.apache.cxf.binding.soap.interceptor.SoapInterceptor
-
getAfter
public Set<String> getAfter()
Description copied from interface:PhaseInterceptorReturns a set containing the IDs of the interceptors that should be executed before this interceptor. This interceptor will be placed in the chain after the interceptors in the set.- Specified by:
getAfterin interfacePhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>- Returns:
- the IDs of the interceptors
-
getBefore
public Set<String> getBefore()
Description copied from interface:PhaseInterceptorReturns a set containing the IDs of the interceptors that should be executed after this interceptor. This interceptor will be placed in the inteceptor chain before the interceptors in the set.- Specified by:
getBeforein interfacePhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>- Returns:
- the ids of the interceptors
-
isRequestor
protected boolean isRequestor(org.apache.cxf.binding.soap.SoapMessage message)
-
loadCrypto
protected Crypto loadCrypto(org.apache.cxf.binding.soap.SoapMessage soapMessage, String cryptoPropertyFile, String cryptoPropertyRefId, WSSSecurityProperties securityProperties) throws WSSecurityException
Load a Crypto instance. Firstly, it tries to use the cryptoPropertyRefId tag to retrieve a Crypto object via a custom reference Id. Failing this, it tries to load the crypto instance via the cryptoPropertyFile tag.- Throws:
WSSecurityException
-
loadCryptoFromPropertiesFile
protected Crypto loadCryptoFromPropertiesFile(org.apache.cxf.binding.soap.SoapMessage soapMessage, String propFilename, WSSSecurityProperties securityProperties) throws WSSecurityException
- Throws:
WSSecurityException
-
getPasswordEncryptor
protected PasswordEncryptor getPasswordEncryptor(org.apache.cxf.binding.soap.SoapMessage soapMessage, WSSSecurityProperties securityProperties)
-
getEncryptionCrypto
protected Crypto getEncryptionCrypto(Object e, org.apache.cxf.binding.soap.SoapMessage message, WSSSecurityProperties securityProperties) throws WSSecurityException
- Throws:
WSSecurityException
-
getSignatureCrypto
protected Crypto getSignatureCrypto(Object s, org.apache.cxf.binding.soap.SoapMessage message, WSSSecurityProperties securityProperties) throws WSSecurityException
- Throws:
WSSecurityException
-
-