Class OClientConnectionManager
java.lang.Object
com.orientechnologies.orient.server.OClientConnectionManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConcurrentMap<Integer,OClientConnection> protected AtomicIntegerprotected final ConcurrentMap<OHashToken,OClientSessions> protected final TimerTask -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect(ONetworkProtocol iProtocol) Create a connection.connect(ONetworkProtocol iProtocol, OClientConnection connection, byte[] tokenBytes) Create a connection.booleandisconnect(int iChannelId) Disconnects a client connectionsvoiddisconnect(OClientConnection iConnection) getConnection(int iChannelId, ONetworkProtocol protocol) Retrieves the connection by id.getConnection(String iAddress) Retrieves the connection by address/port.getSession(OClientConnection connection) intgetTotal()booleanhas(int id) voidinterrupt(int iChannelId) Interrupt the associated network manager.voidkill(int iChannelId) Disconnects and kill the associated network manager.voidkill(OClientConnection connection) Disconnects and kill the associated network manager.voidvoidpushDistribCfg2Clients(ODocument iConfig) Pushes the distributed configuration to all the connected clients.reConnect(ONetworkProtocol iProtocol, byte[] tokenBytes) voidshutdown()
-
Field Details
-
connections
-
connectionSerial
-
sessions
-
timerTask
-
-
Constructor Details
-
OClientConnectionManager
-
-
Method Details
-
cleanExpiredConnections
public void cleanExpiredConnections() -
connect
Create a connection.- Parameters:
iProtocol- protocol which will be used by connection- Returns:
- new connection
-
connect
public OClientConnection connect(ONetworkProtocol iProtocol, OClientConnection connection, byte[] tokenBytes) Create a connection.- Parameters:
iProtocol- protocol which will be used by connection- Returns:
- new connection
-
reConnect
-
getConnection
Retrieves the connection by id.- Parameters:
iChannelId- id of connection- Returns:
- The connection if any, otherwise null
-
getConnection
Retrieves the connection by address/port.- Parameters:
iAddress- The address as string in the format address as format: - Returns:
- The connection if any, otherwise null
-
kill
public void kill(int iChannelId) Disconnects and kill the associated network manager.- Parameters:
iChannelId- id of connection
-
kill
Disconnects and kill the associated network manager.- Parameters:
connection- connection to kill
-
has
public boolean has(int id) -
interrupt
public void interrupt(int iChannelId) Interrupt the associated network manager.- Parameters:
iChannelId- id of connection
-
disconnect
public boolean disconnect(int iChannelId) Disconnects a client connections- Parameters:
iChannelId- id of connection- Returns:
- true if was last one, otherwise false
-
disconnect
-
getConnections
-
getTotal
public int getTotal() -
pushDistribCfg2Clients
Pushes the distributed configuration to all the connected clients. -
shutdown
public void shutdown() -
killAllChannels
public void killAllChannels() -
getSession
-