org.sakaiproject.metaobj.shared.mgt
Class HttpAccessBase

java.lang.Object
  extended byorg.sakaiproject.metaobj.shared.mgt.HttpAccessBase
All Implemented Interfaces:
HttpAccess
Direct Known Subclasses:
MetaobjHttpAccess

public abstract class HttpAccessBase
extends Object
implements HttpAccess

Created by IntelliJ IDEA. User: John Ellis Date: Nov 7, 2005 Time: 3:14:16 PM To change this template use File | Settings | File Templates.


Constructor Summary
HttpAccessBase()
           
 
Method Summary
protected abstract  void checkSource(Reference ref, ReferenceParser parser)
           
protected  ReferenceParser createParser(Reference ref)
           
 void handleAccess(HttpServletRequest req, HttpServletResponse res, Reference ref, Collection copyrightAcceptedRefs)
          Handle an HTTP request for access.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpAccessBase

public HttpAccessBase()
Method Detail

handleAccess

public void handleAccess(HttpServletRequest req,
                         HttpServletResponse res,
                         Reference ref,
                         Collection copyrightAcceptedRefs)
                  throws PermissionException,
                         IdUnusedException,
                         ServerOverloadException,
                         CopyrightException
Description copied from interface: HttpAccess
Handle an HTTP request for access. The request and response objects are provider.
The access is for the referenced entity.
Use the response object to send the headers, length, content type, and bytes of the response in whatever manner needed.
Make the response ONLY if it is permitted and exists and otherwise valid. Use the exceptions for any error handling.

Specified by:
handleAccess in interface HttpAccess
Parameters:
req - The request object.
res - The response object.
ref - The entity reference
copyrightAcceptedRefs - The collection (entity reference String) of entities that the end user in this session have already accepted the copyright for.
Throws:
ServerOverloadException - Throw this if you are rejecting an otherwise valid request because of some sort of server resource shortage or limit.
IdUnusedException - Throw this if the ref is not supported or the entity is not available for access in any way.
CopyrightException - Throw this if you are rejecting an otherwise valid request because the user needs to agree to the copyright and has not yet done so.
PermissionException - Throw this if the current user does not have permission for the access.

createParser

protected ReferenceParser createParser(Reference ref)

checkSource

protected abstract void checkSource(Reference ref,
                                    ReferenceParser parser)
                             throws PermissionException,
                                    IdUnusedException,
                                    ServerOverloadException,
                                    CopyrightException
Throws:
PermissionException
IdUnusedException
ServerOverloadException
CopyrightException