public class ServerSessionImpl extends 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,
String idHint) |
public ServerSessionImpl(BayeuxServerImpl bayeux)
public ServerSessionImpl(BayeuxServerImpl bayeux, LocalSessionImpl localSession, String idHint)
public BayeuxServerImpl getBayeuxServer()
public String getUserAgent()
getUserAgent
in interface ServerSession
public 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 void sweep(long now)
public Set<ServerChannel> getSubscriptions()
getSubscriptions
in interface ServerSession
public void addExtension(ServerSession.Extension extension)
addExtension
in interface ServerSession
public void removeExtension(ServerSession.Extension extension)
removeExtension
in interface ServerSession
public List<ServerSession.Extension> getExtensions()
getExtensions
in interface ServerSession
public void deliver(Session sender, ServerMessage.Mutable message)
deliver
in interface ServerSession
public void deliver(Session sender, String channelId, Object data)
deliver
in interface ServerSession
protected 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 Session
public void startBatch()
startBatch
in interface Session
public LocalSession getLocalSession()
getLocalSession
in interface ServerSession
public boolean isLocalSession()
isLocalSession
in interface ServerSession
public void addListener(ServerSession.ServerSessionListener listener)
addListener
in interface ServerSession
public Object getLock()
public Queue<ServerMessage> getQueue()
public boolean hasNonLazyMessages()
protected void addMessage(ServerMessage message)
public List<ServerMessage> takeQueue()
public void removeListener(ServerSession.ServerSessionListener listener)
removeListener
in interface ServerSession
public 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 Object getAttribute(String name)
getAttribute
in interface Session
public Set<String> getAttributeNames()
getAttributeNames
in interface Session
public Object removeAttribute(String name)
removeAttribute
in interface Session
public void setAttribute(String name, Object value)
setAttribute
in interface Session
public boolean isHandshook()
isHandshook
in interface Session
public boolean isConnected()
isConnected
in interface Session
public boolean isDisconnected()
protected boolean extendRecv(ServerMessage.Mutable message)
public void reAdvise()
public Map<String,Object> takeAdvice(ServerTransport transport)
public long getTimeout()
getTimeout
in interface ServerSession
public long getInterval()
getInterval
in interface ServerSession
public void setTimeout(long timeoutMS)
setTimeout
in interface ServerSession
public void setInterval(long intervalMS)
setInterval
in interface ServerSession
public 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 String dump()
dump
in interface org.eclipse.jetty.util.component.Dumpable
public void dump(Appendable out, String indent) throws IOException
dump
in interface org.eclipse.jetty.util.component.Dumpable
IOException
Copyright © 2008–2017 The CometD Project. All rights reserved.