Interface Resource
- All Known Implementing Classes:
ConfigurationResource,FileResource,HealthResource,IdentifierResource,IdentifierResource,IdentifierResource,ImageResource,ImageResource,ImageResource,InformationResource,InformationResource,InformationResource,InformationResource,LandingResource,StatusResource,TaskResource,TasksResource,TileResource,TrailingSlashResource
public interface Resource
HTTP resource.
Implementations should extend AbstractResource and note the
documentation of all of its methods that they override.
Instances are used only once and are not shared across threads.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Invoked at the end of the instance's lifecycle.voiddoDELETE()HandlesDELETErequests.voiddoGET()HandlesGETrequests.voiddoHEAD()HandlesHEADrequests.voiddoInit()Invoked before the main request handler (doGET(), etc.).voidHandlesOPTIONSrequests.voiddoPATCH()HandlesPATCHrequests.voiddoPOST()HandlesPOSTrequests.voiddoPUT()HandlesPUTrequests.voidsetRequest(Request request) Invoked beforedoInit().voidsetResponse(Response response) Invoked beforedoInit().
-
Method Details
-
getRoutes
-
getRequest
Request getRequest()- Returns:
- The instance provided to
setRequest(Request).
-
getResponse
Response getResponse()- Returns:
- The instance provided to
setResponse(Response).
-
setRequest
-
setResponse
-
doInit
Invoked before the main request handler (doGET(), etc.).- Throws:
Exception- upon any error. This may be aResourceExceptionto enable a custom status.
-
doDELETE
HandlesDELETErequests.- Throws:
Exception- upon any error. This may be aResourceExceptionto enable a custom status.- See Also:
-
doGET
HandlesGETrequests.- Throws:
Exception- upon any error. This may be aResourceExceptionto enable a custom status.- See Also:
-
doHEAD
HandlesHEADrequests.- Throws:
Exception- upon any error. This may be aResourceExceptionto enable a custom status.- See Also:
-
doOPTIONS
void doOPTIONS()HandlesOPTIONSrequests.- See Also:
-
doPATCH
HandlesPATCHrequests.- Throws:
Exception- upon any error. This may be aResourceExceptionto enable a custom status.- See Also:
-
doPOST
HandlesPOSTrequests.- Throws:
Exception- upon any error. This may be aResourceExceptionto enable a custom status.- See Also:
-
doPUT
HandlesPUTrequests.- Throws:
Exception- upon any error. This may be aResourceExceptionto enable a custom status.- See Also:
-
destroy
void destroy()Invoked at the end of the instance's lifecycle.
-