public abstract class

BaseWorkflowListener

extends Object
implements InteractiveListener<T, U, V>
java.lang.Object
   ↳ com.amazon.identity.auth.device.workflow.BaseWorkflowListener<T, U, V>

Class Overview

To create your own interactive workflow, extend this listener and implement all abstract methods besides onSuccess, onCancel, and onError (which will be implemented by the app developer). On successful completion of a workflow, you will receive a JSON object containing the arbitrary data returned from your server-side runtime workflow.{@since 3.0 }

Summary

Public Constructors
BaseWorkflowListener()
Public Methods
final void onRequestCancel(Context context, InteractiveRequestRecord request, WorkflowCancellation cancellation)
This method is implemented to delegate interactive responses to your implementation of the onWorkflow* methods.
final void onRequestCompletion(Context context, InteractiveRequestRecord request, Uri uri)
This method is implemented to delegate interactive responses to your implementation of the onWorkflow* methods.
final void onRequestError(Context context, InteractiveRequestRecord request, Exception e)
This method is implemented to delegate interactive responses to your implementation of the onWorkflow* methods.
Protected Methods
abstract void onWorkflowCancel(Context context, InteractiveRequestRecord requestRecord, WorkflowCancellation cancellation)
Called on when an interactive workflow has been cancelled and cannot be resumed.
abstract void onWorkflowError(Context context, InteractiveRequestRecord requestRecord, Exception exception)
Called upon failure of the interactive workflow.
abstract void onWorkflowSuccess(Context context, InteractiveRequestRecord requestRecord, JSONObject result)
Called on successful completion of your workflow.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.amazon.identity.auth.device.api.CancellableListener
From interface com.amazon.identity.auth.device.api.Listener
From interface com.amazon.identity.auth.device.interactive.InteractiveAPI
From interface com.amazon.identity.auth.device.interactive.InteractiveListener

Public Constructors

public BaseWorkflowListener ()

Public Methods

public final void onRequestCancel (Context context, InteractiveRequestRecord request, WorkflowCancellation cancellation)

This method is implemented to delegate interactive responses to your implementation of the onWorkflow* methods.

public final void onRequestCompletion (Context context, InteractiveRequestRecord request, Uri uri)

This method is implemented to delegate interactive responses to your implementation of the onWorkflow* methods.

public final void onRequestError (Context context, InteractiveRequestRecord request, Exception e)

This method is implemented to delegate interactive responses to your implementation of the onWorkflow* methods.

Protected Methods

protected abstract void onWorkflowCancel (Context context, InteractiveRequestRecord requestRecord, WorkflowCancellation cancellation)

Called on when an interactive workflow has been cancelled and cannot be resumed. When the workflow is rendered in the native browser, it cannot be known if the workflow is cancelled.{@since 3.0 }

Parameters
context The current Android Context.
cancellation Describes the cancellation.

protected abstract void onWorkflowError (Context context, InteractiveRequestRecord requestRecord, Exception exception)

Called upon failure of the interactive workflow. The implementation of this should call onError(U), passing the wrapped exception if desired/necessary.

Will be called for the following errors:

If the APIKey or workflowToken is incorrect, ERROR_ACCESS_DENIED will be returned.

Any other possible errors will be encapsulated in a ERROR_SERVER_REPSONSE.{@since 3.0 }

Parameters
context The current Android Context.
exception The error that occurred.

protected abstract void onWorkflowSuccess (Context context, InteractiveRequestRecord requestRecord, JSONObject result)

Called on successful completion of your workflow. Implement this and call the appropriate developer-facing listener method.{@since 3.0 }

Parameters
context The current Android Context.
result The arbitrary data returned by your workflow.