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 TypeMethodDescriptionvoid
destroy()
Invoked at the end of the instance's lifecycle.void
doDELETE()
HandlesDELETE
requests.void
doGET()
HandlesGET
requests.void
doHEAD()
HandlesHEAD
requests.void
doInit()
Invoked before the main request handler (doGET()
, etc.).void
HandlesOPTIONS
requests.void
doPATCH()
HandlesPATCH
requests.void
doPOST()
HandlesPOST
requests.void
doPUT()
HandlesPUT
requests.void
setRequest
(Request request) Invoked beforedoInit()
.void
setResponse
(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 aResourceException
to enable a custom status.
-
doDELETE
HandlesDELETE
requests.- Throws:
Exception
- upon any error. This may be aResourceException
to enable a custom status.- See Also:
-
doGET
HandlesGET
requests.- Throws:
Exception
- upon any error. This may be aResourceException
to enable a custom status.- See Also:
-
doHEAD
HandlesHEAD
requests.- Throws:
Exception
- upon any error. This may be aResourceException
to enable a custom status.- See Also:
-
doOPTIONS
void doOPTIONS()HandlesOPTIONS
requests.- See Also:
-
doPATCH
HandlesPATCH
requests.- Throws:
Exception
- upon any error. This may be aResourceException
to enable a custom status.- See Also:
-
doPOST
HandlesPOST
requests.- Throws:
Exception
- upon any error. This may be aResourceException
to enable a custom status.- See Also:
-
doPUT
HandlesPUT
requests.- Throws:
Exception
- upon any error. This may be aResourceException
to enable a custom status.- See Also:
-
destroy
void destroy()Invoked at the end of the instance's lifecycle.
-