public class ServerSessionImpl extends java.lang.Object implements ServerSession, org.eclipse.jetty.util.component.Dumpable
ServerSession.DeQueueListener, ServerSession.Extension, ServerSession.MaxQueueListener, ServerSession.MessageListener, ServerSession.QueueListener, ServerSession.RemoveListener, ServerSession.ServerSessionListener| Constructor and Description |
|---|
ServerSessionImpl(BayeuxServerImpl bayeux) |
ServerSessionImpl(BayeuxServerImpl bayeux,
LocalSessionImpl localSession,
java.lang.String idHint) |
| Modifier and Type | Method and Description |
|---|---|
void |
addExtension(ServerSession.Extension extension) |
void |
addListener(ServerSession.ServerSessionListener listener) |
protected void |
addMessage(ServerMessage message) |
void |
batch(java.lang.Runnable batch) |
long |
calculateInterval(long defaultInterval) |
long |
calculateTimeout(long defaultTimeout) |
void |
cancelExpiration(boolean metaConnect) |
void |
cancelSchedule() |
protected void |
connected() |
void |
deliver(Session sender,
ServerMessage.Mutable message) |
void |
deliver(Session sender,
java.lang.String channelId,
java.lang.Object data) |
void |
disconnect() |
protected void |
doDeliver(ServerSession sender,
ServerMessage.Mutable mutable) |
java.lang.String |
dump() |
void |
dump(java.lang.Appendable out,
java.lang.String indent) |
boolean |
endBatch() |
protected boolean |
extendRecv(ServerMessage.Mutable message) |
protected ServerMessage.Mutable |
extendSend(ServerMessage.Mutable mutable) |
void |
flush() |
java.lang.Object |
getAttribute(java.lang.String name) |
java.util.Set<java.lang.String> |
getAttributeNames() |
BayeuxServerImpl |
getBayeuxServer() |
java.lang.String |
getBrowserId() |
java.util.List<ServerSession.Extension> |
getExtensions() |
java.lang.String |
getId() |
long |
getInterval() |
java.util.List<ServerSession.ServerSessionListener> |
getListeners() |
LocalSession |
getLocalSession() |
java.lang.Object |
getLock() |
protected long |
getMaxInterval() |
java.util.Queue<ServerMessage> |
getQueue() |
java.util.Set<ServerChannel> |
getSubscriptions() |
long |
getTimeout() |
java.lang.String |
getUserAgent() |
protected void |
handshake() |
boolean |
hasNonLazyMessages() |
boolean |
isAllowMessageDeliveryDuringHandshake() |
boolean |
isBroadcastToPublisher() |
boolean |
isConnected() |
boolean |
isDisconnected() |
boolean |
isHandshook() |
boolean |
isLocalSession() |
boolean |
isMetaConnectDeliveryOnly() |
void |
reAdvise() |
java.lang.Object |
removeAttribute(java.lang.String name) |
protected boolean |
removed(boolean timedOut) |
void |
removeExtension(ServerSession.Extension extension) |
void |
removeListener(ServerSession.ServerSessionListener listener) |
void |
scheduleExpiration(long defaultInterval) |
void |
setAllowMessageDeliveryDuringHandshake(boolean allow) |
void |
setAttribute(java.lang.String name,
java.lang.Object value) |
void |
setBroadcastToPublisher(boolean value) |
void |
setBrowserId(java.lang.String browserId)
Sets a remote client identifier, typically a browser.
|
void |
setInterval(long intervalMS) |
void |
setMetaConnectDeliveryOnly(boolean meta) |
void |
setScheduler(AbstractServerTransport.Scheduler newScheduler) |
void |
setTimeout(long timeoutMS) |
void |
setUserAgent(java.lang.String userAgent) |
boolean |
shouldSchedule() |
void |
startBatch() |
protected void |
subscribedTo(ServerChannelImpl channel) |
protected void |
sweep(long now) |
java.util.Map<java.lang.String,java.lang.Object> |
takeAdvice(ServerTransport transport) |
java.util.List<ServerMessage> |
takeQueue() |
java.lang.String |
toString() |
protected void |
unsubscribedFrom(ServerChannelImpl channel) |
void |
updateTransientInterval(long interval)
Updates the transient interval with the given value.
|
void |
updateTransientTimeout(long timeout)
Updates the transient timeout with the given value.
|
public ServerSessionImpl(BayeuxServerImpl bayeux)
public ServerSessionImpl(BayeuxServerImpl bayeux, LocalSessionImpl localSession, java.lang.String idHint)
public BayeuxServerImpl getBayeuxServer()
public java.lang.String getUserAgent()
getUserAgent in interface ServerSessionpublic void setUserAgent(java.lang.String userAgent)
userAgent - the remote user agentpublic java.lang.String getBrowserId()
public void setBrowserId(java.lang.String browserId)
Sets a remote client identifier, typically a browser.
browserId - the remote client identifierprotected void sweep(long now)
public java.util.Set<ServerChannel> getSubscriptions()
getSubscriptions in interface ServerSessionpublic void addExtension(ServerSession.Extension extension)
addExtension in interface ServerSessionpublic void removeExtension(ServerSession.Extension extension)
removeExtension in interface ServerSessionpublic java.util.List<ServerSession.Extension> getExtensions()
getExtensions in interface ServerSessionpublic void deliver(Session sender, ServerMessage.Mutable message)
deliver in interface ServerSessionpublic void deliver(Session sender, java.lang.String channelId, java.lang.Object data)
deliver in interface ServerSessionprotected void doDeliver(ServerSession sender, ServerMessage.Mutable mutable)
protected ServerMessage.Mutable extendSend(ServerMessage.Mutable mutable)
protected void handshake()
protected void connected()
public void disconnect()
disconnect in interface Sessionpublic void startBatch()
startBatch in interface Sessionpublic LocalSession getLocalSession()
getLocalSession in interface ServerSessionpublic boolean isLocalSession()
isLocalSession in interface ServerSessionpublic void addListener(ServerSession.ServerSessionListener listener)
addListener in interface ServerSessionpublic java.lang.Object getLock()
public java.util.Queue<ServerMessage> getQueue()
public boolean hasNonLazyMessages()
protected void addMessage(ServerMessage message)
public java.util.List<ServerMessage> takeQueue()
public void removeListener(ServerSession.ServerSessionListener listener)
removeListener in interface ServerSessionpublic java.util.List<ServerSession.ServerSessionListener> getListeners()
public void setScheduler(AbstractServerTransport.Scheduler newScheduler)
public boolean shouldSchedule()
public void flush()
public void cancelSchedule()
public void cancelExpiration(boolean metaConnect)
public void scheduleExpiration(long defaultInterval)
protected long getMaxInterval()
public java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface Sessionpublic java.util.Set<java.lang.String> getAttributeNames()
getAttributeNames in interface Sessionpublic java.lang.Object removeAttribute(java.lang.String name)
removeAttribute in interface Sessionpublic void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in interface Sessionpublic boolean isHandshook()
isHandshook in interface Sessionpublic boolean isConnected()
isConnected in interface Sessionpublic boolean isDisconnected()
protected boolean extendRecv(ServerMessage.Mutable message)
public void reAdvise()
public java.util.Map<java.lang.String,java.lang.Object> takeAdvice(ServerTransport transport)
public long getTimeout()
getTimeout in interface ServerSessionpublic long getInterval()
getInterval in interface ServerSessionpublic void setTimeout(long timeoutMS)
setTimeout in interface ServerSessionpublic void setInterval(long intervalMS)
setInterval in interface ServerSessionpublic boolean isBroadcastToPublisher()
public void setBroadcastToPublisher(boolean value)
protected boolean removed(boolean timedOut)
timedOut - whether the session has been timed outpublic void setMetaConnectDeliveryOnly(boolean meta)
public boolean isMetaConnectDeliveryOnly()
public boolean isAllowMessageDeliveryDuringHandshake()
public void setAllowMessageDeliveryDuringHandshake(boolean allow)
protected void subscribedTo(ServerChannelImpl channel)
protected void unsubscribedFrom(ServerChannelImpl channel)
public long calculateTimeout(long defaultTimeout)
public long calculateInterval(long defaultInterval)
public void updateTransientTimeout(long timeout)
timeout - the value to update the timeout toupdateTransientInterval(long)public void updateTransientInterval(long interval)
interval - the value to update the interval toupdateTransientTimeout(long)public java.lang.String dump()
dump in interface org.eclipse.jetty.util.component.Dumpablepublic void dump(java.lang.Appendable out,
java.lang.String indent)
throws java.io.IOException
dump in interface org.eclipse.jetty.util.component.Dumpablejava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2019 The CometD Project. All rights reserved.