org.cometd.server
Class ServerSessionImpl
java.lang.Object
org.cometd.server.ServerSessionImpl
- All Implemented Interfaces:
- ServerSession, Session
public class ServerSessionImpl
- extends Object
- implements ServerSession
ServerSessionImpl
protected ServerSessionImpl(BayeuxServerImpl bayeux)
ServerSessionImpl
protected ServerSessionImpl(BayeuxServerImpl bayeux,
LocalSessionImpl localSession,
String idHint)
getUserAgent
public String getUserAgent()
- Get the userAgent.
- Specified by:
getUserAgent in interface ServerSession
- Returns:
- the userAgent
setUserAgent
public void setUserAgent(String userAgent)
- Set the userAgent.
- Parameters:
userAgent - the userAgent to set
sweep
protected void sweep(long now)
getExtensions
protected List<ServerSession.Extension> getExtensions()
getSubscriptions
public Set<ServerChannel> getSubscriptions()
- Specified by:
getSubscriptions in interface ServerSession
addExtension
public void addExtension(ServerSession.Extension extension)
- Specified by:
addExtension in interface ServerSession
removeExtension
public void removeExtension(ServerSession.Extension extension)
- Specified by:
removeExtension in interface ServerSession
batch
public void batch(Runnable batch)
- Specified by:
batch in interface Session
deliver
public void deliver(Session from,
ServerMessage.Mutable message)
- Specified by:
deliver in interface ServerSession
deliver
public void deliver(Session from,
String channelId,
Object data,
String id)
- Specified by:
deliver in interface ServerSession
doDeliver
protected void doDeliver(ServerSession from,
ServerMessage.Mutable mutable)
handshake
protected void handshake()
connect
protected void connect()
disconnect
public void disconnect()
- Specified by:
disconnect in interface Session
endBatch
public boolean endBatch()
- Specified by:
endBatch in interface Session
getLocalSession
public LocalSession getLocalSession()
- Specified by:
getLocalSession in interface ServerSession
isLocalSession
public boolean isLocalSession()
- Specified by:
isLocalSession in interface ServerSession
startBatch
public void startBatch()
- Specified by:
startBatch in interface Session
addListener
public void addListener(ServerSession.ServerSessionListener listener)
- Specified by:
addListener in interface ServerSession
getId
public String getId()
- Specified by:
getId in interface Session
getLock
public Object getLock()
getQueue
public Queue<ServerMessage> getQueue()
isQueueEmpty
public boolean isQueueEmpty()
addQueue
public void addQueue(ServerMessage message)
replaceQueue
public void replaceQueue(List<ServerMessage> queue)
takeQueue
public List<ServerMessage> takeQueue()
removeListener
public void removeListener(ServerSession.ServerSessionListener listener)
- Specified by:
removeListener in interface ServerSession
setScheduler
public void setScheduler(AbstractServerTransport.Scheduler scheduler)
flush
public void flush()
flushLazy
public void flushLazy()
cancelSchedule
public void cancelSchedule()
cancelIntervalTimeout
public void cancelIntervalTimeout()
startIntervalTimeout
public void startIntervalTimeout(long defaultInterval)
getAttribute
public Object getAttribute(String name)
- Specified by:
getAttribute in interface Session
getAttributeNames
public Set<String> getAttributeNames()
- Specified by:
getAttributeNames in interface Session
removeAttribute
public Object removeAttribute(String name)
- Specified by:
removeAttribute in interface Session
setAttribute
public void setAttribute(String name,
Object value)
- Specified by:
setAttribute in interface Session
isConnected
public boolean isConnected()
- Specified by:
isConnected in interface Session
isHandshook
public boolean isHandshook()
- Specified by:
isHandshook in interface Session
extendRecv
protected boolean extendRecv(ServerMessage.Mutable message)
extendSendMeta
protected boolean extendSendMeta(ServerMessage.Mutable message)
extendSendMessage
protected ServerMessage extendSendMessage(ServerMessage message)
getAdvice
public Object getAdvice()
reAdvise
public void reAdvise()
takeAdvice
public Object takeAdvice()
getTimeout
public long getTimeout()
getInterval
public long getInterval()
setTimeout
public void setTimeout(long timeoutMS)
setInterval
public void setInterval(long intervalMS)
removed
protected boolean removed(boolean timedout)
- Parameters:
timedout -
- Returns:
- True if the session was connected.
setMetaConnectDeliveryOnly
public void setMetaConnectDeliveryOnly(boolean meta)
isMetaConnectDeliveryOnly
public boolean isMetaConnectDeliveryOnly()
subscribedTo
protected void subscribedTo(ServerChannelImpl channel)
unsubscribedFrom
protected void unsubscribedFrom(ServerChannelImpl channel)
dump
protected void dump(StringBuilder b,
String indent)
toDetailString
public String toDetailString()
toString
public String toString()
- Overrides:
toString in class Object
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.
- Parameters:
timeout - the value to update the timeout to- See Also:
updateTransientInterval(long)
updateTransientInterval
public void updateTransientInterval(long interval)
- Updates the transient timeout with the given value.
- Parameters:
interval - the value to update the interval to- See Also:
updateTransientTimeout(long)
Copyright © 2008-2011 Dojo Foundation. All Rights Reserved.