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 TypeMethodDescriptionboolean
Performs authorization using anAuthorizer
after the image has been accessed, so information about it is available.boolean
Performs authorization using anAuthorizer
.void
cacheAccessed
(StatResult result) Called immediately after a cached instance has been accessed.void
sourceAccessed
(StatResult result) Called immediately after a source image has been accessed.
-
Method Details
-
authorizeBeforeAccess
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
Performs authorization using an
Authorizer
after the image has been accessed, so information about it is available.- Returns:
- Authorization result.
- Throws:
Exception
-
sourceAccessed
Called immediately after a source image has been accessed. (In the case of cached instances, whenKey.CACHE_SERVER_RESOLVE_FIRST
is set tofalse
, it may never be—in that case, seecacheAccessed(StatResult)
.)- Parameters:
result
- Information about the source image.
-
cacheAccessed
Called immediately after a cached instance has been accessed.- Parameters:
result
- Information about the cached instance.
-