com.bradmcevoy.http
Class HandlerHelper

java.lang.Object
  extended by com.bradmcevoy.http.HandlerHelper

public class HandlerHelper
extends java.lang.Object

Author:
brad

Constructor Summary
HandlerHelper(AuthenticationService authenticationService, java.util.List<StorageChecker> storageCheckers)
           
 
Method Summary
 AuthenticationService.AuthStatus checkAuthentication(HttpManager manager, Resource resource, Request request)
           
 boolean checkAuthorisation(HttpManager manager, Resource resource, Request request)
           
 boolean checkExpects(Http11ResponseHandler responseHandler, Request request, Response response)
          Checks the expect header, and responds if necessary
 StorageChecker.StorageErrorReason checkStorageOnAdd(Request request, CollectionResource nearestParent, Path parentPath, java.lang.String host)
           
 StorageChecker.StorageErrorReason checkStorageOnReplace(Request request, CollectionResource parentCol, Resource replaced, java.lang.String host)
           
 boolean doCheckRedirect(Http11ResponseHandler responseHandler, Request request, Response response, Resource resource)
           
 boolean isEnableExpectContinue()
           
 boolean isLockedOut(Request inRequest, Resource inResource)
          TODO: move to webdav
 boolean isNotCompatible(Resource r, Request.Method m)
          Returns true to indicate that the given resource MUST NOT handle the given method.
 boolean missingLock(Request inRequest, Resource inParentcol)
           
 void setEnableExpectContinue(boolean enableExpectContinue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandlerHelper

public HandlerHelper(AuthenticationService authenticationService,
                     java.util.List<StorageChecker> storageCheckers)
Method Detail

checkExpects

public boolean checkExpects(Http11ResponseHandler responseHandler,
                            Request request,
                            Response response)
Checks the expect header, and responds if necessary

Parameters:
resource -
request -
response -
Returns:
- true if the expect header is ok. ie process normally. false means that we have sent a CONTINUE status and processing should stop until the request body is sent

checkAuthentication

public AuthenticationService.AuthStatus checkAuthentication(HttpManager manager,
                                                            Resource resource,
                                                            Request request)

checkAuthorisation

public boolean checkAuthorisation(HttpManager manager,
                                  Resource resource,
                                  Request request)

doCheckRedirect

public boolean doCheckRedirect(Http11ResponseHandler responseHandler,
                               Request request,
                               Response response,
                               Resource resource)

isLockedOut

public boolean isLockedOut(Request inRequest,
                           Resource inResource)
TODO: move to webdav

Parameters:
inRequest -
inResource -
Returns:

missingLock

public boolean missingLock(Request inRequest,
                           Resource inParentcol)

checkStorageOnReplace

public StorageChecker.StorageErrorReason checkStorageOnReplace(Request request,
                                                               CollectionResource parentCol,
                                                               Resource replaced,
                                                               java.lang.String host)

checkStorageOnAdd

public StorageChecker.StorageErrorReason checkStorageOnAdd(Request request,
                                                           CollectionResource nearestParent,
                                                           Path parentPath,
                                                           java.lang.String host)

isNotCompatible

public boolean isNotCompatible(Resource r,
                               Request.Method m)
Returns true to indicate that the given resource MUST NOT handle the given method. A return value of false indicates that it might.

Parameters:
r - - the resource to check
m - - the HTTP request method
Returns:
- true to indicate the resource must not handle method m

isEnableExpectContinue

public boolean isEnableExpectContinue()

setEnableExpectContinue

public void setEnableExpectContinue(boolean enableExpectContinue)


Copyright © 2011. All Rights Reserved.