Class AbstractServerTransport

java.lang.Object
org.cometd.common.AbstractTransport
org.cometd.server.AbstractServerTransport
All Implemented Interfaces:
ServerTransport, Transport, org.eclipse.jetty.util.component.Dumpable
Direct Known Subclasses:
AbstractHttpTransport, AbstractWebSocketTransport

public abstract class AbstractServerTransport extends AbstractTransport implements ServerTransport, org.eclipse.jetty.util.component.Dumpable

The base class of all server transports.

Each derived Transport class should declare all options that it supports by calling AbstractTransport.setOption(String, Object) for each option. Then during the call the init(), each transport should call the variants of AbstractTransport.getOption(String) to obtained the configured value for the option.

  • Field Details Link icon

  • Constructor Details Link icon

  • Method Details Link icon

    • newMetaConnectCycle Link icon

      public long newMetaConnectCycle()
    • getInterval Link icon

      public long getInterval()
      Specified by:
      getInterval in interface ServerTransport
      Returns:
      the interval in milliseconds
    • getMaxInterval Link icon

      public long getMaxInterval()
      Specified by:
      getMaxInterval in interface ServerTransport
      Returns:
      the maxInterval in milliseconds
    • getMaxLazyTimeout Link icon

      public long getMaxLazyTimeout()
      Specified by:
      getMaxLazyTimeout in interface ServerTransport
      Returns:
      the max lazy timeout in milliseconds before flushing lazy messages
    • getTimeout Link icon

      public long getTimeout()
      Specified by:
      getTimeout in interface ServerTransport
      Returns:
      the timeout in milliseconds
    • isMetaConnectDeliveryOnly Link icon

      public boolean isMetaConnectDeliveryOnly()
      Specified by:
      isMetaConnectDeliveryOnly in interface ServerTransport
      Returns:
      whether the messages are delivered to clients exclusively via the "/meta/connect" channel
    • setMetaConnectDeliveryOnly Link icon

      public void setMetaConnectDeliveryOnly(boolean meta)
    • isHandshakeReconnect Link icon

      public boolean isHandshakeReconnect()
    • setHandshakeReconnect Link icon

      public void setHandshakeReconnect(boolean handshakeReconnect)
    • isAllowMessageDeliveryDuringHandshake Link icon

      public boolean isAllowMessageDeliveryDuringHandshake()
    • setAllowMessageDeliveryDuringHandshake Link icon

      public void setAllowMessageDeliveryDuringHandshake(boolean allow)
    • getMaxMessageSize Link icon

      public int getMaxMessageSize()
    • setMaxMessageSize Link icon

      public void setMaxMessageSize(int maxMessageSize)
    • init Link icon

      public void init()
      Initializes the transport, resolving default and direct options.
    • destroy Link icon

      public void destroy()
    • getJSONContextServer Link icon

      protected JSONContextServer getJSONContextServer()
    • parseMessages Link icon

      public List<ServerMessage.Mutable> parseMessages(String json) throws ParseException
      Throws:
      ParseException
    • getBayeuxServer Link icon

      public BayeuxServerImpl getBayeuxServer()
      Returns:
      the BayeuxServer object
    • setInterval Link icon

      public void setInterval(long interval)
      Parameters:
      interval - the interval in milliseconds
    • setMaxInterval Link icon

      public void setMaxInterval(long maxInterval)
      Parameters:
      maxInterval - the maxInterval in milliseconds
    • setTimeout Link icon

      public void setTimeout(long timeout)
      Parameters:
      timeout - the timeout in milliseconds
    • setMaxLazyTimeout Link icon

      public void setMaxLazyTimeout(long maxLazyTimeout)
      Parameters:
      maxLazyTimeout - the maxLazyTimeout in milliseconds
    • sweep Link icon

      protected void sweep()
      Housekeeping sweep, called a regular intervals
    • processReply Link icon

      public void processReply(ServerSessionImpl session, ServerMessage.Mutable reply, Promise<ServerMessage.Mutable> promise)
    • toJSON Link icon

      protected String toJSON(ServerMessage msg)
    • allowMessageDeliveryDuringHandshake Link icon

      public boolean allowMessageDeliveryDuringHandshake(ServerSessionImpl session)
    • scheduleExpiration Link icon

      public void scheduleExpiration(ServerSessionImpl session, long metaConnectCycle)
    • dump Link icon

      public void dump(Appendable out, String indent) throws IOException
      Specified by:
      dump in interface org.eclipse.jetty.util.component.Dumpable
      Throws:
      IOException
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object