Class ONetworkProtocolBinary
java.lang.Object
java.lang.Thread
com.orientechnologies.common.thread.OSoftThread
com.orientechnologies.orient.server.network.protocol.ONetworkProtocol
com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OChannelBinaryprotected intprotected OLogger.Levelprotected final booleanprotected booleanprotected intFields inherited from class com.orientechnologies.orient.server.network.protocol.ONetworkProtocol
serverFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionONetworkProtocolBinary(OServer server) ONetworkProtocolBinary(OServer server, String iThreadName) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterOperationRequest(OClientConnection connection) protected voidprotected voidcheckServerAccess(String iResource, OClientConnection connection) voidconfig(OServerNetworkListener iListener, OServer iServer, Socket iSocket, OContextConfiguration iConfig) protected voidprotected voidexecute()executor(OClientConnection connection) static byte[]getRecordBytes(OClientConnection connection, ORecord iRecord) static StringgetRecordSerializerName(OClientConnection connection) intgetType()intprotected voidhandleConnectionError(OClientConnection connection, Throwable e) voidinitVariables(OServer server, OChannelBinary channel) Internal varialbe injection useful for testing.push(OBinaryPushRequest request) protected voidsendError(OClientConnection connection, int iClientTxId, Throwable t) protected voidsendErrorOrDropConnection(OClientConnection connection, int iClientTxId, Throwable t) protected voidsendOk(OClientConnection connection, int iClientTxId) protected voidsetDataCommandInfo(OClientConnection connection, String iCommandInfo) voidsetHandshakeInfo(HandshakeInfo handshakeInfo) booleanshouldReadToken(OClientConnection connection, int requestType) voidshutdown()voidstartup()protected static inttrimCsvSerializedContent(OClientConnection connection, byte[] stream) static voidwriteIdentifiable(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 contentMethods inherited from class com.orientechnologies.orient.server.network.protocol.ONetworkProtocol
getListeningAddress, getServerMethods inherited from class com.orientechnologies.common.thread.OSoftThread
afterExecution, beforeExecution, isShutdownFlag, run, sendShutdown, setDumpExceptions, softShutdownMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Field Details
-
logClientExceptions
-
logClientFullStackTrace
protected final boolean logClientFullStackTrace -
channel
-
requestType
protected volatile int requestType -
clientTxId
protected int clientTxId -
okSent
protected boolean okSent
-
-
Constructor Details
-
ONetworkProtocolBinary
-
ONetworkProtocolBinary
-
-
Method Details
-
initVariables
Internal varialbe injection useful for testing. -
config
public void config(OServerNetworkListener iListener, OServer iServer, Socket iSocket, OContextConfiguration iConfig) throws IOException - Specified by:
configin classONetworkProtocol- Throws:
IOException
-
startup
public void startup()- Specified by:
startupin interfaceOService- Overrides:
startupin classOSoftThread
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceOService- Overrides:
shutdownin classOSoftThread
-
execute
- Specified by:
executein classOSoftThread- Throws:
Exception
-
setHandshakeInfo
-
shouldReadToken
-
afterOperationRequest
-
checkServerAccess
-
sendError
protected void sendError(OClientConnection connection, int iClientTxId, Throwable t) throws IOException - Throws:
IOException
-
beginResponse
protected void beginResponse() -
endResponse
- Throws:
IOException
-
setDataCommandInfo
-
sendOk
- Throws:
IOException
-
handleConnectionError
-
getRecordSerializerName
-
getVersion
public int getVersion()- Specified by:
getVersionin classONetworkProtocol
-
getChannel
- Specified by:
getChannelin classONetworkProtocol
-
writeIdentifiable
public static void writeIdentifiable(OChannelBinary channel, OClientConnection connection, OIdentifiable o) throws IOException 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- Parameters:
channel- TODO- Throws:
IOException
-
getType
- Specified by:
getTypein classONetworkProtocol
-
sendErrorOrDropConnection
protected void sendErrorOrDropConnection(OClientConnection connection, int iClientTxId, Throwable t) throws IOException - Throws:
IOException
-
getRecordBytes
-
trimCsvSerializedContent
-
getRequestType
public int getRequestType() -
getRemoteAddress
-
executor
- Specified by:
executorin classONetworkProtocol
-
push
- Throws:
IOException
-