public class OClientConnectionManager extends Object
Modifier and Type | Field and Description |
---|---|
protected ConcurrentMap<Integer,OClientConnection> |
connections |
protected AtomicInteger |
connectionSerial |
protected ConcurrentMap<OHashToken,OClientSessions> |
sessions |
protected TimerTask |
timerTask |
Constructor and Description |
---|
OClientConnectionManager(OServer server) |
Modifier and Type | Method and Description |
---|---|
void |
cleanExpiredConnections() |
OClientConnection |
connect(ONetworkProtocol iProtocol)
Create a connection.
|
OClientConnection |
connect(ONetworkProtocol iProtocol,
OClientConnection connection,
byte[] tokenBytes,
OTokenHandler handler)
Create a connection.
|
boolean |
disconnect(int iChannelId)
Disconnects a client connections
|
void |
disconnect(OClientConnection iConnection) |
OClientConnection |
getConnection(int iChannelId,
ONetworkProtocol protocol)
Retrieves the connection by id.
|
OClientConnection |
getConnection(String iAddress)
Retrieves the connection by address/port.
|
List<OClientConnection> |
getConnections() |
OClientSessions |
getSession(OClientConnection connection) |
int |
getTotal() |
boolean |
has(int id) |
void |
interrupt(int iChannelId)
Interrupt the associated network manager.
|
void |
kill(int iChannelId)
Disconnects and kill the associated network manager.
|
void |
kill(OClientConnection connection)
Disconnects and kill the associated network manager.
|
void |
killAllChannels() |
void |
pushDistribCfg2Clients(ODocument iConfig)
Pushes the distributed configuration to all the connected clients.
|
OClientConnection |
reConnect(ONetworkProtocol iProtocol,
byte[] tokenBytes,
OToken token) |
void |
shutdown() |
protected final ConcurrentMap<Integer,OClientConnection> connections
protected AtomicInteger connectionSerial
protected final ConcurrentMap<OHashToken,OClientSessions> sessions
protected final TimerTask timerTask
public OClientConnectionManager(OServer server)
public void cleanExpiredConnections()
public OClientConnection connect(ONetworkProtocol iProtocol)
iProtocol
- protocol which will be used by connectionpublic OClientConnection connect(ONetworkProtocol iProtocol, OClientConnection connection, byte[] tokenBytes, OTokenHandler handler)
iProtocol
- protocol which will be used by connectionpublic OClientConnection reConnect(ONetworkProtocol iProtocol, byte[] tokenBytes, OToken token)
public OClientConnection getConnection(int iChannelId, ONetworkProtocol protocol)
iChannelId
- id of connectionpublic OClientConnection getConnection(String iAddress)
iAddress
- The address as string in the format address as format public void kill(int iChannelId)
iChannelId
- id of connectionpublic void kill(OClientConnection connection)
connection
- connection to killpublic boolean has(int id)
public void interrupt(int iChannelId)
iChannelId
- id of connectionpublic boolean disconnect(int iChannelId)
iChannelId
- id of connectionpublic void disconnect(OClientConnection iConnection)
public List<OClientConnection> getConnections()
public int getTotal()
public void pushDistribCfg2Clients(ODocument iConfig)
public void shutdown()
public void killAllChannels()
public OClientSessions getSession(OClientConnection connection)
Copyright © 2009–2020 OrientDB. All rights reserved.