atg.rest.processor
Class RepositoryProcessor

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.rest.processor.GenericRestProcessor
              extended by atg.rest.processor.RepositoryProcessor
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, RestProcessor, java.util.EventListener

public class RepositoryProcessor
extends GenericRestProcessor

The base type for processing repository based rest requests. This class handles GET, POST, PUT, and DELETE requests.

See Also:
GenericRestProcessor, RestProcessor

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
RepositoryProcessor()
          Constructor
 
Method Summary
protected  void createRepositoryItem(MutableRepository pRep, RepositoryURI pParsedURI, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method handles creating a repository item
 void doRESTDelete(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method handles the processing for a rest DELETE request.
 void doRESTGet(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method handles the processing for a rest GET request.
 void doRESTPost(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method handles the processing for a rest POST resource request.
 void doRESTPut(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method handles the processing for a rest PUT request.
 boolean isAppendMultiValuesByDefault()
          get AppendMultiValuesByDefault
 void setAppendMultiValuesByDefault(boolean pAppendMultiValuesByDefault)
          set AppendMultiValuesByDefault
protected  void setPropertyValueFromString(java.lang.Object pContainer, java.lang.String pName, NameValuePair pValuePair, ParsedURI pParsedURI, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method sets a property value from a String.
 
Methods inherited from class atg.rest.processor.GenericRestProcessor
determineJSONControlParams, determineJSONUsage, getBooleanControlParam, getComponentResolver, getFilteringManager, getOutputCustomizer, getParentServlet, getStringControlParam, isAcceptJSONInput, isResourceWritable, isResourceWritable, setAcceptJSONInput, setComponentResolver, setOutputCustomizer, setParentServlet, useSimpleResponseCodes, validateResource
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

RepositoryProcessor

public RepositoryProcessor()
Constructor

Method Detail

setAppendMultiValuesByDefault

public void setAppendMultiValuesByDefault(boolean pAppendMultiValuesByDefault)
set AppendMultiValuesByDefault

Parameters:
pAppendMultiValuesByDefault - the AppendMultiValuesByDefault

isAppendMultiValuesByDefault

public boolean isAppendMultiValuesByDefault()
get AppendMultiValuesByDefault

Returns:
the AppendMultiValuesByDefault

doRESTGet

public void doRESTGet(DynamoHttpServletRequest pRequest,
                      DynamoHttpServletResponse pResponse)
               throws RestException,
                      java.io.IOException
This method handles the processing for a rest GET request. It uses the componentResolver to find the resource's parent and then passes the resource to the output customizer.

Parameters:
pRequest - the servlet request
pResponse - the servlet response
Throws:
RestException - if an error occurs processing the REST request
java.io.IOException - if an input or output stream exception occurs

doRESTPost

public void doRESTPost(DynamoHttpServletRequest pRequest,
                       DynamoHttpServletResponse pResponse)
                throws RestException,
                       java.io.IOException
This method handles the processing for a rest POST resource request. A POST request translates into a method call on the resource's parent container.

Parameters:
pRequest - the servlet request
pResponse - the servlet response
Throws:
RestException - if an error occurs processing the REST request
java.io.IOException - if an input or output stream exception occurs

createRepositoryItem

protected void createRepositoryItem(MutableRepository pRep,
                                    RepositoryURI pParsedURI,
                                    DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pResponse)
                             throws RestException,
                                    java.io.IOException
This method handles creating a repository item

Parameters:
pParsedURI - an object containing the parsed URI
pRep - the repository to create the item in
pRequest - the servlet request
pResponse - the servlet response
Throws:
RestException - if an error occurs processing the REST request
java.io.IOException - if an input or output stream exception occurs

doRESTPut

public void doRESTPut(DynamoHttpServletRequest pRequest,
                      DynamoHttpServletResponse pResponse)
               throws RestException,
                      java.io.IOException
This method handles the processing for a rest PUT request. A PUT request translates into a request to set a property on the resource.

Parameters:
pRequest - the servlet request
pResponse - the servlet response
Throws:
RestException - if an error occurs processing the REST request
java.io.IOException - if an input or output stream exception occurs

setPropertyValueFromString

protected void setPropertyValueFromString(java.lang.Object pContainer,
                                          java.lang.String pName,
                                          NameValuePair pValuePair,
                                          ParsedURI pParsedURI,
                                          DynamoHttpServletRequest pRequest,
                                          DynamoHttpServletResponse pResponse)
                                   throws RestException,
                                          java.io.IOException
This method sets a property value from a String. It mainly will do any conversion that needs to happen from the string to the actual object.

Parameters:
pContainer - the object to set the property on
pName - the name of the property to set
pValuePair - this object contains the property name, value, and container in which it exists
pParsedURI - an object containing the parsed URI
pRequest - the servlet request
pResponse - the servlet response
Throws:
RestException - if an error occurs setting the value
java.io.IOException

doRESTDelete

public void doRESTDelete(DynamoHttpServletRequest pRequest,
                         DynamoHttpServletResponse pResponse)
                  throws RestException,
                         java.io.IOException
This method handles the processing for a rest DELETE request. A DELETE request translates into a request to delete a repository item or items.

Parameters:
pRequest - the servlet request
pResponse - the servlet response
Throws:
RestException - if an error occurs processing the REST request
java.io.IOException - if an input or output stream exception occurs