Package org.cometd.server
Class ServerSessionImpl
java.lang.Object
org.cometd.server.ServerSessionImpl
- All Implemented Interfaces:
ServerSession
,Session
,org.eclipse.jetty.util.component.Dumpable
public class ServerSessionImpl extends Object implements ServerSession, org.eclipse.jetty.util.component.Dumpable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cometd.bayeux.server.ServerSession
ServerSession.DeQueueListener, ServerSession.Extension, ServerSession.MaxQueueListener, ServerSession.MessageListener, ServerSession.QueueListener, ServerSession.RemoveListener, ServerSession.ServerSessionListener
-
Constructor Summary
Constructors Constructor Description ServerSessionImpl(BayeuxServerImpl bayeux)
ServerSessionImpl(BayeuxServerImpl bayeux, LocalSessionImpl localSession, String idHint)
-
Method Summary
-
Constructor Details
-
Method Details
-
getBayeuxServer
-
getUserAgent
- Specified by:
getUserAgent
in interfaceServerSession
- Returns:
- the remote user agent
-
setUserAgent
- Parameters:
userAgent
- the remote user agent
-
getBrowserId
- Returns:
- the remote client identifier
-
setBrowserId
Sets a remote client identifier, typically a browser.
- Parameters:
browserId
- the remote client identifier
-
sweep
protected void sweep(long now) -
getSubscriptions
- Specified by:
getSubscriptions
in interfaceServerSession
-
addExtension
- Specified by:
addExtension
in interfaceServerSession
-
removeExtension
- Specified by:
removeExtension
in interfaceServerSession
-
getExtensions
- Specified by:
getExtensions
in interfaceServerSession
-
batch
-
deliver
- Specified by:
deliver
in interfaceServerSession
-
deliver
- Specified by:
deliver
in interfaceServerSession
-
doDeliver
-
extendSend
-
handshake
protected void handshake() -
connected
protected void connected() -
disconnect
public void disconnect()- Specified by:
disconnect
in interfaceSession
-
startBatch
public void startBatch()- Specified by:
startBatch
in interfaceSession
-
endBatch
public boolean endBatch() -
getLocalSession
- Specified by:
getLocalSession
in interfaceServerSession
-
isLocalSession
public boolean isLocalSession()- Specified by:
isLocalSession
in interfaceServerSession
-
addListener
- Specified by:
addListener
in interfaceServerSession
-
getId
-
getLock
-
getQueue
-
hasNonLazyMessages
public boolean hasNonLazyMessages() -
addMessage
-
takeQueue
-
removeListener
- Specified by:
removeListener
in interfaceServerSession
-
getListeners
-
setScheduler
-
shouldSchedule
public boolean shouldSchedule() -
flush
public void flush() -
cancelSchedule
public void cancelSchedule() -
cancelExpiration
public void cancelExpiration(boolean metaConnect) -
scheduleExpiration
public void scheduleExpiration(long defaultInterval) -
getMaxInterval
protected long getMaxInterval() -
getAttribute
- Specified by:
getAttribute
in interfaceSession
-
getAttributeNames
- Specified by:
getAttributeNames
in interfaceSession
-
removeAttribute
- Specified by:
removeAttribute
in interfaceSession
-
setAttribute
- Specified by:
setAttribute
in interfaceSession
-
isHandshook
public boolean isHandshook()- Specified by:
isHandshook
in interfaceSession
-
isConnected
public boolean isConnected()- Specified by:
isConnected
in interfaceSession
-
isDisconnected
public boolean isDisconnected() -
extendRecv
-
reAdvise
public void reAdvise() -
takeAdvice
-
getTimeout
public long getTimeout()- Specified by:
getTimeout
in interfaceServerSession
-
getInterval
public long getInterval()- Specified by:
getInterval
in interfaceServerSession
-
setTimeout
public void setTimeout(long timeoutMS)- Specified by:
setTimeout
in interfaceServerSession
-
setInterval
public void setInterval(long intervalMS)- Specified by:
setInterval
in interfaceServerSession
-
isBroadcastToPublisher
public boolean isBroadcastToPublisher() -
setBroadcastToPublisher
public void setBroadcastToPublisher(boolean value) -
removed
protected boolean removed(boolean timedOut)- Parameters:
timedOut
- whether the session has been timed out- Returns:
- True if the session was connected.
-
setMetaConnectDeliveryOnly
public void setMetaConnectDeliveryOnly(boolean meta) -
isMetaConnectDeliveryOnly
public boolean isMetaConnectDeliveryOnly() -
isAllowMessageDeliveryDuringHandshake
public boolean isAllowMessageDeliveryDuringHandshake() -
setAllowMessageDeliveryDuringHandshake
public void setAllowMessageDeliveryDuringHandshake(boolean allow) -
subscribedTo
-
unsubscribedFrom
-
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)
-
dump
- Specified by:
dump
in interfaceorg.eclipse.jetty.util.component.Dumpable
-
dump
- Specified by:
dump
in interfaceorg.eclipse.jetty.util.component.Dumpable
- Throws:
IOException
-
toString
-