Interface NodeListener<T>

    • Field Detail

      • TAG

        static final java.lang.String TAG
    • Method Detail

      • onCallbackReceived

        void onCallbackReceived​(Node node)
        Notify the listener that the AuthService has been started and moved to the first node.
        Parameters:
        node - The first Node
      • onCallbackReceived

        default Node onCallbackReceived​(java.lang.String authServiceId,
                                        org.json.JSONObject response)
                                 throws java.lang.Exception
        Transform the response from AM Intelligent Tree to Node Object, after the transformation onCallbackReceived(Node) will be invoked with the returned Node.
        Parameters:
        authServiceId - Unique Auth Service Id
        response - The JSON Response from AM Intelligent Tree
        Returns:
        The Node Object
        Throws:
        java.lang.Exception - Any error during the transformation
      • parseCallback

        default java.util.List<Callback> parseCallback​(org.json.JSONArray jsonArray)
                                                throws java.lang.Exception
        Parse the JSON Array callback response from AM, and transform to Callback instances.
        Parameters:
        jsonArray - The JSON Array callback response from AM
        Returns:
        A List of Callback Object
        Throws:
        java.lang.Exception - Any error during the transformation
      • getStage

        default java.lang.String getStage​(java.util.List<Callback> callbacks)
        Workaround stage property for AM version < 7.0. https://github.com/jaredjensen/forgerock-sdk-blog/blob/master/auth_tree_stage.md
        Parameters:
        callbacks - Callback from Intelligent Tree
        Returns:
        stage or null if not found.