Interface SnapshotTokenHandler


  • public interface SnapshotTokenHandler
    Responsible for the validation, generation and parsing of snapshot tokens used for keying a snapshot of some state.
    Since:
    0.1.0
    • Method Detail

      • generate

        String generate​(org.forgerock.json.JsonValue state)
                 throws org.forgerock.json.resource.ResourceException
        Generates a new snapshot token using the state.
        Parameters:
        state - the state
        Returns:
        snapshot token
        Throws:
        org.forgerock.json.resource.ResourceException - thrown should some issue occur creating the snapshot token
      • validate

        void validate​(String snapshotToken)
               throws org.forgerock.json.resource.ResourceException
        Validates the passed snapshot token.
        Parameters:
        snapshotToken - the snapshot token to be validated
        Throws:
        org.forgerock.json.resource.ResourceException - thrown should some issue be found with the token
      • validateAndExtractState

        org.forgerock.json.JsonValue validateAndExtractState​(String snapshotToken)
                                                      throws org.forgerock.json.resource.ResourceException
        Validates and parses the token, extracting any encapsulated state.
        Parameters:
        snapshotToken - the snapshot token to be validated and parsed
        Returns:
        the state
        Throws:
        org.forgerock.json.resource.ResourceException - thrown should some issue be found with the token