public class ServerSessionImpl extends Object implements ServerSession, org.eclipse.jetty.util.component.Dumpable
ServerSession.AddedListener, ServerSession.AddListener, ServerSession.DeQueueListener, ServerSession.Extension, ServerSession.HeartBeatListener, ServerSession.MaxQueueListener, ServerSession.MessageListener, ServerSession.QueueListener, ServerSession.QueueMaxedListener, ServerSession.RemovedListener, ServerSession.RemoveListener, ServerSession.ServerSessionListener| Constructor and Description |
|---|
ServerSessionImpl(BayeuxServerImpl bayeux) |
ServerSessionImpl(BayeuxServerImpl bayeux,
LocalSessionImpl localSession,
String idHint) |
public ServerSessionImpl(BayeuxServerImpl bayeux)
public ServerSessionImpl(BayeuxServerImpl bayeux, LocalSessionImpl localSession, String idHint)
public BayeuxServerImpl getBayeuxServer()
public String getUserAgent()
getUserAgent in interface ServerSessionpublic void setUserAgent(String userAgent)
userAgent - the remote user agentpublic String getBrowserId()
public void setBrowserId(String browserId)
Sets a remote client identifier, typically a browser.
browserId - the remote client identifierprotected boolean sweep(long now)
public 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 List<ServerSession.Extension> getExtensions()
getExtensions in interface ServerSessionpublic void batch(Runnable batch)
batch in interface org.cometd.bayeux.Sessionpublic void deliver(org.cometd.bayeux.Session sender,
ServerMessage.Mutable message,
org.cometd.bayeux.Promise<Boolean> promise)
deliver in interface ServerSessionpublic void deliver(org.cometd.bayeux.Session sender,
String channelId,
Object data,
org.cometd.bayeux.Promise<Boolean> promise)
deliver in interface ServerSessionprotected void deliver1(ServerSession sender, ServerMessage.Mutable mutable, org.cometd.bayeux.Promise<Boolean> promise)
protected void extendOutgoing(ServerSession sender, ServerMessage.Mutable message, org.cometd.bayeux.Promise<ServerMessage.Mutable> promise)
protected boolean handshake(ServerMessage.Mutable message)
protected boolean connected()
public void disconnect()
disconnect in interface org.cometd.bayeux.Sessionpublic void startBatch()
startBatch in interface org.cometd.bayeux.Sessionpublic boolean endBatch()
endBatch in interface org.cometd.bayeux.Sessionpublic LocalSession getLocalSession()
getLocalSession in interface ServerSessionpublic boolean isLocalSession()
isLocalSession in interface ServerSessionpublic void addListener(ServerSession.ServerSessionListener listener)
addListener in interface ServerSessionpublic String getId()
getId in interface org.cometd.bayeux.Sessionpublic Object getLock()
public Queue<ServerMessage> getQueue()
public boolean hasNonLazyMessages()
protected void addMessage(ServerMessage message)
public List<ServerMessage> takeQueue(List<ServerMessage.Mutable> replies)
public void notifySuspended(ServerMessage message, long timeout)
public void notifyResumed(ServerMessage message, boolean timeout)
public void removeListener(ServerSession.ServerSessionListener listener)
removeListener in interface ServerSessionpublic List<ServerSession.ServerSessionListener> getListeners()
public void setScheduler(AbstractServerTransport.Scheduler newScheduler)
public boolean shouldSchedule()
public void flush()
public void destroyScheduler()
public void cancelExpiration(boolean metaConnect)
public void scheduleExpiration(long defaultInterval,
long defaultMaxInterval,
long metaConnectCycle)
public long getMaxInterval()
getMaxInterval in interface ServerSessionpublic void setMaxInterval(long maxInterval)
setMaxInterval in interface ServerSessionpublic Object getAttribute(String name)
getAttribute in interface org.cometd.bayeux.Sessionpublic Set<String> getAttributeNames()
getAttributeNames in interface org.cometd.bayeux.Sessionpublic Object removeAttribute(String name)
removeAttribute in interface org.cometd.bayeux.Sessionpublic void setAttribute(String name, Object value)
setAttribute in interface org.cometd.bayeux.Sessionpublic boolean isHandshook()
isHandshook in interface org.cometd.bayeux.Sessionpublic boolean isConnected()
isConnected in interface org.cometd.bayeux.Sessionpublic boolean isDisconnected()
public boolean isTerminated()
protected void extendIncoming(ServerMessage.Mutable message, org.cometd.bayeux.Promise<Boolean> promise)
public void reAdvise()
public Map<String,Object> takeAdvice(ServerTransport transport)
public ServerTransport getServerTransport()
getServerTransport in interface ServerSessionpublic void setServerTransport(ServerTransport transport)
public boolean updateServerEndPoint(Object newEndPoint)
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()
isBroadcastToPublisher in interface ServerSessionpublic void setBroadcastToPublisher(boolean value)
setBroadcastToPublisher in interface ServerSessionprotected boolean removed(ServerMessage message, boolean timeout)
message - the message that caused the removal, or nulltimeout - whether the session has been removed due a timeoutpublic void setMetaConnectDeliveryOnly(boolean meta)
setMetaConnectDeliveryOnly in interface ServerSessionpublic boolean isMetaConnectDeliveryOnly()
isMetaConnectDeliveryOnly in interface ServerSessionpublic boolean isAllowMessageDeliveryDuringHandshake()
public void setAllowMessageDeliveryDuringHandshake(boolean allow)
protected boolean subscribe(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 void dump(Appendable out, String indent) throws IOException
dump in interface org.eclipse.jetty.util.component.DumpableIOExceptionCopyright © 2008–2024 The CometD Project. All rights reserved.