public interface WLResponseListener
WLClient
and GatewayChallengeHandler
.
WLClient.invokeProcedure(WLProcedureInvocationData, WLResponseListener)
implements to receive notifications about the success or failure of the method call.Modifier and Type | Method and Description |
---|---|
void |
onFailure(WLFailResponse response)
Called if any failure occurred during the execution of the
WLClient.invokeProcedure(WLProcedureInvocationData, WLResponseListener) . |
void |
onSuccess(WLResponse response)
Called following successful calls to the
WLClient.invokeProcedure(WLProcedureInvocationData, WLResponseListener) . |
void onSuccess(WLResponse response)
WLClient.invokeProcedure(WLProcedureInvocationData, WLResponseListener)
.
This method is also the success delegate for GatewayChallengeHandler#submitLoginForm(String, Map, Map, int, String)
or
For GatewayChallengeHandler
, this method is called when a successful HTTP response is received (200 OK). This method does not indicate whether the challenge
was successful or not. A 200 HTTP response can flow back indicating problems with authentication on the server or requesting additional information. Some examples of a 200 HTTP response are as
follows:
Note: MobileFirst Platform does not attempt to determine what the 200 response means. This is a good place to check whether the response is a custom response and handle it accordingly.
If the response is not a custom response, you can call submitSuccess
to indicate that everything is OK from your challenge handler's perspective, and that the
MobileFirst Platform can handle the response instead.
response
- Response that the server returns, along with any invocation context object and status.void onFailure(WLFailResponse response)
WLClient.invokeProcedure(WLProcedureInvocationData, WLResponseListener)
.
This method is the failure delegate for GatewayChallengeHandler#submitLoginForm(java.lang.String requestURL, java.util.Map requestParameters,
java.util.Map requestHeaders, int requestTimeoutInMilliseconds, java.lang.String requestMethod)
or
For GatewayChallengeHandler
, this method is called when a response does not have a 200 HTTP status code. This method does not indicate whether the challenge
was successful or not. In some cases onFailure
is an indication of a normal challenge handling sequence. An example of when the onFailure
method is called is when a 401 unauthorized response is received.
A successful handshake can entail several 401 response iterations and therefore several onFailure
calls. This behavior is all part of the normal handshake between two parties that are trying to establish identity.
MobileFirst Platform handles the handshakes for core challenges iteratively until all of the credentials are established and the necessary challenges are processed. This is a good place to check whether the response is a
custom response and handle it accordingly. If the response is not a custom response, you can call submitSuccess
to indicate that everything is OK from your challenge handler's perspective,
and that MobileFirst Platform can handle the response instead.
response
- Response that contains the error code and error message. Optionally, it can also contain the results from the server and any invocation context object and status.