public class SDBMessageHelper extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
MESSAGE_LOBTUPLE_LENGTH |
static int |
MESSAGE_OPINSERT_LENGTH |
static int |
MESSAGE_OPLOB_LENGTH |
| 构造器和说明 |
|---|
SDBMessageHelper() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addLobMsgHeader(ByteBuffer buff,
int totalLen,
int opCode,
byte[] nodeID,
long requestID) |
static void |
addLobOpMsg(ByteBuffer buff,
int version,
short w,
short padding,
int flags,
long contextID,
int bsonLen) |
static byte[] |
appendInsertMsg(byte[] msg,
BSONObject append,
boolean endianConvert) |
static void |
bsonEndianConvert(byte[] inBytes,
int offset,
int objSize,
boolean l2r) |
static byte[] |
bsonObjectToByteArray(BSONObject obj) |
static int |
bsonObjectToByteBuffer(IoBuffer byteBuffer,
BSONObject obj) |
static int |
buildAggrRequest(IoBuffer bulk_buffer,
long reqID,
String collectionFullName,
List<BSONObject> insertor) |
static byte[] |
buildAuthMsg(String userName,
String password,
long reqID,
byte type,
boolean endianConvert) |
static int |
buildBulkInsertRequest(IoBuffer bulk_buffer,
long reqID,
String collectionFullName,
List<BSONObject> insertor,
int flag) |
static byte[] |
buildDeleteRequest(SDBMessage sdbMessage,
boolean endianConvert) |
static byte[] |
buildDisconnectRequest(boolean endianConvert) |
static byte[] |
buildGetMoreRequest(SDBMessage sdbMessage,
boolean endianConvert) |
static int |
buildInsertRequest(IoBuffer bulk_buffer,
long reqID,
String collectionFullName,
BSONObject insertor) |
static byte[] |
buildKillCursorMsg(long reqId,
long[] contextIds,
boolean endianConvert) |
static byte[] |
buildQueryRequest(SDBMessage sdbMessage,
boolean endianConvert) |
static byte[] |
buildSqlMsg(SDBMessage sdb,
String sql,
boolean endianConvert) |
static byte[] |
buildSysInfoRequest() |
static byte[] |
buildTransactionRequest(SequoiadbConstants.Operation opCode,
long reqID,
boolean endianConvert) |
static byte[] |
buildUpdateRequest(SDBMessage sdbMessage,
boolean endianConvert) |
static BSONObject |
byteArrayToBSONObject(ByteBuffer byteBuffer) |
static void |
checkMessage(SDBMessage req,
SDBMessage res) |
static void |
checkMsgOpCode(SequoiadbConstants.Operation reqOpCode,
SequoiadbConstants.Operation resOpCode) |
static void |
checkMsgReqID(long reqID,
long resID) |
static <T> T |
fromBson(BSONObject bObj,
Class<T> classOfT) |
static BSONObject |
fromJson(String jsonString) |
static BSONObject |
fromObject(Object object) |
static byte[] |
generateRemoveLobRequest(BSONObject removeObj,
long reqID,
boolean endianConvert) |
static SDBMessage |
msgExtractEvalReply(ByteBuffer byteBuffer) |
static SDBMessage |
msgExtractLobOpenReply(ByteBuffer byteBuffer) |
static SDBMessage |
msgExtractLobReadReply(ByteBuffer byteBuffer) |
static SDBMessage |
msgExtractLobRemoveReply(ByteBuffer byteBuffer) |
static SDBMessage |
msgExtractReply(ByteBuffer byteBuffer) |
static SDBMessage |
msgExtractReplyRaw(ByteBuffer byteBuffer) |
static boolean |
msgExtractSysInfoReply(byte[] msg) |
public static final int MESSAGE_OPINSERT_LENGTH
public static final int MESSAGE_OPLOB_LENGTH
public static final int MESSAGE_LOBTUPLE_LENGTH
public static byte[] buildSysInfoRequest()
public static byte[] buildQueryRequest(SDBMessage sdbMessage, boolean endianConvert) throws BaseException
BaseExceptionpublic static byte[] buildAuthMsg(String userName, String password, long reqID, byte type, boolean endianConvert)
public static byte[] buildTransactionRequest(SequoiadbConstants.Operation opCode, long reqID, boolean endianConvert)
public static int buildBulkInsertRequest(IoBuffer bulk_buffer, long reqID, String collectionFullName, List<BSONObject> insertor, int flag) throws BaseException
BaseExceptionpublic static int buildInsertRequest(IoBuffer bulk_buffer, long reqID, String collectionFullName, BSONObject insertor) throws BaseException
BaseExceptionpublic static byte[] buildDeleteRequest(SDBMessage sdbMessage, boolean endianConvert) throws BaseException
BaseExceptionpublic static byte[] buildUpdateRequest(SDBMessage sdbMessage, boolean endianConvert) throws BaseException
BaseExceptionpublic static byte[] buildDisconnectRequest(boolean endianConvert)
throws BaseException
BaseExceptionpublic static byte[] buildSqlMsg(SDBMessage sdb, String sql, boolean endianConvert) throws BaseException
BaseExceptionpublic static int buildAggrRequest(IoBuffer bulk_buffer, long reqID, String collectionFullName, List<BSONObject> insertor) throws BaseException
BaseExceptionpublic static SDBMessage msgExtractReply(ByteBuffer byteBuffer) throws BaseException
BaseExceptionpublic static void addLobMsgHeader(ByteBuffer buff, int totalLen, int opCode, byte[] nodeID, long requestID)
public static void addLobOpMsg(ByteBuffer buff, int version, short w, short padding, int flags, long contextID, int bsonLen)
public static byte[] generateRemoveLobRequest(BSONObject removeObj, long reqID, boolean endianConvert)
public static SDBMessage msgExtractLobOpenReply(ByteBuffer byteBuffer) throws BaseException
BaseExceptionpublic static SDBMessage msgExtractLobRemoveReply(ByteBuffer byteBuffer) throws BaseException
BaseExceptionpublic static SDBMessage msgExtractLobReadReply(ByteBuffer byteBuffer) throws BaseException
BaseExceptionpublic static SDBMessage msgExtractEvalReply(ByteBuffer byteBuffer) throws BaseException
BaseExceptionpublic static SDBMessage msgExtractReplyRaw(ByteBuffer byteBuffer) throws BaseException
BaseExceptionpublic static byte[] buildGetMoreRequest(SDBMessage sdbMessage, boolean endianConvert) throws BaseException
BaseExceptionpublic static byte[] buildKillCursorMsg(long reqId,
long[] contextIds,
boolean endianConvert)
public static int bsonObjectToByteBuffer(IoBuffer byteBuffer, BSONObject obj)
public static byte[] bsonObjectToByteArray(BSONObject obj)
public static BSONObject byteArrayToBSONObject(ByteBuffer byteBuffer) throws BaseException
BaseExceptionpublic static BSONObject fromObject(Object object) throws BaseException
BaseExceptionpublic static <T> T fromBson(BSONObject bObj, Class<T> classOfT)
public static BSONObject fromJson(String jsonString) throws BaseException
BaseExceptionpublic static byte[] appendInsertMsg(byte[] msg,
BSONObject append,
boolean endianConvert)
public static boolean msgExtractSysInfoReply(byte[] msg)
public static void bsonEndianConvert(byte[] inBytes,
int offset,
int objSize,
boolean l2r)
public static void checkMessage(SDBMessage req, SDBMessage res)
public static void checkMsgOpCode(SequoiadbConstants.Operation reqOpCode, SequoiadbConstants.Operation resOpCode)
public static void checkMsgReqID(long reqID,
long resID)
Copyright © 2015. All Rights Reserved.