org.sandev.tools.UIProcessor
Class FastXMLWSServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.sandev.tools.UIProcessor.FastXMLWSServlet
All Implemented Interfaces:
GeneratedServletInterface, org.sandev.ui.util.SandUIAdaptor, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class FastXMLWSServlet
extends javax.servlet.http.HttpServlet
implements GeneratedServletInterface, org.sandev.ui.util.SandUIAdaptor

A servlet for processing SAND messages serialized into XML with the XMLSerializer utility. This provides a simple and fast HTTP comms bridge. FastXMLWSServlet is an implementation of RequestAdaptor that calls through to a local CommBridge implementation for processing.

The FastXMLWSServlet is initialized with:

  1. The name of a locally accessible node implementing CommBridge.

See Also:
Serialized Form

Field Summary
protected  org.sandev.basics.util.CommBridge commBridge
          A reference to our local CommBridge we use for work.
protected  javax.servlet.http.HttpServlet controlServlet
          The original servlet for this request.
protected  java.lang.String ownerNodeName
          The name of the local node instance implementing CommBridge.
protected  org.sandev.basics.nodecommon.SingletonAccessor singletonAccessor
          The SingletonAccessor we will use to bridge from here to the application processing.
 
Constructor Summary
FastXMLWSServlet()
          Default ctor does nothing.
 
Method Summary
protected  void debug(java.lang.String text)
          Dump out the given text to the debug log.
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Pass HTTP 'GET' request over to handleRequest method.
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Pass HTTP 'POST' request over to handleRequest method.
protected  org.sandev.basics.nodecommon.SandRoot findSandRoot()
          Locate the SandRoot or throw if it can't be found.
protected  org.sandev.basics.util.CommBridge getCommBridge()
          Initializing accessor for commBridge.
 javax.servlet.http.HttpServlet getControlServlet()
          accessor for controlServlet
 java.lang.String getOwnerNodeName()
          accessor for ownerNodeName
 org.sandev.basics.nodecommon.SingletonAccessor getSingletonAccessor()
          accessor for singletonAccessor
protected  void handleRequest(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Use our CommBridge to process the request.
protected  void returnText(org.sandev.basics.sandmessages.AuthWrapper aw, javax.servlet.http.HttpServletResponse res)
          Write the XML for the given message as the response.
 void setCharSerializerClassName(java.lang.String val)
          This method does nothing and is provided just for initialization signature completeness.
 void setControlServlet(javax.servlet.http.HttpServlet val)
          mutator for controlServlet
 void setFixedMode(boolean val)
          This method does nothing and is provided just for initialization signature completeness.
 void setLocalLaunch(boolean val)
          This method does nothing and is provided just for initialization signature completeness.
 void setNodeInstanceFactoryClassName(java.lang.String val)
          This method does nothing and is provided just for initialization signature completeness.
 void setOwnerNodeName(java.lang.String val)
          mutator for ownerNodeName
 void setSandUIFileName(java.lang.String name)
          This method does nothing and is provided just for initialization signature completeness.
 void setSingletonAccessor(org.sandev.basics.nodecommon.SingletonAccessor val)
          mutator for singletonAccessor
 void setUIFormAdaptorClassName(java.lang.String val)
          This method does nothing and is provided just for initialization signature completeness.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controlServlet

protected javax.servlet.http.HttpServlet controlServlet
The original servlet for this request. This is used to retrieve the servlet context for content retrieval and must be set by the controlling servlet.


ownerNodeName

protected java.lang.String ownerNodeName
The name of the local node instance implementing CommBridge.


singletonAccessor

protected org.sandev.basics.nodecommon.SingletonAccessor singletonAccessor
The SingletonAccessor we will use to bridge from here to the application processing.


commBridge

protected org.sandev.basics.util.CommBridge commBridge
A reference to our local CommBridge we use for work.

Constructor Detail

FastXMLWSServlet

public FastXMLWSServlet()
Default ctor does nothing.

Method Detail

getControlServlet

public javax.servlet.http.HttpServlet getControlServlet()
accessor for controlServlet


setControlServlet

public void setControlServlet(javax.servlet.http.HttpServlet val)
mutator for controlServlet

Specified by:
setControlServlet in interface GeneratedServletInterface

setSandUIFileName

public void setSandUIFileName(java.lang.String name)
This method does nothing and is provided just for initialization signature completeness.

Specified by:
setSandUIFileName in interface GeneratedServletInterface

setCharSerializerClassName

public void setCharSerializerClassName(java.lang.String val)
This method does nothing and is provided just for initialization signature completeness.

Specified by:
setCharSerializerClassName in interface GeneratedServletInterface

setUIFormAdaptorClassName

public void setUIFormAdaptorClassName(java.lang.String val)
This method does nothing and is provided just for initialization signature completeness.

Specified by:
setUIFormAdaptorClassName in interface GeneratedServletInterface

setNodeInstanceFactoryClassName

public void setNodeInstanceFactoryClassName(java.lang.String val)
This method does nothing and is provided just for initialization signature completeness.


setFixedMode

public void setFixedMode(boolean val)
This method does nothing and is provided just for initialization signature completeness. Fixed mode is assumed.

Specified by:
setFixedMode in interface GeneratedServletInterface

getOwnerNodeName

public java.lang.String getOwnerNodeName()
accessor for ownerNodeName


setOwnerNodeName

public void setOwnerNodeName(java.lang.String val)
mutator for ownerNodeName

Specified by:
setOwnerNodeName in interface GeneratedServletInterface

setLocalLaunch

public void setLocalLaunch(boolean val)
This method does nothing and is provided just for initialization signature completeness. Even if we are launching nodes from a servlet, we would presumably be driving this from the SandUI servlet, not the web service support servlet, so this is always assumed to be false.

Specified by:
setLocalLaunch in interface GeneratedServletInterface

getSingletonAccessor

public org.sandev.basics.nodecommon.SingletonAccessor getSingletonAccessor()
accessor for singletonAccessor


setSingletonAccessor

public void setSingletonAccessor(org.sandev.basics.nodecommon.SingletonAccessor val)
mutator for singletonAccessor

Specified by:
setSingletonAccessor in interface GeneratedServletInterface

getCommBridge

protected org.sandev.basics.util.CommBridge getCommBridge()
                                                   throws org.sandev.basics.structs.SandException
Initializing accessor for commBridge.

Throws:
org.sandev.basics.structs.SandException

findSandRoot

protected org.sandev.basics.nodecommon.SandRoot findSandRoot()
                                                      throws org.sandev.basics.structs.SandException
Locate the SandRoot or throw if it can't be found. Check the configured SingletonAccessor first, then the default, then die. This method assumes that the root has been set up and all we have to do is return it.

Throws:
org.sandev.basics.structs.SandException

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
Pass HTTP 'GET' request over to handleRequest method.


doPost

public void doPost(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res)
Pass HTTP 'POST' request over to handleRequest method.


handleRequest

protected void handleRequest(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse res)
Use our CommBridge to process the request.


returnText

protected void returnText(org.sandev.basics.sandmessages.AuthWrapper aw,
                          javax.servlet.http.HttpServletResponse res)
Write the XML for the given message as the response.


debug

protected void debug(java.lang.String text)
Dump out the given text to the debug log. Just calls system out for now.