Package io.milton.http
Class AbstractWrappingResponseHandler
java.lang.Object
io.milton.http.AbstractWrappingResponseHandler
- All Implemented Interfaces:
Bufferable,ETagGenerator,Http11ResponseHandler,WebDavResponseHandler
- Direct Known Subclasses:
CompressingResponseHandler,LoginResponseHandler
public abstract class AbstractWrappingResponseHandler
extends Object
implements WebDavResponseHandler, Bufferable
Response Handler which wraps another
- Author:
- brad
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WebDavResponseHandlerThe underlying respond handler which takes care of actually generating content -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionETag's serve to identify a particular version of a particular resource.voidrespondBadRequest(Resource resource, Response response, Request request) Respond with a 400 statusvoidrespondConflict(Resource resource, Response response, Request request, String message) voidvoidrespondCreated(Resource resource, Response response, Request request) voidrespondDeleteFailed(Request request, Response response, Resource resource, Response.Status status) Called when a delete has failed, including the failure status.voidrespondExpectationFailed(Response response, Request request) Response with a 417voidrespondForbidden(Resource resource, Response response, Request request) Respond with a 403 status - forbiddenvoidrespondHead(Resource resource, Response response, Request request) Generate a HEAD responsevoidrespondInsufficientStorage(Request request, Response response, StorageChecker.StorageErrorReason storageErrorReason) voidrespondLocked(Request request, Response response, Resource existingResource) voidrespondMethodNotAllowed(Resource res, Response response, Request request) voidrespondMethodNotImplemented(Resource resource, Response response, Request request) voidrespondNoContent(Resource resource, Response response, Request request) Invoked when an operation is successful, but there is no content, and there is nothing more specific to return (E.g. created) For example, as a result of a PUT when a resouce has been updated)voidrespondNotFound(Response response, Request request) voidrespondNotModified(GetableResource resource, Response response, Request request) voidrespondPartialContent(GetableResource resource, Response response, Request request, Map<String, String> params, Range range) Respond with content from a single range, in a partial GETvoidrespondPartialContent(GetableResource resource, Response response, Request request, Map<String, String> params, List<Range> ranges) Respond with multiple ranges for a partial GETvoidrespondPreconditionFailed(Request request, Response response, Resource resource) Generate a 412 response,voidrespondPropFind(List<PropFindResponse> propFindResponses, Response response, Request request, PropFindableResource pfr) voidrespondPropFind(List<PropFindResponse> propFindResponses, Response response, Request request, Resource r) Generate the response for a PROPFIND or a PROPPATCHvoidrespondRedirect(Response response, Request request, String redirectUrl) voidrespondServerError(Request request, Response response, String reason) Usually a 500 error.voidrespondUnauthorised(Resource resource, Response response, Request request) voidrespondWithOptions(Resource resource, Response response, Request request, List<String> methodsAllowed) voidresponseMultiStatus(Resource resource, Response response, Request request, List<HrefStatus> statii) voidvoidsetWrapped(WebDavResponseHandler wrapped)
-
Field Details
-
wrapped
The underlying respond handler which takes care of actually generating content
-
-
Constructor Details
-
AbstractWrappingResponseHandler
public AbstractWrappingResponseHandler() -
AbstractWrappingResponseHandler
-
-
Method Details
-
getBuffering
- Specified by:
getBufferingin interfaceBufferable
-
setBuffering
- Specified by:
setBufferingin interfaceBufferable
-
generateEtag
Description copied from interface:ETagGeneratorETag's serve to identify a particular version of a particular resource. If the resource changes, or is replaced, then this value should change- Specified by:
generateEtagin interfaceETagGenerator- Parameters:
r- - the resource to generate the ETag for- Returns:
- - an ETag which uniquely identifies this version of this resource
-
respondContent
public void respondContent(Resource resource, Response response, Request request, Map<String, String> params) throws NotAuthorizedException, BadRequestException, NotFoundException- Specified by:
respondContentin interfaceHttp11ResponseHandler- Throws:
NotAuthorizedExceptionBadRequestExceptionNotFoundException
-
setWrapped
-
getWrapped
-
respondNoContent
Description copied from interface:Http11ResponseHandlerInvoked when an operation is successful, but there is no content, and there is nothing more specific to return (E.g. created) For example, as a result of a PUT when a resouce has been updated)- Specified by:
respondNoContentin interfaceHttp11ResponseHandler
-
respondPartialContent
public void respondPartialContent(GetableResource resource, Response response, Request request, Map<String, String> params, Range range) throws NotAuthorizedException, BadRequestException, NotFoundExceptionDescription copied from interface:Http11ResponseHandlerRespond with content from a single range, in a partial GET- Specified by:
respondPartialContentin interfaceHttp11ResponseHandler- Throws:
NotAuthorizedExceptionBadRequestExceptionNotFoundException
-
respondPartialContent
public void respondPartialContent(GetableResource resource, Response response, Request request, Map<String, String> params, List<Range> ranges) throws NotAuthorizedException, BadRequestException, NotFoundExceptionDescription copied from interface:Http11ResponseHandlerRespond with multiple ranges for a partial GET- Specified by:
respondPartialContentin interfaceHttp11ResponseHandler- Throws:
NotAuthorizedExceptionBadRequestExceptionNotFoundException
-
respondCreated
- Specified by:
respondCreatedin interfaceHttp11ResponseHandler
-
respondUnauthorised
- Specified by:
respondUnauthorisedin interfaceHttp11ResponseHandler
-
respondMethodNotImplemented
- Specified by:
respondMethodNotImplementedin interfaceHttp11ResponseHandler
-
respondMethodNotAllowed
- Specified by:
respondMethodNotAllowedin interfaceHttp11ResponseHandler
-
respondConflict
- Specified by:
respondConflictin interfaceHttp11ResponseHandler
-
respondRedirect
- Specified by:
respondRedirectin interfaceHttp11ResponseHandler
-
responseMultiStatus
public void responseMultiStatus(Resource resource, Response response, Request request, List<HrefStatus> statii) - Specified by:
responseMultiStatusin interfaceWebDavResponseHandler
-
respondNotModified
- Specified by:
respondNotModifiedin interfaceHttp11ResponseHandler
-
respondNotFound
- Specified by:
respondNotFoundin interfaceHttp11ResponseHandler
-
respondWithOptions
public void respondWithOptions(Resource resource, Response response, Request request, List<String> methodsAllowed) - Specified by:
respondWithOptionsin interfaceHttp11ResponseHandler
-
respondHead
Description copied from interface:Http11ResponseHandlerGenerate a HEAD response- Specified by:
respondHeadin interfaceHttp11ResponseHandler
-
respondExpectationFailed
Description copied from interface:Http11ResponseHandlerResponse with a 417- Specified by:
respondExpectationFailedin interfaceHttp11ResponseHandler
-
respondBadRequest
Description copied from interface:Http11ResponseHandlerRespond with a 400 status- Specified by:
respondBadRequestin interfaceHttp11ResponseHandler
-
respondForbidden
Description copied from interface:Http11ResponseHandlerRespond with a 403 status - forbidden- Specified by:
respondForbiddenin interfaceHttp11ResponseHandler
-
respondDeleteFailed
public void respondDeleteFailed(Request request, Response response, Resource resource, Response.Status status) Description copied from interface:Http11ResponseHandlerCalled when a delete has failed, including the failure status. Note that webdav implementations will respond with a multisttus, while http 1.1 implementations will simply set the response status- Specified by:
respondDeleteFailedin interfaceHttp11ResponseHandlerresource- - the resource which could not be deletedstatus- - the status which has caused the delete to fail.
-
respondPropFind
public void respondPropFind(List<PropFindResponse> propFindResponses, Response response, Request request, PropFindableResource pfr) -
respondPropFind
public void respondPropFind(List<PropFindResponse> propFindResponses, Response response, Request request, Resource r) Description copied from interface:WebDavResponseHandlerGenerate the response for a PROPFIND or a PROPPATCH- Specified by:
respondPropFindin interfaceWebDavResponseHandlerr- - the resource
-
respondServerError
Description copied from interface:Http11ResponseHandlerUsually a 500 error. Some error occured processing the request. Note that you might not be able to assume that this will generate all 500 errors since a runtime exception might result in code outside of milton's control generating the 500 response.- Specified by:
respondServerErrorin interfaceHttp11ResponseHandler
-
respondInsufficientStorage
public void respondInsufficientStorage(Request request, Response response, StorageChecker.StorageErrorReason storageErrorReason) - Specified by:
respondInsufficientStoragein interfaceWebDavResponseHandler
-
respondLocked
- Specified by:
respondLockedin interfaceWebDavResponseHandler
-
respondPreconditionFailed
Description copied from interface:WebDavResponseHandlerGenerate a 412 response,- Specified by:
respondPreconditionFailedin interfaceHttp11ResponseHandler- Specified by:
respondPreconditionFailedin interfaceWebDavResponseHandler
-