org.sakaiproject.entitybroker.rest
Class EntityBatchHandler

java.lang.Object
  extended by org.sakaiproject.entitybroker.rest.EntityBatchHandler

public class EntityBatchHandler
extends Object

This handles batch operations internally as much as possible, the idea is to provide for a standard way to reduce huge numbers of calls down to 1 call to the server which puts the data together into a single response

Author:
Aaron Zeckoski (azeckoski @ gmail.com)

Nested Class Summary
static class EntityBatchHandler.ResponseBase
          Base class for all response data which will be encoded and output
static class EntityBatchHandler.ResponseError
          Holds the error values which will be encoded by the various EB utils
static class EntityBatchHandler.ResponseResult
          Holds the results from a successful response request
 
Field Summary
static String REFS_PARAM_NAME
          This is the name of the parameter which is used to pass along the reference URLs to be batch processed
 
Constructor Summary
EntityBatchHandler()
          Empty constructor, must use setters to set the needed services
EntityBatchHandler(EntityBrokerManager entityBrokerManager, EntityEncodingManager entityEncodingManager)
          Full constructor, use this to correctly construct this class, note that after construction, the entityRequestHandler must be set also
 
Method Summary
 void handleBatch(EntityView view, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Handle the batch operations encoded in this view and request
 void setEntityBrokerManager(EntityBrokerManager entityBrokerManager)
           
 void setEntityEncodingManager(EntityEncodingManager entityEncodingManager)
           
 void setEntityRequestHandler(EntityHandlerImpl entityRequestHandler)
           
 String stripOutXMLTag(String content, String startTag, String endTag)
          This will strip any tag out of an xml file by finding the startTag (if possible), and then the endTag and chopping this out of the given content and returning the new value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REFS_PARAM_NAME

public static final String REFS_PARAM_NAME
This is the name of the parameter which is used to pass along the reference URLs to be batch processed

See Also:
Constant Field Values
Constructor Detail

EntityBatchHandler

public EntityBatchHandler()
Empty constructor, must use setters to set the needed services


EntityBatchHandler

public EntityBatchHandler(EntityBrokerManager entityBrokerManager,
                          EntityEncodingManager entityEncodingManager)
Full constructor, use this to correctly construct this class, note that after construction, the entityRequestHandler must be set also

Method Detail

setEntityBrokerManager

public void setEntityBrokerManager(EntityBrokerManager entityBrokerManager)

setEntityEncodingManager

public void setEntityEncodingManager(EntityEncodingManager entityEncodingManager)

setEntityRequestHandler

public void setEntityRequestHandler(EntityHandlerImpl entityRequestHandler)

handleBatch

public void handleBatch(EntityView view,
                        javax.servlet.http.HttpServletRequest req,
                        javax.servlet.http.HttpServletResponse res)
Handle the batch operations encoded in this view and request

Parameters:
view - the current view
req - the current request
res - the current response

stripOutXMLTag

public String stripOutXMLTag(String content,
                             String startTag,
                             String endTag)
This will strip any tag out of an xml file by finding the startTag (if possible), and then the endTag and chopping this out of the given content and returning the new value

Parameters:
content - any XML like content
startTag - the starting tag (e.g. "endTag - the ending tag (e.g "?>" or "/blah")
Returns:
the content without the chopped out part if found


Copyright © 2007-2012 Sakai Project. All Rights Reserved.