public class GLoginBinding extends Object implements OutboundBinding<GLoginEndpoint,GLoginData,GLoginData>
GLoginData
to a Camel Exchange
.Modifier and Type | Field and Description |
---|---|
static String |
GLOGIN_COOKIE
Name of the Camel header containing the resulting authorization cookie.
|
static String |
GLOGIN_HOST_NAME
Name of the Camel header defining the host name.
|
static String |
GLOGIN_PASSWORD
Name of the Camel header defining the login password.
|
static String |
GLOGIN_TOKEN
Name of the Camel header containing the resulting authentication token.
|
static String |
GLOGIN_USER_NAME
Name of the Camel header defining the login username.
|
Constructor and Description |
---|
GLoginBinding() |
Modifier and Type | Method and Description |
---|---|
org.apache.camel.Exchange |
readResponse(GLoginEndpoint endpoint,
org.apache.camel.Exchange exchange,
GLoginData response)
Creates an
exchange.getOut() message with a
GLOGIN_TOKEN header containing an authentication token and a
GLOGIN_COOKIE header containing an authorization cookie. |
GLoginData |
writeRequest(GLoginEndpoint endpoint,
org.apache.camel.Exchange exchange,
GLoginData request)
Creates a
GLoginData object from endpoint and
exchange.getIn() header data. |
public static final String GLOGIN_HOST_NAME
GLoginEndpoint.getHostName()
.public static final String GLOGIN_USER_NAME
GLoginEndpoint.getUserName()
.public static final String GLOGIN_PASSWORD
GLoginEndpoint.getPassword()
.public static final String GLOGIN_TOKEN
public static final String GLOGIN_COOKIE
public GLoginData writeRequest(GLoginEndpoint endpoint, org.apache.camel.Exchange exchange, GLoginData request)
GLoginData
object from endpoint and
exchange.getIn()
header data. The created object is used to
obtain an authentication token and an authorization cookie.writeRequest
in interface OutboundBinding<GLoginEndpoint,GLoginData,GLoginData>
endpoint
- endpoint providing binding-relevant information.exchange
- exchange to read data from.request
- request to be populated or created (if null
) from exchange data.public org.apache.camel.Exchange readResponse(GLoginEndpoint endpoint, org.apache.camel.Exchange exchange, GLoginData response) throws Exception
exchange.getOut()
message with a
GLOGIN_TOKEN
header containing an authentication token and a
GLOGIN_COOKIE
header containing an authorization cookie. If the
endpoint is configured to run in development mode, no authentication
token will be set, only an authorization cookie.readResponse
in interface OutboundBinding<GLoginEndpoint,GLoginData,GLoginData>
endpoint
- endpoint providing binding-relevant information.exchange
- exchange to be populated or created (if null
) from response data.response
- response to read data from.Exception
Apache Camel