Interface CoreTokenStore

  • All Known Implementing Classes:
    OpenSSOCoreTokenStore

    public interface CoreTokenStore
    This CoreTokenStore interface defines methods for managing resources of the OpenSSO Core Token service.
    • Method Detail

      • createToken

        String createToken​(Subject subject,
                           org.json.JSONObject attributes)
                    throws CoreTokenException,
                           org.json.JSONException
        Creates a token.
        Parameters:
        subject - Subject of the caller.
        attributes - Attributes of the token to be created.
        Returns:
        JSON-encoded token.id attribute.
        Throws:
        CoreTokenException - if failed to create the token.
        org.json.JSONException - if failed to parse the JSON-encoded token attributes.
      • readToken

        String readToken​(Subject subject,
                         String tokenId)
                  throws CoreTokenException
        Reads token attributes.
        Parameters:
        subject - Subject of the caller.
        tokenId - token.id of the token to be retrieved.
        Returns:
        JSON-encoded token attributes.
        Throws:
        CoreTokenException - if failed to read the token.
      • deleteToken

        void deleteToken​(Subject subject,
                         String tokenId)
                  throws CoreTokenException
        Deletes a token.
        Parameters:
        subject - Subject of the caller
        tokenId - token.id of the token to be deleted.
        Throws:
        CoreTokenException - if failed to delete the token.
        org.json.JSONException - if failed to parse the JSON-encoded token attributes.
      • searchTokens

        org.json.JSONArray searchTokens​(Subject subject,
                                        String queryString)
                                 throws CoreTokenException
        Searches tokens.
        Parameters:
        subject - Subject of the caller
        queryString - HTTP query string.
        Returns:
        JSON array of token.id values for resources that match the query. May be empty.
        Throws:
        CoreTokenException
      • updateToken

        void updateToken​(Subject subject,
                         String tokenId,
                         String eTag,
                         org.json.JSONObject newVals)
                  throws CoreTokenException,
                         org.json.JSONException
        Updates a token.
        Parameters:
        subject - caller subject.
        tokenId - token.id of the token to be updated.
        eTag - etag attribute value, this must match that presents in the the token to be updated.
        newVals - attributes to be updated.
        Throws:
        CoreTokenException - if failed to update the token.
        org.json.JSONException - if failed to parse the JSON-encoded attributes.