
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 |
serverMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
ONetworkProtocolBinary() |
ONetworkProtocolBinary(String iThreadName) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCluster(OClientConnection connection) |
protected void |
afterOperationRequest(OClientConnection connection) |
protected void |
beginResponse() |
protected void |
checkServerAccess(String iResource,
OClientConnection connection) |
protected void |
checkStorageExistence(String iDatabaseName) |
protected void |
cleanOutRecord(OClientConnection connection) |
protected int |
cleanOutRecord(ODatabaseDocument iDatabase,
ORID rid,
int version) |
protected void |
closeDatabase(OClientConnection connection) |
protected void |
command(OClientConnection connection) |
protected void |
commit(OClientConnection connection) |
void |
config(OServerNetworkListener iListener,
OServer iServer,
Socket iSocket,
OContextConfiguration iConfig) |
protected void |
configGet(OClientConnection connection) |
protected void |
configList(OClientConnection connection) |
protected void |
configSet(OClientConnection connection) |
protected void |
connect(OClientConnection connection) |
protected void |
countClusters(OClientConnection connection) |
protected void |
countDatabaseRecords(OClientConnection connection) |
protected void |
createDatabase(OClientConnection connection) |
protected ODatabaseDocumentInternal |
createDatabase(ODatabaseDocumentInternal iDatabase,
String dbUser,
String dbPasswd,
String backupPath) |
protected void |
createRecord(OClientConnection connection) |
protected ORecord |
createRecord(OClientConnection connection,
ORecordId rid,
byte[] buffer,
byte recordType) |
protected void |
deleteRecord(OClientConnection connection) |
protected int |
deleteRecord(ODatabaseDocument iDatabase,
ORID rid,
int version) |
protected void |
distributedCluster(OClientConnection connection) |
protected void |
dropDatabase(OClientConnection connection) |
protected void |
endResponse(OClientConnection connection) |
protected void |
execute() |
protected boolean |
executeRequest(OClientConnection connection) |
protected void |
existsDatabase(OClientConnection connection) |
void |
fillRecord(OClientConnection connection,
ORecordId rid,
byte[] buffer,
int version,
ORecord record) |
protected void |
freezeDatabase(OClientConnection connection) |
OChannelBinary |
getChannel() |
protected ODatabaseDocumentInternal |
getDatabaseInstance(String dbName,
String dbType,
String storageType)
Returns a database instance giving the database name, the database type and storage type.
|
byte[] |
getRecordBytes(OClientConnection connection,
ORecord iRecord) |
String |
getRecordSerializerName(OClientConnection connection) |
String |
getRemoteAddress() |
int |
getRequestType() |
String |
getType() |
int |
getVersion() |
protected void |
handleConnectionError(OClientConnection connection,
Throwable e) |
protected void |
hideRecord(OClientConnection connection) |
protected int |
hideRecord(ODatabaseDocument iDatabase,
ORID rid) |
void |
importDatabase(OClientConnection connection) |
void |
initVariables(OServer server,
OChannelBinaryServer channel)
Internal varialbe injection useful for testing.
|
protected void |
openDatabase(OClientConnection connection) |
protected void |
rangeCluster(OClientConnection connection) |
protected void |
readConnectionData(OClientConnection connection) |
protected void |
readRecord(OClientConnection connection) |
protected void |
readRecordIfVersionIsNotLatest(OClientConnection connection) |
protected void |
readRecordMetadata(OClientConnection connection) |
protected void |
releaseDatabase(OClientConnection connection) |
protected void |
reloadDatabase(OClientConnection connection) |
protected void |
removeCluster(OClientConnection connection) |
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 |
sendResponse(OClientConnection connection,
ODocument iResponse) |
void |
sendShutdown() |
void |
serializeValue(OClientConnection connection,
OAbstractCommandResultListener listener,
Object result,
boolean load,
boolean isRecordResultSet) |
protected void |
setDataCommandInfo(OClientConnection connection,
String iCommandInfo) |
void |
shutdown() |
protected void |
shutdownConnection(OClientConnection connection) |
protected void |
sizeDatabase(OClientConnection connection) |
void |
startup() |
protected int |
trimCsvSerializedContent(OClientConnection connection,
byte[] stream) |
protected void |
updateRecord(OClientConnection connection)
VERSION MANAGEMENT:
-1 : DOCUMENT UPDATE, NO VERSION CONTROL -2 : DOCUMENT UPDATE, NO VERSION CONTROL, NO VERSION INCREMENT -3 : DOCUMENT ROLLBACK, DECREMENT VERSION >-1 : MVCC CONTROL, RECORD UPDATE AND VERSION INCREMENT <-3 : WRONG VERSION VALUE |
protected int |
updateRecord(OClientConnection connection,
ORecordId rid,
byte[] buffer,
int version,
byte recordType,
boolean updateContent) |
void |
writeIdentifiable(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, getServerafterExecution, beforeExecution, isDumpExceptions, isShutdownFlag, pauseCurrentThread, run, setDumpExceptions, softShutdownactiveCount, 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, yieldprotected final Level logClientExceptions
protected final boolean logClientFullStackTrace
protected OChannelBinary channel
protected volatile int requestType
protected int clientTxId
protected boolean okSent
public ONetworkProtocolBinary()
public ONetworkProtocolBinary(String iThreadName)
public void initVariables(OServer server, OChannelBinaryServer channel)
public void sendShutdown()
sendShutdown in class OSoftThreadpublic void config(OServerNetworkListener iListener, OServer iServer, Socket iSocket, OContextConfiguration iConfig) throws IOException
config in class ONetworkProtocolIOExceptionpublic void startup()
startup in interface OServicestartup in class OSoftThreadpublic void shutdown()
shutdown in interface OServiceshutdown in class OSoftThreadprotected void execute()
throws Exception
execute in class OSoftThreadExceptionprotected void afterOperationRequest(OClientConnection connection) throws IOException
IOExceptionprotected boolean executeRequest(OClientConnection connection) throws IOException
IOExceptionprotected void checkServerAccess(String iResource, OClientConnection connection)
protected void removeCluster(OClientConnection connection) throws IOException
IOExceptionprotected void addCluster(OClientConnection connection) throws IOException
IOExceptionprotected void rangeCluster(OClientConnection connection) throws IOException
IOExceptionprotected void countClusters(OClientConnection connection) throws IOException
IOExceptionprotected void reloadDatabase(OClientConnection connection) throws IOException
IOExceptionprotected void openDatabase(OClientConnection connection) throws IOException
IOExceptionprotected void connect(OClientConnection connection) throws IOException
IOExceptionprotected void sendError(OClientConnection connection, int iClientTxId, Throwable t) throws IOException
IOExceptionprotected void shutdownConnection(OClientConnection connection) throws IOException
IOExceptionprotected void distributedCluster(OClientConnection connection) throws IOException
IOExceptionprotected void countDatabaseRecords(OClientConnection connection) throws IOException
IOExceptionprotected void sizeDatabase(OClientConnection connection) throws IOException
IOExceptionprotected void dropDatabase(OClientConnection connection) throws IOException
IOExceptionprotected void existsDatabase(OClientConnection connection) throws IOException
IOExceptionprotected void createDatabase(OClientConnection connection) throws IOException
IOExceptionprotected void closeDatabase(OClientConnection connection) throws IOException
IOExceptionprotected void configList(OClientConnection connection) throws IOException
IOExceptionprotected void configSet(OClientConnection connection) throws IOException
IOExceptionprotected void configGet(OClientConnection connection) throws IOException
IOExceptionprotected void commit(OClientConnection connection) throws IOException
IOExceptionprotected void command(OClientConnection connection) throws IOException
IOExceptionpublic void serializeValue(OClientConnection connection, OAbstractCommandResultListener listener, Object result, boolean load, boolean isRecordResultSet) throws IOException
IOExceptionprotected void deleteRecord(OClientConnection connection) throws IOException
IOExceptionprotected void hideRecord(OClientConnection connection) throws IOException
IOExceptionprotected void cleanOutRecord(OClientConnection connection) throws IOException
IOExceptionprotected void updateRecord(OClientConnection connection) throws IOException
IOExceptionprotected void createRecord(OClientConnection connection) throws IOException
IOExceptionprotected void readRecordMetadata(OClientConnection connection) throws IOException
IOExceptionprotected void readRecord(OClientConnection connection) throws IOException
IOExceptionprotected void readRecordIfVersionIsNotLatest(OClientConnection connection) throws IOException
IOExceptionprotected void beginResponse()
protected void endResponse(OClientConnection connection) throws IOException
IOExceptionprotected void setDataCommandInfo(OClientConnection connection, String iCommandInfo)
protected void readConnectionData(OClientConnection connection) throws IOException
IOExceptionprotected void sendOk(OClientConnection connection, int iClientTxId) throws IOException
IOExceptionprotected void handleConnectionError(OClientConnection connection, Throwable e)
protected void sendResponse(OClientConnection connection, ODocument iResponse) throws IOException
IOExceptionprotected void freezeDatabase(OClientConnection connection) throws IOException
IOExceptionprotected void releaseDatabase(OClientConnection connection) throws IOException
IOExceptionpublic String getRecordSerializerName(OClientConnection connection)
public int getVersion()
getVersion in class ONetworkProtocolpublic OChannelBinary getChannel()
getChannel in class ONetworkProtocolpublic void writeIdentifiable(OClientConnection connection, OIdentifiable o) throws IOException
IOExceptionpublic String getType()
getType in class ONetworkProtocolpublic void fillRecord(OClientConnection connection, ORecordId rid, byte[] buffer, int version, ORecord record)
protected void sendErrorOrDropConnection(OClientConnection connection, int iClientTxId, Throwable t) throws IOException
IOExceptionprotected void checkStorageExistence(String iDatabaseName)
protected ODatabaseDocumentInternal createDatabase(ODatabaseDocumentInternal iDatabase, String dbUser, String dbPasswd, String backupPath)
protected ODatabaseDocumentInternal getDatabaseInstance(String dbName, String dbType, String storageType)
storageType - Storage type between "plocal" or "memory".protected int deleteRecord(ODatabaseDocument iDatabase, ORID rid, int version)
protected int hideRecord(ODatabaseDocument iDatabase, ORID rid)
protected int cleanOutRecord(ODatabaseDocument iDatabase, ORID rid, int version)
protected ORecord createRecord(OClientConnection connection, ORecordId rid, byte[] buffer, byte recordType)
protected int updateRecord(OClientConnection connection, ORecordId rid, byte[] buffer, int version, byte recordType, boolean updateContent)
public byte[] getRecordBytes(OClientConnection connection, ORecord iRecord)
protected int trimCsvSerializedContent(OClientConnection connection, byte[] stream)
public int getRequestType()
public String getRemoteAddress()
public void importDatabase(OClientConnection connection) throws IOException
IOExceptionCopyright © 2009–2025 OrientDB. All rights reserved.