Class ServerSessionImpl

  • All Implemented Interfaces:
    ServerSession, org.cometd.bayeux.Session, org.eclipse.jetty.util.component.Dumpable

    public class ServerSessionImpl
    extends Object
    implements ServerSession, org.eclipse.jetty.util.component.Dumpable
    • Method Detail

      • setUserAgent

        public void setUserAgent​(String userAgent)
        Parameters:
        userAgent - the remote user agent
      • getBrowserId

        public String getBrowserId()
        Returns:
        the remote client identifier
      • setBrowserId

        public void setBrowserId​(String browserId)

        Sets a remote client identifier, typically a browser.

        Parameters:
        browserId - the remote client identifier
      • sweep

        protected void sweep​(long now)
      • batch

        public void batch​(Runnable batch)
        Specified by:
        batch in interface org.cometd.bayeux.Session
      • deliver

        public void deliver​(org.cometd.bayeux.Session sender,
                            String channelId,
                            Object data,
                            org.cometd.bayeux.Promise<Boolean> promise)
        Specified by:
        deliver in interface ServerSession
      • connected

        protected boolean connected()
      • disconnect

        public void disconnect()
        Specified by:
        disconnect in interface org.cometd.bayeux.Session
      • startBatch

        public void startBatch()
        Specified by:
        startBatch in interface org.cometd.bayeux.Session
      • endBatch

        public boolean endBatch()
        Specified by:
        endBatch in interface org.cometd.bayeux.Session
      • getId

        public String getId()
        Specified by:
        getId in interface org.cometd.bayeux.Session
      • getLock

        public Object getLock()
      • hasNonLazyMessages

        public boolean hasNonLazyMessages()
      • addMessage

        protected void addMessage​(ServerMessage message)
      • notifySuspended

        public void notifySuspended​(ServerMessage message,
                                    long timeout)
      • notifyResumed

        public void notifyResumed​(ServerMessage message,
                                  boolean timeout)
      • shouldSchedule

        public boolean shouldSchedule()
      • flush

        public void flush()
      • destroyScheduler

        public void destroyScheduler()
      • cancelExpiration

        public void cancelExpiration​(boolean metaConnect)
      • scheduleExpiration

        public void scheduleExpiration​(long defaultInterval,
                                       long defaultMaxInterval)
      • getAttribute

        public Object getAttribute​(String name)
        Specified by:
        getAttribute in interface org.cometd.bayeux.Session
      • getAttributeNames

        public Set<String> getAttributeNames()
        Specified by:
        getAttributeNames in interface org.cometd.bayeux.Session
      • removeAttribute

        public Object removeAttribute​(String name)
        Specified by:
        removeAttribute in interface org.cometd.bayeux.Session
      • setAttribute

        public void setAttribute​(String name,
                                 Object value)
        Specified by:
        setAttribute in interface org.cometd.bayeux.Session
      • isHandshook

        public boolean isHandshook()
        Specified by:
        isHandshook in interface org.cometd.bayeux.Session
      • isConnected

        public boolean isConnected()
        Specified by:
        isConnected in interface org.cometd.bayeux.Session
      • isDisconnected

        public boolean isDisconnected()
      • isTerminated

        public boolean isTerminated()
      • reAdvise

        public void reAdvise()
      • setServerTransport

        public void setServerTransport​(ServerTransport transport)
      • removed

        protected boolean removed​(ServerMessage message,
                                  boolean timeout)
        Parameters:
        message - the message that caused the removal, or null
        timeout - whether the session has been removed due a timeout
        Returns:
        True if the session was connected.
      • isAllowMessageDeliveryDuringHandshake

        public boolean isAllowMessageDeliveryDuringHandshake()
      • setAllowMessageDeliveryDuringHandshake

        public void setAllowMessageDeliveryDuringHandshake​(boolean allow)
      • calculateTimeout

        public long calculateTimeout​(long defaultTimeout)
      • calculateInterval

        public long calculateInterval​(long defaultInterval)
      • updateTransientTimeout

        public void updateTransientTimeout​(long timeout)
        Updates the transient timeout with the given value. The transient timeout is the one sent by the client, that should temporarily override the session/transport timeout, for example when the client sends {timeout:0}
        Parameters:
        timeout - the value to update the timeout to
        See Also:
        updateTransientInterval(long)
      • updateTransientInterval

        public void updateTransientInterval​(long interval)
        Updates the transient interval with the given value. The transient interval is the one sent by the client, that should temporarily override the session/transport interval, for example when the client sends {timeout:0,interval:60000}
        Parameters:
        interval - the value to update the interval to
        See Also:
        updateTransientTimeout(long)