Package org.forgerock.android.auth
Class Node
- java.lang.Object
-
- org.forgerock.android.auth.Node
-
- All Implemented Interfaces:
java.io.Serializable
public class Node extends java.lang.Object implements java.io.Serializable- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAUTH_IDstatic java.lang.StringDESCRIPTIONstatic java.lang.StringHEADERstatic java.lang.StringSTAGE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAuthId()java.lang.StringgetAuthServiceId()<T> TgetCallback(java.lang.Class<T> clazz)Find the first match Callback with the provided Class.java.util.List<Callback>getCallbacks()java.lang.StringgetDescription()java.lang.StringgetHeader()java.lang.StringgetStage()voidnext(android.content.Context context, NodeListener<?> listener)Move on to the next node in the tree.voidsetCallback(Callback callback)Sets theCallbackobject for theAuthServicenode.
-
-
-
Field Detail
-
AUTH_ID
public static final java.lang.String AUTH_ID
- See Also:
- Constant Field Values
-
STAGE
public static final java.lang.String STAGE
- See Also:
- Constant Field Values
-
HEADER
public static final java.lang.String HEADER
- See Also:
- Constant Field Values
-
DESCRIPTION
public static final java.lang.String DESCRIPTION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Node
public Node(java.lang.String authId, java.lang.String stage, java.lang.String header, java.lang.String description, java.lang.String authServiceId, java.util.List<Callback> callbacks)
-
-
Method Detail
-
getCallback
public <T> T getCallback(java.lang.Class<T> clazz)
Find the first match Callback with the provided Class. Returns null if not found.- Type Parameters:
T- The Callback Type- Parameters:
clazz- The Callback Class- Returns:
- The Callback instance
-
getCallbacks
public java.util.List<Callback> getCallbacks()
-
next
public void next(android.content.Context context, NodeListener<?> listener)Move on to the next node in the tree.- Parameters:
context- The Application Contextlistener- Listener for receivingAuthServicerelated changesFRListener.onSuccess(Object)on success login.NodeListener.onCallbackReceived(Node)step to the next node,Nodeis returned. throwsIllegalStateExceptionwhen the tree is invalid, e.g the authentication tree has been completed. throwsAuthenticationExceptionwhen server returnsHttpURLConnection.HTTP_UNAUTHORIZEDthrowsApiExceptionWhen server return errors. throwsUnsupportedCallbackExceptionWhenCallbackreturned from Server is not supported by the SDK. throwsSuspendedAuthSessionExceptionWhen Suspended ID timeout throwsAuthenticationTimeoutExceptionWhen Authentication tree timeout throwsJSONExceptionwhen failed to parse server response as JSON String. throwsIOExceptionWhen there is any network error. throwsMalformedURLExceptionWhen failed to parse the URL for API request. throwsNoSuchMethodExceptionorSecurityExceptionWhen failed to initialize the Callback class.
-
setCallback
public void setCallback(Callback callback)
Sets theCallbackobject for theAuthServicenode.- Parameters:
callback- Callback Object with the new state.
-
getAuthId
public java.lang.String getAuthId()
-
getStage
public java.lang.String getStage()
-
getHeader
public java.lang.String getHeader()
-
getDescription
public java.lang.String getDescription()
-
getAuthServiceId
public java.lang.String getAuthServiceId()
-
-