Author: fhanik Date: Mon Jul 2 16:16:59 2007 New Revision: 552625 URL: http://svn.apache.org/viewvc?view=rev&rev=552625 Log: Skeleton files
Added: tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxChannel.java tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxClient.java tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxFilter.java tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxListener.java tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxPolicy.java tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxServlet.java tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/TomcatBayeux.java Added: tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxChannel.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxChannel.java?view=auto&rev=552625 ============================================================================== --- tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxChannel.java (added) +++ tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxChannel.java Mon Jul 2 16:16:59 2007 @@ -0,0 +1,75 @@ +package org.apache.comet.bayeux; + +import dojox.cometd.Channel; +import dojox.cometd.Client; + +public class BayeuxChannel implements Channel { + public BayeuxChannel() { + } + + /** + * getId + * + * @return String + * @todo Implement this dojox.cometd.Channel method + */ + public String getId() { + return ""; + } + + /** + * Is the channel persistent. + * + * @return true if the Channel will persist without any subscription. + * @todo Implement this dojox.cometd.Channel method + */ + public boolean isPersistent() { + return false; + } + + /** + * Publish a message This is equivalent to Bayeux.publish(fromClient,channel.getId(),data,msgId). + * + * @param fromClient Client + * @param data Object + * @param msgId String + * @todo Implement this dojox.cometd.Channel method + */ + public void publish(Client fromClient, Object data, String msgId) { + } + + /** + * + * @return true if the Channel has been removed, false if it was not possible to remove the channel + * @todo Implement this dojox.cometd.Channel method + */ + public boolean remove() { + return false; + } + + /** + * + * @param persistent true if the Channel will persist without any subscription. + * @todo Implement this dojox.cometd.Channel method + */ + public void setPersistent(boolean persistent) { + } + + /** + * Subscribe to a channel. + * + * @param subscriber Client + * @todo Implement this dojox.cometd.Channel method + */ + public void subscribe(Client subscriber) { + } + + /** + * Unsubscribe to a channel + * + * @param subscriber Client + * @todo Implement this dojox.cometd.Channel method + */ + public void unsubscribe(Client subscriber) { + } +} \ No newline at end of file Added: tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxClient.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxClient.java?view=auto&rev=552625 ============================================================================== --- tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxClient.java (added) +++ tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxClient.java Mon Jul 2 16:16:59 2007 @@ -0,0 +1,89 @@ +package org.apache.comet.bayeux; + +import java.util.Map; +import java.util.Queue; + +import dojox.cometd.Client; +import dojox.cometd.Listener; + +public class BayeuxClient implements Client { + public BayeuxClient() { + } + + /** + * Deliver a message to the client Deliver a message directly to the client. + * + * @param from Client + * @param message Map + * @todo Implement this dojox.cometd.Client method + */ + public void deliver(Client from, Map message) { + } + + /** + * getId + * + * @return String + * @todo Implement this dojox.cometd.Client method + */ + public String getId() { + return ""; + } + + /** + * getListener + * + * @return Listener + * @todo Implement this dojox.cometd.Client method + */ + public Listener getListener() { + return null; + } + + /** + * hasMessages + * + * @return boolean + * @todo Implement this dojox.cometd.Client method + */ + public boolean hasMessages() { + return false; + } + + /** + * + * @return True if the client is local + * @todo Implement this dojox.cometd.Client method + */ + public boolean isLocal() { + return false; + } + + /** + * remove + * + * @param timeout boolean + * @todo Implement this dojox.cometd.Client method + */ + public void remove(boolean timeout) { + } + + /** + * setListener + * + * @param listener Listener + * @todo Implement this dojox.cometd.Client method + */ + public void setListener(Listener listener) { + } + + /** + * Take any messages queued for a client. + * + * @return Queue + * @todo Implement this dojox.cometd.Client method + */ + public Queue takeMessages() { + return null; + } +} \ No newline at end of file Added: tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxFilter.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxFilter.java?view=auto&rev=552625 ============================================================================== --- tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxFilter.java (added) +++ tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxFilter.java Mon Jul 2 16:16:59 2007 @@ -0,0 +1,23 @@ +package org.apache.comet.bayeux; + +import dojox.cometd.Channel; +import dojox.cometd.Client; +import dojox.cometd.DataFilter; + +public class BayeuxFilter implements DataFilter { + public BayeuxFilter() { + } + + /** + * + * @param from Client + * @param to TODO + * @param data Object + * @return The filtered data. + * @throws IllegalStateException If the message should be aborted + * @todo Implement this dojox.cometd.DataFilter method + */ + public Object filter(Client from, Channel to, Object data) throws IllegalStateException { + return null; + } +} \ No newline at end of file Added: tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxListener.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxListener.java?view=auto&rev=552625 ============================================================================== --- tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxListener.java (added) +++ tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxListener.java Mon Jul 2 16:16:59 2007 @@ -0,0 +1,29 @@ +package org.apache.comet.bayeux; + +import dojox.cometd.Client; +import dojox.cometd.Listener; + +public class BayeuxListener implements Listener { + public BayeuxListener() { + } + + /** + * + * @param fromClient Client + * @param toChannel String + * @param data Object + * @param msgId String + * @todo Implement this dojox.cometd.Listener method + */ + public void deliver(Client fromClient, String toChannel, Object data, String msgId) { + } + + /** + * + * @param clientId String + * @param timeout boolean + * @todo Implement this dojox.cometd.Listener method + */ + public void removed(String clientId, boolean timeout) { + } +} \ No newline at end of file Added: tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxPolicy.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxPolicy.java?view=auto&rev=552625 ============================================================================== --- tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxPolicy.java (added) +++ tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxPolicy.java Mon Jul 2 16:16:59 2007 @@ -0,0 +1,50 @@ +package org.apache.comet.bayeux; + +import java.util.Map; + +import dojox.cometd.Client; +import dojox.cometd.SecurityPolicy; + +public class BayeuxPolicy implements SecurityPolicy { + public BayeuxPolicy() { + } + + /** + * canCreate + * + * @param client Client + * @param channel String + * @param message Map + * @return boolean + * @todo Implement this dojox.cometd.SecurityPolicy method + */ + public boolean canCreate(Client client, String channel, Map message) { + return false; + } + + /** + * canPublish + * + * @param client Client + * @param channel String + * @param messsage Map + * @return boolean + * @todo Implement this dojox.cometd.SecurityPolicy method + */ + public boolean canPublish(Client client, String channel, Map messsage) { + return false; + } + + /** + * canSubscribe + * + * @param client Client + * @param channel String + * @param messsage Map + * @return boolean + * @todo Implement this dojox.cometd.SecurityPolicy method + */ + public boolean canSubscribe(Client client, String channel, Map messsage) { + return false; + } +} \ No newline at end of file Added: tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxServlet.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxServlet.java?view=auto&rev=552625 ============================================================================== --- tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxServlet.java (added) +++ tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/BayeuxServlet.java Mon Jul 2 16:16:59 2007 @@ -0,0 +1,84 @@ +package org.apache.comet.bayeux; + +import java.io.IOException; +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; + +import org.apache.catalina.CometEvent; +import org.apache.catalina.CometProcessor; +import javax.servlet.http.HttpServletResponse; + +public class BayeuxServlet implements CometProcessor { + + protected ServletConfig servletConfig; + + public BayeuxServlet() { + } + + /** + * destroy + * + * @todo Implement this javax.servlet.Servlet method + */ + public void destroy() { + this.servletConfig = null; + } + + /** + * event + * + * @param cometEvent CometEvent + * @throws IOException + * @throws ServletException + * @todo Implement this org.apache.catalina.CometProcessor method + */ + public void event(CometEvent cometEvent) throws IOException, ServletException { + + } + + /** + * getServletConfig + * + * @return ServletConfig + * @todo Implement this javax.servlet.Servlet method + */ + public ServletConfig getServletConfig() { + return servletConfig; + } + + /** + * getServletInfo + * + * @return String + * @todo Implement this javax.servlet.Servlet method + */ + public String getServletInfo() { + return "Apache-Tomcat-Bayeux-Servlet"; + } + + /** + * init + * + * @param servletConfig ServletConfig + * @throws ServletException + * @todo Implement this javax.servlet.Servlet method + */ + public void init(ServletConfig servletConfig) throws ServletException { + this.servletConfig = servletConfig; + } + + /** + * service + * + * @param servletRequest ServletRequest + * @param servletResponse ServletResponse + * @throws ServletException + * @throws IOException + * @todo Implement this javax.servlet.Servlet method + */ + public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException { + ((HttpServletResponse)servletResponse).sendError(400,"Comet not supported in this container."); + } +} \ No newline at end of file Added: tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/TomcatBayeux.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/TomcatBayeux.java?view=auto&rev=552625 ============================================================================== --- tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/TomcatBayeux.java (added) +++ tomcat/sandbox/bayeux/java/org/apache/comet/bayeux/TomcatBayeux.java Mon Jul 2 16:16:59 2007 @@ -0,0 +1,128 @@ +package org.apache.comet.bayeux; + +import dojox.cometd.Bayeux; +import dojox.cometd.Channel; +import dojox.cometd.Client; +import dojox.cometd.DataFilter; +import dojox.cometd.Listener; +import dojox.cometd.SecurityPolicy; + +public class TomcatBayeux implements Bayeux { + public TomcatBayeux() { + } + + /** + * addFilter + * + * @param channels String + * @param filter DataFilter + * @todo Implement this dojox.cometd.Bayeux method + */ + public void addFilter(String channels, DataFilter filter) { + } + + /** + * getChannel + * + * @param channelId String + * @param create boolean + * @return Channel + * @todo Implement this dojox.cometd.Bayeux method + */ + public Channel getChannel(String channelId, boolean create) { + return null; + } + + /** + * + * @param client_id String + * @return dojox.cometd.Client + * @todo Implement this dojox.cometd.Bayeux method + */ + public Client getClient(String client_id) { + return null; + } + + /** + * getSecurityPolicy + * + * @return SecurityPolicy + * @todo Implement this dojox.cometd.Bayeux method + */ + public SecurityPolicy getSecurityPolicy() { + return null; + } + + /** + * hasChannel + * + * @param channel String + * @return boolean + * @todo Implement this dojox.cometd.Bayeux method + */ + public boolean hasChannel(String channel) { + return false; + } + + /** + * + * @param idprefix String + * @param listener Listener + * @return dojox.cometd.Client + * @todo Implement this dojox.cometd.Bayeux method + */ + public Client newClient(String idprefix, Listener listener) { + return null; + } + + /** + * Deliver data to a channel. + * + * @param fromClient The client sending the data + * @param toChannel The Channel ID to which the data is targetted + * @param data The data itself which must be an Object that can be encoded with [EMAIL PROTECTED] JSON}. + * @param msgId optional message ID or null for automatic generation of a message ID. + * @todo Implement this dojox.cometd.Bayeux method + */ + public void publish(Client fromClient, String toChannel, Object data, String msgId) { + } + + /** + * removeFilter + * + * @param channels String + * @param filter DataFilter + * @todo Implement this dojox.cometd.Bayeux method + */ + public void removeFilter(String channels, DataFilter filter) { + } + + /** + * setSecurityPolicy + * + * @param securityPolicy SecurityPolicy + * @todo Implement this dojox.cometd.Bayeux method + */ + public void setSecurityPolicy(SecurityPolicy securityPolicy) { + } + + /** + * Subscribe to a channel. + * + * @param toChannel String + * @param subscriber Client + * @todo Implement this dojox.cometd.Bayeux method + */ + public void subscribe(String toChannel, Client subscriber) { + } + + /** + * Unsubscribe to a channel + * + * @param toChannel String + * @param subscriber Client + * @todo Implement this dojox.cometd.Bayeux method + */ + public void unsubscribe(String toChannel, Client subscriber) { + } +} \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]