net.ex_337.xmpp.fwork.examples
Class DemoGradientService

java.lang.Object
  extended bynet.ex_337.xmpp.fwork.XMPPService
      extended bynet.ex_337.xmpp.fwork.BaseGradientService
          extended bynet.ex_337.xmpp.fwork.examples.DemoGradientService
All Implemented Interfaces:
org.jivesoftware.smack.PacketListener

public class DemoGradientService
extends BaseGradientService

This is a demonstration extension of BaseGradientService. It returns three documents. One is a normal SVG document, returned via XMPP. One is a very nice SVG map (courtesy of the Andreas Neuman and the Batik project) that is loaded via HTTP One is a rectangles document that is updated over time by the server, and can send messages from ECMAScript back to the server.

Author:
Ian

Field Summary
(package private) static String RECTANGLES_NAMESPACE
           
(package private) static String RECTANGLES_PATH
          This is accessed by helper classes.
 
Fields inherited from class net.ex_337.xmpp.fwork.BaseGradientService
sessions
 
Fields inherited from class net.ex_337.xmpp.fwork.XMPPService
filter, sc, xmppConnection
 
Constructor Summary
DemoGradientService()
           
 
Method Summary
 void destroy()
          closes the rectangle broadcaster then sells it to Clear Channel.
 void init()
          Loads in the documents we return via XMPP.
protected  GradientSession newSession()
          Creates a new session.
 Element processDocumentRequest(String remoteJID, String path, Map parameters)
          Processes document requests.
 
Methods inherited from class net.ex_337.xmpp.fwork.BaseGradientService
getSession, getSessions, processDocRequestIQ, processIncomingMessage, processPacket, processPresence, processRPCStyleIQ, sendStanza, sendStanza
 
Methods inherited from class net.ex_337.xmpp.fwork.XMPPService
close, getInitParameter, getInitParameterNames, getIntInitParameter, getListInitParameter, log, log, open, setInitParameter, setServletContext, setXMPPConnection, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RECTANGLES_PATH

static final String RECTANGLES_PATH
This is accessed by helper classes. The helper classes were put in different files to help make this example clearer.

See Also:
Constant Field Values

RECTANGLES_NAMESPACE

static final String RECTANGLES_NAMESPACE
See Also:
Constant Field Values
Constructor Detail

DemoGradientService

public DemoGradientService()
Method Detail

init

public void init()
Loads in the documents we return via XMPP.

Overrides:
init in class XMPPService

destroy

public void destroy()
closes the rectangle broadcaster then sells it to Clear Channel.

Overrides:
destroy in class XMPPService

processDocumentRequest

public Element processDocumentRequest(String remoteJID,
                                      String path,
                                      Map parameters)
Processes document requests.

Specified by:
processDocumentRequest in class BaseGradientService
Parameters:
remoteJID - the document requester.
path - the document path
parameters - the request parameters. Ignored here.
Returns:
the document response IQ child element.

newSession

protected GradientSession newSession()
Description copied from class: BaseGradientService
Creates a new session. Should be overridden to return an extension of GradientSession if you want to do anything useful at the session level.

Overrides:
newSession in class BaseGradientService
Returns:
a new DemoGradientSession.