public class DefaultHttpAuthentication extends Object implements HttpAuthentication, MuleContextAware, Initialisable
PHASE_NAME
Constructor and Description |
---|
DefaultHttpAuthentication(HttpAuthenticationType type) |
Modifier and Type | Method and Description |
---|---|
void |
authenticate(MuleEvent muleEvent,
HttpRequestBuilder requestBuilder)
Adds authentication information to the request.
|
String |
getDomain() |
String |
getPassword() |
String |
getPreemptive() |
HttpAuthenticationType |
getType() |
String |
getUsername() |
String |
getWorkstation() |
void |
initialise()
Method used to perform any initialisation work.
|
HttpRequestAuthentication |
resolveRequestAuthentication(MuleEvent event) |
void |
setDomain(String domain) |
void |
setMuleContext(MuleContext muleContext) |
void |
setPassword(String password) |
void |
setPreemptive(String preemptive) |
void |
setUsername(String username) |
void |
setWorkstation(String workstation) |
boolean |
shouldRetry(MuleEvent firstAttemptResponseEvent)
Detects if there was an authentication failure in the response.
|
public DefaultHttpAuthentication(HttpAuthenticationType type)
public void initialise() throws InitialisationException
Initialisable
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.initialise
in interface Initialisable
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdownRecoverableException
- if an error occurs that can be recovered frompublic String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
public String getDomain()
public void setDomain(String domain)
public HttpAuthenticationType getType()
public String getWorkstation()
public void setWorkstation(String workstation)
public String getPreemptive()
public void setPreemptive(String preemptive)
public void setMuleContext(MuleContext muleContext)
setMuleContext
in interface MuleContextAware
public HttpRequestAuthentication resolveRequestAuthentication(MuleEvent event)
public void authenticate(MuleEvent muleEvent, HttpRequestBuilder requestBuilder)
HttpAuthentication
authenticate
in interface HttpAuthentication
muleEvent
- The event that is being processed.requestBuilder
- The builder that is being used to create the HTTP request.public boolean shouldRetry(MuleEvent firstAttemptResponseEvent)
HttpAuthentication
shouldRetry
in interface HttpAuthentication
firstAttemptResponseEvent
- The event with the response of the request.Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.