Class AbstractServerTransport

    • Field Detail

      • MAX_INTERVAL_OPTION

        public static final java.lang.String MAX_INTERVAL_OPTION
        See Also:
        Constant Field Values
      • MAX_PROCESSING_OPTION

        public static final java.lang.String MAX_PROCESSING_OPTION
        See Also:
        Constant Field Values
      • MAX_LAZY_TIMEOUT_OPTION

        public static final java.lang.String MAX_LAZY_TIMEOUT_OPTION
        See Also:
        Constant Field Values
      • META_CONNECT_DELIVERY_OPTION

        public static final java.lang.String META_CONNECT_DELIVERY_OPTION
        See Also:
        Constant Field Values
      • MAX_QUEUE_OPTION

        public static final java.lang.String MAX_QUEUE_OPTION
        See Also:
        Constant Field Values
      • JSON_CONTEXT_OPTION

        public static final java.lang.String JSON_CONTEXT_OPTION
        See Also:
        Constant Field Values
      • HANDSHAKE_RECONNECT_OPTION

        public static final java.lang.String HANDSHAKE_RECONNECT_OPTION
        See Also:
        Constant Field Values
      • ALLOW_MESSAGE_DELIVERY_DURING_HANDSHAKE

        public static final java.lang.String ALLOW_MESSAGE_DELIVERY_DURING_HANDSHAKE
        See Also:
        Constant Field Values
      • MAX_MESSAGE_SIZE_OPTION

        public static final java.lang.String MAX_MESSAGE_SIZE_OPTION
        See Also:
        Constant Field Values
      • _logger

        protected final org.slf4j.Logger _logger
    • Constructor Detail

      • AbstractServerTransport

        protected AbstractServerTransport​(BayeuxServerImpl bayeux,
                                          java.lang.String name)

        The constructor is passed the BayeuxServerImpl instance for the transport. The BayeuxServerImpl.getOptions() map is populated with the default options known by this transport. The options are then inspected again when init() is called, to set the actual values used. The options are arranged into a naming hierarchy by derived classes adding prefix by calling add AbstractTransport.setOptionPrefix(String). Calls to AbstractTransport.getOption(String) will use the list of prefixes to search for the most specific option set.

        Parameters:
        bayeux - the BayeuxServer implementation
        name - the name of the transport
    • Method Detail

      • getAdvice

        public java.lang.Object getAdvice()
        Description copied from interface: ServerTransport

        The advice that this transport sends to inform the client about transport (re)connection.

        Specified by:
        getAdvice in interface ServerTransport
        Returns:
        the advice object sent by the server transport
      • getInterval

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

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

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

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

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

        public void setMetaConnectDeliveryOnly​(boolean meta)
      • isHandshakeReconnect

        public boolean isHandshakeReconnect()
      • setHandshakeReconnect

        public void setHandshakeReconnect​(boolean handshakeReconnect)
      • isAllowMessageDeliveryDuringHandshake

        public boolean isAllowMessageDeliveryDuringHandshake()
      • setAllowMessageDeliveryDuringHandshake

        public void setAllowMessageDeliveryDuringHandshake​(boolean allow)
      • getMaxMessageSize

        public int getMaxMessageSize()
      • setMaxMessageSize

        public void setMaxMessageSize​(int maxMessageSize)
      • init

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

        public void destroy()
      • parseMessages

        protected ServerMessage.Mutable[] parseMessages​(java.io.BufferedReader reader,
                                                        boolean jsonDebug)
                                                 throws java.text.ParseException,
                                                        java.io.IOException
        Throws:
        java.text.ParseException
        java.io.IOException
      • parseMessages

        protected ServerMessage.Mutable[] parseMessages​(java.lang.String json)
                                                 throws java.text.ParseException
        Throws:
        java.text.ParseException
      • getBayeux

        public BayeuxServerImpl getBayeux()
        Returns:
        the BayeuxServer object
      • setInterval

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

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

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

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

        protected void sweep()
        Housekeeping sweep, called a regular intervals
      • toJSONBytes

        protected byte[] toJSONBytes​(ServerMessage message,
                                     java.lang.String encoding)
      • allowMessageDeliveryDuringHandshake

        protected boolean allowMessageDeliveryDuringHandshake​(ServerSessionImpl session)
      • dump

        public java.lang.String dump()
        Specified by:
        dump in interface org.eclipse.jetty.util.component.Dumpable
      • dump

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object