atg.rest.servlet
Class HeadRestServlet

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.servlet.pipeline.PipelineableServletImpl
                  extended by atg.rest.servlet.RestPipelineServlet
                      extended by atg.rest.servlet.HeadRestServlet
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, PipelineableServlet, java.util.EventListener, javax.servlet.Servlet

public class HeadRestServlet
extends RestPipelineServlet

This class represents the start of the REST servlet pipeline. Its purpose is to initialize the pipeline's URI prefix. Its serviceRESTRequest() method does not contain any logic for handling requests, but rather just checks to see that the pipeline is initialized. See RestPipelineServlet for more information.

See Also:
RestPipelineServlet

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.rest.servlet.RestPipelineServlet
BEAN_SERVLET_PATH, PARSED_URI, PATH_INFO, REPOSITORY_SERVLET_PATH, REST_CONTEXT_ROOT, SERVLET_PATH
 
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
HeadRestServlet()
          Constructor
 
Method Summary
 void doStartService()
          This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values.
 java.util.Map<java.lang.String,java.lang.String> getUriClassMap()
          Get the map of uri string to class name.
protected  void postCreateTransaction(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called after the transaction is created.
protected  void preCommitTransaction(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called before the transaction is committed.
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Override the service() method and call serviceRESTRequest().
 void serviceRESTRequest(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Override serviceRESTRequest() so that this servlet does not do anything other than print a line of debug if loggingDebug is true.
 void setUriClassMap(java.util.Map<java.lang.String,java.lang.String> pUriClassMap)
          Sets the map of uri string to class name
 
Methods inherited from class atg.rest.servlet.RestPipelineServlet
getMethod, getRequiredServletPrefix, getRestProcessor, getTransactionManager, isEnsureTransaction, isTransactionMarkedAsRollback, postCommitTransaction, preCreateTransaction, setEnsureTransaction, setRequiredServletPrefix, setRestProcessor, setTransactionManager
 
Methods inherited from class atg.servlet.pipeline.PipelineableServletImpl
createAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, isUsePathInfo, passRequest, passRequest, service, service, setNextServlet, setServletInfo, setUsePathInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, doStopService, getAbsoluteName, 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

HeadRestServlet

public HeadRestServlet()
Constructor

Method Detail

postCreateTransaction

protected void postCreateTransaction(DynamoHttpServletRequest pRequest,
                                     DynamoHttpServletResponse pResponse)
                              throws RestException,
                                     java.io.IOException
This method is called after the transaction is created. It is where we initialize the ParameterContext object.

Overrides:
postCreateTransaction in class RestPipelineServlet
Parameters:
pRequest - the servlet request
pResponse - the servlet response
Throws:
RestException - if an error occurs processing the REST request
java.io.IOException - if an error occurs writing to the output stream

preCommitTransaction

protected void preCommitTransaction(DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pResponse)
This method is called before the transaction is committed. It is where the ParameterContext is cleared.

Overrides:
preCommitTransaction in class RestPipelineServlet
Parameters:
pRequest - the servlet request
pResponse - the servlet response

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws java.io.IOException,
                    javax.servlet.ServletException
Override the service() method and call serviceRESTRequest(). This method will handle calling passRequest(). Users should override serviceRESTRequest() rather than service().

Overrides:
service in class RestPipelineServlet
Parameters:
pRequest - the servlet request
pResponse - the servlet response
Throws:
java.io.IOException - if an input or output stream exception occurs
javax.servlet.ServletException - if any other error occurs
See Also:
serviceRESTRequest(DynamoHttpServletRequest, DynamoHttpServletResponse)

serviceRESTRequest

public void serviceRESTRequest(DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse)
                        throws java.io.IOException,
                               javax.servlet.ServletException,
                               RestException
Override serviceRESTRequest() so that this servlet does not do anything other than print a line of debug if loggingDebug is true.

Overrides:
serviceRESTRequest in class RestPipelineServlet
Parameters:
pRequest - the servlet request
pResponse - the servlet response
Throws:
java.io.IOException - if an input or output stream exception occurs
javax.servlet.ServletException - if a general error occurs
RestException - if an error occurs processing the REST request
See Also:
RestPipelineServlet.serviceRESTRequest(DynamoHttpServletRequest,DynamoHttpServletResponse)

doStartService

public void doStartService()
                    throws ServiceException
Description copied from class: GenericService
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. The Service should override this method to start any processes it requires.

Overrides:
doStartService in class RestPipelineServlet
Throws:
ServiceException - if the Service had a problem starting up

getUriClassMap

public java.util.Map<java.lang.String,java.lang.String> getUriClassMap()
Get the map of uri string to class name.

Returns:
the uriClassMap

setUriClassMap

public void setUriClassMap(java.util.Map<java.lang.String,java.lang.String> pUriClassMap)
Sets the map of uri string to class name

Parameters:
pUriClassMap - the uriClassMap to set