Interface InformationRequestHandler.Callback

Enclosing class:
InformationRequestHandler

public static interface InformationRequestHandler.Callback

Callback for various events that occur during a call to InformationRequestHandler.handle().

Any exceptions thrown from these methods will bubble up through InformationRequestHandler.handle(). This feature can be used to support e.g. a ResourceException with a custom status depending on the authorization result.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Performs authorization using an Authorizer after the image has been accessed, so information about it is available.
    boolean
    Performs authorization using an Authorizer.
    void
    Called immediately after a cached instance has been accessed.
    void
    Called immediately after a source image has been accessed.
  • Method Details

    • authorizeBeforeAccess

      boolean authorizeBeforeAccess() throws Exception

      Performs authorization using an Authorizer. The source image has not been accessed yet, so no information about it is available.

      This is the first callback to get called.

      Returns:
      Authorization result.
      Throws:
      Exception
    • authorize

      boolean authorize() throws Exception

      Performs authorization using an Authorizer after the image has been accessed, so information about it is available.

      Returns:
      Authorization result.
      Throws:
      Exception
    • sourceAccessed

      void sourceAccessed(StatResult result)
      Called immediately after a source image has been accessed. (In the case of cached instances, when Key.CACHE_SERVER_RESOLVE_FIRST is set to false, it may never be—in that case, see cacheAccessed(StatResult).)
      Parameters:
      result - Information about the source image.
    • cacheAccessed

      void cacheAccessed(StatResult result)
      Called immediately after a cached instance has been accessed.
      Parameters:
      result - Information about the cached instance.