xmlBlaster 2.2.0 API

org.xmlBlaster.protocol.http.simple
Class PullServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.xmlBlaster.protocol.http.simple.PullServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class PullServlet
extends javax.servlet.http.HttpServlet

This servlet supports requests from a browser, it queries the topic given by "gpsTopicId" configuration which needs to contain GPS coordinates (published for example by a PDA).

Use xmlBlaster/demo/http/gpsmap.html to display the coordinates in a map.

Author:
Marcel Ruff xmlBlaster@marcelruff.info 2006
See Also:
Serialized Form

Nested Class Summary
(package private)  class PullServlet.Position
           
 
Field Summary
private  java.lang.String loginName
           
private  java.lang.String passwd
           
private  java.util.Properties props
           
private static long serialVersionUID
           
private  I_XmlBlasterAccess xmlBlasterAccess
           
 
Constructor Summary
PullServlet()
           
 
Method Summary
 void destroy()
           
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
           
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
           
private  boolean feedbackHasChanged(javax.servlet.http.HttpServletRequest req, java.lang.String sms)
           
private  PullServlet.Position getCurrentPosition(javax.servlet.http.HttpServletRequest req)
           
private  java.lang.String getFeedback(javax.servlet.http.HttpServletRequest req)
           
 java.lang.String getServletInfo()
           
 java.lang.String getStartupUrl()
           
 java.lang.String getUrl(PullServlet.Position pos)
           
private  I_XmlBlasterAccess getXmlBlaster(javax.servlet.http.HttpServletRequest req)
           
 void init(javax.servlet.ServletConfig conf)
           
private  boolean isAction(java.lang.String ME, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
           
 void log(java.lang.String text)
           
 PullServlet.Position parsePosition(byte[] data_)
           
private  boolean positionHasChanged(javax.servlet.http.HttpServletRequest req, PullServlet.Position pos)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

props

private java.util.Properties props

xmlBlasterAccess

private I_XmlBlasterAccess xmlBlasterAccess

loginName

private java.lang.String loginName

passwd

private java.lang.String passwd
Constructor Detail

PullServlet

public PullServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig conf)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

doPost

public void doPost(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res)
            throws javax.servlet.ServletException,
                   java.io.IOException
Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
           throws javax.servlet.ServletException,
                  java.io.IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

isAction

private boolean isAction(java.lang.String ME,
                         javax.servlet.http.HttpServletRequest req,
                         javax.servlet.http.HttpServletResponse res)
                  throws javax.servlet.ServletException,
                         java.io.IOException,
                         XmlBlasterException
Throws:
javax.servlet.ServletException
java.io.IOException
XmlBlasterException

getFeedback

private java.lang.String getFeedback(javax.servlet.http.HttpServletRequest req)
                              throws XmlBlasterException,
                                     java.io.UnsupportedEncodingException
Throws:
XmlBlasterException
java.io.UnsupportedEncodingException

getCurrentPosition

private PullServlet.Position getCurrentPosition(javax.servlet.http.HttpServletRequest req)
                                         throws XmlBlasterException
Throws:
XmlBlasterException

feedbackHasChanged

private boolean feedbackHasChanged(javax.servlet.http.HttpServletRequest req,
                                   java.lang.String sms)

positionHasChanged

private boolean positionHasChanged(javax.servlet.http.HttpServletRequest req,
                                   PullServlet.Position pos)

getXmlBlaster

private I_XmlBlasterAccess getXmlBlaster(javax.servlet.http.HttpServletRequest req)
                                  throws XmlBlasterException
Throws:
XmlBlasterException

getUrl

public java.lang.String getUrl(PullServlet.Position pos)

getStartupUrl

public java.lang.String getStartupUrl()

parsePosition

public PullServlet.Position parsePosition(byte[] data_)

getServletInfo

public java.lang.String getServletInfo()
Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class javax.servlet.GenericServlet

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet

log

public void log(java.lang.String text)
Overrides:
log in class javax.servlet.GenericServlet

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.