Class 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.String AUTH_ID  
      static java.lang.String DESCRIPTION  
      static java.lang.String HEADER  
      static java.lang.String STAGE  
    • Constructor Summary

      Constructors 
      Constructor Description
      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)  
    • 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 Context
        listener - Listener for receiving AuthService related changes FRListener.onSuccess(Object) on success login. NodeListener.onCallbackReceived(Node) step to the next node, Node is returned. throws IllegalStateException when the tree is invalid, e.g the authentication tree has been completed. throws AuthenticationException when server returns HttpURLConnection.HTTP_UNAUTHORIZED throws ApiException When server return errors. throws UnsupportedCallbackException When Callback returned from Server is not supported by the SDK. throws SuspendedAuthSessionException When Suspended ID timeout throws AuthenticationTimeoutException When Authentication tree timeout throws JSONException when failed to parse server response as JSON String. throws IOException When there is any network error. throws MalformedURLException When failed to parse the URL for API request. throws NoSuchMethodException or SecurityException When failed to initialize the Callback class.
      • setCallback

        public void setCallback​(Callback callback)
        Sets the Callback object for the AuthService node.
        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()