Interface AuthorizationProvider

All Known Implementing Classes:
SignatureProvider, StoreAccessTokenProvider

public interface AuthorizationProvider
A callback interface used by the driver to obtain an authorization string for a request. NoSQLHandle calls this interface when and authorization string is required. In general applications need not implement this interface, instead using the default mechanisms.

Instances of this interface must be reentrant and thread-safe.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Release resources provider is using.
    default void
    Invalidate any cached authorization strings.
    default boolean
    Indicates whether or not the instance is used for the cloud service
    Returns an authorization string for specified request.
    default void
    setRequiredHeaders(String authString, Request request, io.netty.handler.codec.http.HttpHeaders headers, byte[] content)
    Set HTTP headers required by the provider.
    default void
    Validates the authentication string.
  • Method Details

    • getAuthorizationString

      String getAuthorizationString(Request request)
      Returns an authorization string for specified request. This is sent to the server in the request for authorization. Authorization information can be request-dependent.
      Parameters:
      request - the request being processed
      Returns:
      a string indicating that the application is authorized to perform the request
    • close

      void close()
      Release resources provider is using.
    • validateAuthString

      default void validateAuthString(String input)
      Validates the authentication string. This method is optional and by default it will not allow a null string.
      Parameters:
      input - the string to authorize
      Throws:
      IllegalArgumentException - if the authentication string is null
    • setRequiredHeaders

      default void setRequiredHeaders(String authString, Request request, io.netty.handler.codec.http.HttpHeaders headers, byte[] content)
      Set HTTP headers required by the provider.
      Parameters:
      authString - the authorization string for the request
      request - the request being processed
      headers - the HTTP headers
      content - the request content bytes
    • flushCache

      default void flushCache()
      Invalidate any cached authorization strings.
    • forCloud

      default boolean forCloud()
      Indicates whether or not the instance is used for the cloud service
      Returns:
      false by default