public abstract class EzyAbstractSession extends com.tvd12.ezyfox.entity.EzyEntity implements EzySession, EzyDisconnectReasonAware, EzyDatagramChannelAware, EzyUdpClientAddressAware, EzyImmediateDeliverAware, EzyDroppedPacketsAware, EzyDatagramChannelPoolAware
| Constructor and Description |
|---|
EzyAbstractSession() |
| Modifier and Type | Method and Description |
|---|---|
void |
addReadBytes(long bytes)
Add read bytes
|
void |
addReadRequests(int requests)
add read requests
|
boolean |
addReceviedRequests(int requests)
add received requests
|
void |
addWrittenBytes(long bytes)
Add written bytes
|
void |
addWrittenResponses(int responses)
add written responses
|
void |
close()
close this session
|
void |
destroy() |
void |
disconnect(com.tvd12.ezyfox.constant.EzyConstant disconnectReason)
disconnect this session
|
boolean |
equals(Object obj) |
SocketAddress |
getClientAddress()
Get client full ip address
|
<T> T |
getConnection()
Get connection
|
Lock |
getLock(String name) |
String |
getName() |
SocketAddress |
getServerAddress()
Get server full ip address
|
int |
hashCode() |
boolean |
isIdle() |
void |
send(EzyPacket packet) |
void |
sendNow(EzyPacket packet) |
void |
setActivated(boolean value) |
void |
setOwner(EzyUser owner) |
String |
toString() |
containsKey, getProperties, getProperty, getProperty, removeProperty, setProperties, setPropertyclone, finalize, getClass, notify, notifyAll, wait, wait, waitdisconnect, getBeforeToken, getChannel, getClientId, getClientKey, getClientType, getClientVersion, getConnectionType, getCreationTime, getDatagramChannel, getDatagramChannelPool, getDisconnectReason, getExtensionRequestQueue, getId, getLastActivityTime, getLastReadTime, getLastWriteTime, getLoggedInTime, getMaxIdleTime, getMaxWaitingTime, getOwnerName, getPacketQueue, getPrivateKey, getPublicKey, getReadBytes, getReadRequests, getSessionKey, getSystemRequestQueue, getToken, getUdpClientAddress, getWrittenBytes, getWrittenResponses, isActivated, isDestroyed, isLoggedIn, isStreamingEnable, setChannel, setClientId, setClientKey, setClientType, setClientVersion, setCreationTime, setLastActivityTime, setLastReadTime, setLastWriteTime, setLoggedIn, setLoggedInTime, setMaxIdleTime, setMaxWaitingTime, setPrivateKey, setPublicKey, setSessionKey, setTokenremoveProperty, setProperties, setPropertycontainsKey, getProperties, getProperty, getProperty, getPropertysetDisconnectReasonsetDatagramChannelsetUdpClientAddresssetImmediateDeliversetDroppedPacketssetDatagramChannelPoolprotected long id
protected String name
protected String clientId
protected String ownerName
protected long creationTime
protected long lastReadTime
protected long lastWriteTime
protected long readBytes
protected long writtenBytes
protected long lastActivityTime
protected long loggedInTime
protected int readRequests
protected int writtenResponses
protected byte[] privateKey
protected byte[] publicKey
protected byte[] clientKey
protected byte[] sessionKey
protected volatile boolean loggedIn
protected volatile boolean activated
protected volatile boolean destroyed
protected volatile boolean streamingEnable
protected String token
protected String clientType
protected String clientVersion
protected String beforeToken
protected com.tvd12.ezyfox.constant.EzyConstant connectionType
protected com.tvd12.ezyfox.constant.EzyConstant disconnectReason
protected SocketAddress udpClientAddress
protected DatagramChannel datagramChannel
protected EzyDatagramChannelPool datagramChannelPool
protected long maxWaitingTime
protected long maxIdleTime
protected EzyChannel channel
protected EzyDroppedPackets droppedPackets
protected EzyImmediateDeliver immediateDeliver
protected EzySessionTicketsQueue sessionTicketsQueue
protected EzySocketDisconnectionQueue disconnectionQueue
protected EzyPacketQueue packetQueue
protected EzyRequestQueue systemRequestQueue
protected EzyRequestQueue extensionRequestQueue
protected EzyRequestFrame requestFrameInSecond
protected transient EzySessionDelegate delegate
protected volatile boolean disconnectionRegistered
protected Object disconnectionLock
public void setOwner(EzyUser owner)
public void addReadBytes(long bytes)
EzySessionaddReadBytes in interface EzySessionbytes - the read bytespublic void addWrittenBytes(long bytes)
EzySessionaddWrittenBytes in interface EzySessionbytes - the written bytespublic void addReadRequests(int requests)
EzySessionaddReadRequests in interface EzySessionrequests - number of read requestspublic boolean addReceviedRequests(int requests)
EzySessionaddReceviedRequests in interface EzySessionrequests - number of received requestspublic void addWrittenResponses(int responses)
EzySessionaddWrittenResponses in interface EzySessionresponses - number of responsespublic void setActivated(boolean value)
setActivated in interface EzySessionvalue - session is active or notpublic boolean isIdle()
isIdle in interface EzySessionpublic Lock getLock(String name)
getLock in interface EzySessionname - the lock namepublic final void send(EzyPacket packet)
send in interface EzyDeliverpublic void sendNow(EzyPacket packet)
sendNow in interface EzyDeliverpublic void disconnect(com.tvd12.ezyfox.constant.EzyConstant disconnectReason)
EzySessiondisconnect in interface EzySessiondisconnectReason - the reasonpublic void close()
EzySessionclose in interface EzySessionpublic <T> T getConnection()
EzySessiongetConnection in interface EzySessionT - the connection typepublic SocketAddress getServerAddress()
EzySessiongetServerAddress in interface EzySessionpublic SocketAddress getClientAddress()
EzySessiongetClientAddress in interface EzySessionpublic String getName()
getName in interface com.tvd12.ezyfox.constant.EzyHasNamepublic void destroy()
destroy in interface com.tvd12.ezyfox.util.EzyDestroyableCopyright © 2021 Young Monkeys. All rights reserved.