public class ONetworkProtocolBinary extends ONetworkProtocol
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected OChannelBinary |
channel |
protected int |
clientTxId |
protected Level |
logClientExceptions |
protected boolean |
logClientFullStackTrace |
protected boolean |
okSent |
protected int |
requestType |
server
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
ONetworkProtocolBinary(OServer server) |
ONetworkProtocolBinary(OServer server,
String iThreadName) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterOperationRequest(OClientConnection connection) |
protected void |
beginResponse() |
protected void |
checkServerAccess(String iResource,
OClientConnection connection) |
void |
config(OServerNetworkListener iListener,
OServer iServer,
Socket iSocket,
OContextConfiguration iConfig) |
protected void |
endResponse() |
protected void |
execute() |
OBinaryRequestExecutor |
executor(OClientConnection connection) |
OChannelBinary |
getChannel() |
static byte[] |
getRecordBytes(OClientConnection connection,
ORecord iRecord) |
static String |
getRecordSerializerName(OClientConnection connection) |
String |
getRemoteAddress() |
int |
getRequestType() |
String |
getType() |
int |
getVersion() |
protected void |
handleConnectionError(OClientConnection connection,
Throwable e) |
void |
initVariables(OServer server,
OChannelBinary channel)
Internal varialbe injection useful for testing.
|
OBinaryPushResponse |
push(OBinaryPushRequest request) |
protected void |
sendError(OClientConnection connection,
int iClientTxId,
Throwable t) |
protected void |
sendErrorOrDropConnection(OClientConnection connection,
int iClientTxId,
Throwable t) |
protected void |
sendOk(OClientConnection connection,
int iClientTxId) |
protected void |
setDataCommandInfo(OClientConnection connection,
String iCommandInfo) |
void |
setHandshakeInfo(HandshakeInfo handshakeInfo) |
boolean |
shouldReadToken(OClientConnection connection,
int requestType) |
void |
shutdown() |
void |
startup() |
protected static int |
trimCsvSerializedContent(OClientConnection connection,
byte[] stream) |
static void |
writeIdentifiable(OChannelBinary channel,
OClientConnection connection,
OIdentifiable o)
Write a OIdentifiable instance using this format:
- 2 bytes: class id [-2=no record, -3=rid, -1=no class id, > -1 = valid] - 1 byte: record type [d,b,f] - 2 bytes: cluster id - 8 bytes: position in cluster - 4 bytes: record version - x bytes: record content |
getListeningAddress, getServer
afterExecution, beforeExecution, isShutdownFlag, run, sendShutdown, setDumpExceptions, softShutdown
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
protected final Level logClientExceptions
protected final boolean logClientFullStackTrace
protected OChannelBinary channel
protected volatile int requestType
protected int clientTxId
protected boolean okSent
public ONetworkProtocolBinary(OServer server)
public void initVariables(OServer server, OChannelBinary channel)
public void config(OServerNetworkListener iListener, OServer iServer, Socket iSocket, OContextConfiguration iConfig) throws IOException
config
in class ONetworkProtocol
IOException
public void startup()
startup
in interface OService
startup
in class OSoftThread
public void shutdown()
shutdown
in interface OService
shutdown
in class OSoftThread
protected void execute() throws Exception
execute
in class OSoftThread
Exception
public void setHandshakeInfo(HandshakeInfo handshakeInfo)
public boolean shouldReadToken(OClientConnection connection, int requestType)
protected void afterOperationRequest(OClientConnection connection)
protected void checkServerAccess(String iResource, OClientConnection connection)
protected void sendError(OClientConnection connection, int iClientTxId, Throwable t) throws IOException
IOException
protected void beginResponse()
protected void endResponse() throws IOException
IOException
protected void setDataCommandInfo(OClientConnection connection, String iCommandInfo)
protected void sendOk(OClientConnection connection, int iClientTxId) throws IOException
IOException
protected void handleConnectionError(OClientConnection connection, Throwable e)
public static String getRecordSerializerName(OClientConnection connection)
public int getVersion()
getVersion
in class ONetworkProtocol
public OChannelBinary getChannel()
getChannel
in class ONetworkProtocol
public static void writeIdentifiable(OChannelBinary channel, OClientConnection connection, OIdentifiable o) throws IOException
channel
- TODOIOException
public String getType()
getType
in class ONetworkProtocol
protected void sendErrorOrDropConnection(OClientConnection connection, int iClientTxId, Throwable t) throws IOException
IOException
public static byte[] getRecordBytes(OClientConnection connection, ORecord iRecord)
protected static int trimCsvSerializedContent(OClientConnection connection, byte[] stream)
public int getRequestType()
public String getRemoteAddress()
public OBinaryRequestExecutor executor(OClientConnection connection)
executor
in class ONetworkProtocol
public OBinaryPushResponse push(OBinaryPushRequest request) throws IOException
IOException
Copyright © 2009–2020 OrientDB. All rights reserved.