Class NTLMMediator
- java.lang.Object
-
- org.apache.synapse.mediators.AbstractMediator
-
- org.apache.synapse.mediators.builtin.NTLMMediator
-
- All Implemented Interfaces:
AspectConfigurable
,ManagedLifecycle
,Mediator
,SynapseArtifact
public class NTLMMediator extends AbstractMediator implements ManagedLifecycle
NTLM Mediator mainly creates an authenticator with the credentials which user provides as parameters. Required authentication params are username, password, host, domain and NTLM version. Created authenticator authenticator is set to the MessageContext as _NTLM_DIGEST_BASIC_AUTHENTICATION_ property (HTTPConstants.AUTHENTICATE). Further this Reads the MultiThreadedHttpConnectionManager from the cache and set it to the Axis2MessageContext as MULTITHREAD_HTTP_CONNECTION_MANAGER property. After NTLM mediator authenticates properly user can use callout mediator or call mediator with blocking=true to send the payload to backend. In order to persist the authenticator through out the call and callout mediators please use initAxis2ClientOptions="false" parameter in call and callout mediators.
-
-
Field Summary
-
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
trace, traceState
-
-
Constructor Summary
Constructors Constructor Description NTLMMediator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
This method should implement the destroying of the implemented parts of the configuration.String
getDomain()
String
getHost()
String
getNtlmVersion()
String
getPassword()
String
getUsername()
void
init(SynapseEnvironment synapseEnvironment)
When init have to set the NTLM Custom Authenticator as auth scheme and set jcifs encoding to ASCII.boolean
mediate(MessageContext messageContext)
Invokes the mediator passing the current message for mediation.void
setDomain(String domain)
void
setDynamicDomain(Value dynamicDomain)
void
setDynamicHost(Value dynamicHost)
void
setDynamicNtmlVersion(Value dynamicNtmlVersion)
void
setDynamicPassword(Value dynamicPassword)
void
setDynamicUsername(Value dynamicUsername)
void
setHost(String host)
void
setNtlmVersion(String ntlmVersion)
void
setPassword(String password)
void
setUsername(String username)
-
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, configure, disableStatistics, disableTracing, divertMediationRoute, enableStatistics, enableTracing, getAspectConfiguration, getCommentsList, getDescription, getInputType, getLastSequenceFaultHandler, getLog, getMediatorName, getMediatorPosition, getOutputType, getRegisteredMediationFlowPoint, getShortDescription, getTraceState, getType, handleException, handleException, isBreakPoint, isContentAltering, isContentAware, isSkipEnabled, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, isTracingEnabled, registerMediationFlowPoint, reportCloseStatistics, reportOpenStatistics, setBreakPoint, setCommentsList, setComponentStatisticsId, setDescription, setEffectiveTraceState, setMediatorPosition, setShortDescription, setSkipEnabled, setTraceState, shouldCaptureTracing, shouldTrace, shouldTrace, traceOrDebug, traceOrDebugWarn, unregisterMediationFlowPoint
-
-
-
-
Method Detail
-
mediate
public boolean mediate(MessageContext messageContext)
Description copied from interface:Mediator
Invokes the mediator passing the current message for mediation. Each mediator performs its mediation action, and returns true if mediation should continue, or false if further mediation should be aborted.
-
init
public void init(SynapseEnvironment synapseEnvironment)
When init have to set the NTLM Custom Authenticator as auth scheme and set jcifs encoding to ASCII.- Specified by:
init
in interfaceManagedLifecycle
- Parameters:
synapseEnvironment
- SynapseEnvironment to be used for initialization
-
destroy
public void destroy()
Description copied from interface:ManagedLifecycle
This method should implement the destroying of the implemented parts of the configuration.- Specified by:
destroy
in interfaceManagedLifecycle
-
getUsername
public String getUsername()
-
setUsername
public void setUsername(String username)
-
getPassword
public String getPassword()
-
setPassword
public void setPassword(String password)
-
getHost
public String getHost()
-
setHost
public void setHost(String host)
-
getDomain
public String getDomain()
-
setDomain
public void setDomain(String domain)
-
getNtlmVersion
public String getNtlmVersion()
-
setNtlmVersion
public void setNtlmVersion(String ntlmVersion)
-
setDynamicUsername
public void setDynamicUsername(Value dynamicUsername)
-
setDynamicPassword
public void setDynamicPassword(Value dynamicPassword)
-
setDynamicHost
public void setDynamicHost(Value dynamicHost)
-
setDynamicDomain
public void setDynamicDomain(Value dynamicDomain)
-
setDynamicNtmlVersion
public void setDynamicNtmlVersion(Value dynamicNtmlVersion)
-
-