Class EntityBatchHandler
- java.lang.Object
-
- 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
Nested Classes Modifier and Type Class Description static classEntityBatchHandler.ResponseBaseBase class for all response data which will be encoded and outputstatic classEntityBatchHandler.ResponseErrorHolds the error values which will be encoded by the various EB utilsstatic classEntityBatchHandler.ResponseResultHolds the results from a successful response request
-
Field Summary
Fields Modifier and Type Field Description static booleanCONFIG_BATCH_DEFAULTstatic StringCONFIG_BATCH_ENABLEstatic StringREFS_PARAM_NAMEThis is the name of the parameter which is used to pass along the reference URLs to be batch processed
-
Constructor Summary
Constructors Constructor Description EntityBatchHandler()Empty constructor, must use setters to set the needed servicesEntityBatchHandler(EntityBrokerManager entityBrokerManager, EntityEncodingManager entityEncodingManager, ExternalIntegrationProvider externalIntegrationProvider)Full constructor, use this to correctly construct this class, note that after construction, the entityRequestHandler must be set also
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()voidhandleBatch(EntityView view, HttpServletRequest req, HttpServletResponse res)Handle the batch operations encoded in this view and requestvoidinit()voidsetEntityBrokerManager(EntityBrokerManager entityBrokerManager)voidsetEntityEncodingManager(EntityEncodingManager entityEncodingManager)voidsetEntityRequestHandler(EntityHandlerImpl entityRequestHandler)voidsetExternalIntegrationProvider(ExternalIntegrationProvider externalIntegrationProvider)StringstripOutXMLTag(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
-
-
-
Field Detail
-
CONFIG_BATCH_ENABLE
public static final String CONFIG_BATCH_ENABLE
- See Also:
- Constant Field Values
-
CONFIG_BATCH_DEFAULT
public static final boolean CONFIG_BATCH_DEFAULT
- See Also:
- Constant Field Values
-
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, ExternalIntegrationProvider externalIntegrationProvider)
Full constructor, use this to correctly construct this class, note that after construction, the entityRequestHandler must be set also
-
-
Method Detail
-
init
public void init()
-
destroy
public void destroy()
-
setEntityBrokerManager
public void setEntityBrokerManager(EntityBrokerManager entityBrokerManager)
-
setEntityEncodingManager
public void setEntityEncodingManager(EntityEncodingManager entityEncodingManager)
-
setExternalIntegrationProvider
public void setExternalIntegrationProvider(ExternalIntegrationProvider externalIntegrationProvider)
-
setEntityRequestHandler
public void setEntityRequestHandler(EntityHandlerImpl entityRequestHandler)
-
handleBatch
public void handleBatch(EntityView view, HttpServletRequest req, HttpServletResponse res)
Handle the batch operations encoded in this view and request- Parameters:
view- the current viewreq- the current requestres- 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 contentstartTag- the starting tag (e.g. "" or "endTag- the ending tag (e.g "?>" or "/blah")- Returns:
- the content without the chopped out part if found
-
-