nl.justobjects.pushlet.core
Class Command

java.lang.Object
  extended by nl.justobjects.pushlet.core.Command
All Implemented Interfaces:
Protocol

public class Command
extends java.lang.Object
implements Protocol

Wraps pushlet request/response data.

Version:
$Id: Command.java,v 1.4 2007/11/23 14:33:07 justb Exp $
Author:
Just van den Broecke - Just Objects ©

Field Summary
private  ClientAdapter clientAdapter
          Per-response client adapter.
 javax.servlet.http.HttpServletRequest httpReq
          HTTP Servlet GET/POST request.
 javax.servlet.http.HttpServletResponse httpRsp
          HTTP Servlet GET/POST response.
 Event reqEvent
          Pushlet request event.
private  Event rspEvent
          Pushlet response event.
 Session session
          Pushlet session.
 
Fields inherited from interface nl.justobjects.pushlet.core.Protocol
DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
 
Constructor Summary
private Command(Session aSession, Event aRequestEvent, javax.servlet.http.HttpServletRequest aHTTPReq, javax.servlet.http.HttpServletResponse aHTTPRsp)
          Constructor.
 
Method Summary
static Command create(Session aSession, Event aReqEvent, javax.servlet.http.HttpServletRequest aHTTPReq, javax.servlet.http.HttpServletResponse aHTTPRsp)
          Create new Command object.
protected  ClientAdapter createClientAdapter()
          Create client notifier based on "format" parameter passed in request.
 ClientAdapter getClientAdapter()
          Get client adapter for request.
 Event getResponseEvent()
          Get pushlet response event.
protected  void sendResponseHeaders()
          Sends HTTP response headers.
 void setResponseEvent(Event aResponseEvent)
          Set pushlet response event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reqEvent

public final Event reqEvent
Pushlet request event.


rspEvent

private Event rspEvent
Pushlet response event.


httpReq

public final javax.servlet.http.HttpServletRequest httpReq
HTTP Servlet GET/POST request.


httpRsp

public final javax.servlet.http.HttpServletResponse httpRsp
HTTP Servlet GET/POST response.


session

public final Session session
Pushlet session.


clientAdapter

private ClientAdapter clientAdapter
Per-response client adapter.

Constructor Detail

Command

private Command(Session aSession,
                Event aRequestEvent,
                javax.servlet.http.HttpServletRequest aHTTPReq,
                javax.servlet.http.HttpServletResponse aHTTPRsp)
Constructor.

Method Detail

create

public static Command create(Session aSession,
                             Event aReqEvent,
                             javax.servlet.http.HttpServletRequest aHTTPReq,
                             javax.servlet.http.HttpServletResponse aHTTPRsp)
Create new Command object.


setResponseEvent

public void setResponseEvent(Event aResponseEvent)
Set pushlet response event.


getResponseEvent

public Event getResponseEvent()
Get pushlet response event.


getClientAdapter

public ClientAdapter getClientAdapter()
                               throws PushletException
Get client adapter for request.

Throws:
PushletException

createClientAdapter

protected ClientAdapter createClientAdapter()
                                     throws PushletException
Create client notifier based on "format" parameter passed in request.

Throws:
PushletException

sendResponseHeaders

protected void sendResponseHeaders()
Sends HTTP response headers.



Copyright 2000-2003 - Just Objects B.V.