public class CmChannel extends CmBufferWriter
| Modifier and Type | Field and Description |
|---|---|
static int |
CHAR_VARCHAR_COLUMN_SIZE |
static int |
CM_BLOCK_SIZE |
static int |
CM_DEFAULT_RCVBUF_SIZE |
static int |
CM_DEFAULT_SNDBUF_SIZE |
static int |
CM_PACKET_HEADER_SIZE |
mBuffer, mCharVarcharColumnBuffer, mDBEncoder, mNCharEncoder, mNLiteralEncoder| Constructor and Description |
|---|
CmChannel() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkDecodingBuffer(int aLobDataLength)
CLOB의 경우 LOB_CACHE_THRESHOLD가 CM_BLOCK_SIZE를 초과한 경우
디코딩을 위해 mCharBuf를 재할당한다.
|
void |
checkWritable(int aNeedToWrite)
Buffer 에 쓸 데이터 공간이 충분한지 여부를 확인하여, 충분하지 않으면 필요한 공간을 만드는 함수
CmChannel 과 ListBufferHandle 에서 각자에 맞게 구현한다.
|
void |
close() |
CmProtocolContext |
getAsyncContext()
비동기적으로 fetch 프로토콜을 송신한 protocol context 를 얻는다.
|
int |
getByteLengthPerChar() |
java.nio.charset.Charset |
getCharset() |
java.lang.String[] |
getCipherSuitList()
현재 SSLSocket에서 가능한 CipherSuites 리스트를 돌려준다.
|
ColumnFactory |
getColumnFactory() |
CmConnType |
getConnType() |
int |
getLobCacheThreshold() |
AltibaseMessageCallback |
getMessageCallback()
Message Callback 객체를 반환한다.
|
java.nio.charset.Charset |
getNCharset() |
int |
getResponseTimeout() |
int |
getSocketFD()
Socket 의 file descriptor 를 반환한다.
|
int |
getSockRcvBufSize()
Socket receive buffer 크기를 반환한다.
|
ListBufferHandle |
getTempListBufferHandle() |
boolean |
isAsyncSent()
비동기적으로 fetch 프로토콜을 송신한 protocol context 를 얻는다.
|
boolean |
isClosed() |
void |
open(java.lang.String aAddr,
java.lang.String aBindAddr,
int aPort,
int aLoginTimeout)
물리 연결을 맺고, CmChannel을 사용하기 위해 준비를 한다.
|
void |
quietClose()
채널을 닫는다.
|
byte |
readByte() |
void |
readBytes(byte[] aDest) |
void |
readBytes(byte[] aDest,
int aLength) |
void |
readBytes(byte[] aDest,
int aOffset,
int aLength) |
void |
readBytes(java.nio.ByteBuffer aBuf) |
java.lang.String |
readCharVarcharColumnString(int aColumnSize,
int aSkipSize,
boolean aIsNationalCharset)
Char, Varchar 컬럼 데이터를 읽은 후 Charset에 맞게 decode한 문자열을 리턴한다.
|
double |
readDouble() |
float |
readFloat() |
int |
readInt() |
long |
readLong() |
byte |
readOp() |
short |
readShort() |
java.lang.String |
readString(byte[] aBytesValue) |
java.lang.String |
readString(int aLength) |
short |
readUnsignedByte() |
java.math.BigInteger |
readUnsignedLong() |
int |
readUnsignedShort() |
void |
receive() |
void |
send() |
void |
sendAndReceive() |
void |
setAsyncContext(CmProtocolContext aContext)
비동기적으로 fetch 프로토콜을 송신한 protocol context 를 저장한다.
|
void |
setCharset(java.nio.charset.Charset aCharset,
java.nio.charset.Charset aNCharset) |
void |
setConnType(java.lang.String aConnType) |
void |
setLobCacheThreshold(int aLobCacheThreshold) |
void |
setMessageCallback(AltibaseMessageCallback aCallback)
AltibaseConnection으로 부터 Message Callback 객체를 주입받는다.
|
void |
setPreferredIPv6() |
void |
setProps(AltibaseProperties aProps)
PROJ-2681 접속 타입에 따른 프로퍼티 값을 읽기 위해 설정한다.
|
void |
setRemoveRedundantMode(boolean aMode,
AltibaseProperties aProps) |
void |
setResponseTimeout(int aResponseTimeout) |
void |
setSocket(CmSocket aSocket) |
void |
setSockRcvBufBlockRatio(int aSockRcvBufBlockRatio)
Socket receive buffer 크기를 CM block 단위로 설정한다.
|
void |
setSockRcvBufSize(int aSockRcvBufSize)
Socket receive buffer 크기를 설정한다.
|
void |
skip(int aSkipLen)
데이타를 aSkipLen 만큼 건너 뛴다.
|
void |
writeBytes(byte[] aValue,
int aOffset,
int aLength) |
void |
writeBytes(java.nio.ByteBuffer aValue)
ByteBuffer 객체를 Buffer 에 삽입하는 함수
CmChannel 과 ListBufferHandle 에서 각자에 맞게 구현한다.
|
void |
writeOp(byte aOpCode) |
encodeString, prepareToWriteString, writeByte, writeBytes, writeDouble, writeFloat, writeInt, writeLong, writePreparedString, writeShort, writeUnsignedIntpublic static final int CM_BLOCK_SIZE
public static final int CM_PACKET_HEADER_SIZE
public static final int CM_DEFAULT_SNDBUF_SIZE
public static final int CM_DEFAULT_RCVBUF_SIZE
public static final int CHAR_VARCHAR_COLUMN_SIZE
public void setPreferredIPv6()
public void open(java.lang.String aAddr,
java.lang.String aBindAddr,
int aPort,
int aLoginTimeout)
throws java.sql.SQLException
aAddr - 접속할 서버의 IP 주소 또는 HostnameaBindAddr - 소켓에 바인드 할 IP 주소. null이면 바인드 하지 않음.aPort - 접속할 서버의 PortaLoginTimeout - Socket.connect()에 사용할 타임아웃 값 (초 단위)java.sql.SQLException - 이미 연결되어있거나 소켓 생성, 초기화 또는 연결에 실패한 경우public boolean isClosed()
public void close()
throws java.io.IOException
java.io.IOExceptionpublic void quietClose()
public void setCharset(java.nio.charset.Charset aCharset,
java.nio.charset.Charset aNCharset)
setCharset in class CmBufferWriterpublic java.nio.charset.Charset getCharset()
public java.nio.charset.Charset getNCharset()
public int getByteLengthPerChar()
public void writeOp(byte aOpCode)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void writeBytes(byte[] aValue,
int aOffset,
int aLength)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void writeBytes(java.nio.ByteBuffer aValue)
throws java.sql.SQLException
CmBufferWriterwriteBytes in class CmBufferWriteraValue - Buffer 에 저장할 ByteBuffer 객체java.sql.SQLException - 데이타 전송에 실패했을 경우public void sendAndReceive()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void send()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void receive()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void checkWritable(int aNeedToWrite)
throws java.sql.SQLException
CmBufferWritercheckWritable in class CmBufferWriteraNeedToWrite - 데이타를 쓰기 위해 필요한 bytes 숫자java.sql.SQLException - 데이타 전송에 실패했을 경우public void skip(int aSkipLen)
만약, aSkipLen이 0이면 조용히 무시한다.
aSkipLen - 건너 뛸 byte 수java.lang.InternalError - aSkipLen이 0보다 작을 경우public byte readOp()
throws java.sql.SQLException
java.sql.SQLExceptionpublic byte readByte()
throws java.sql.SQLException
java.sql.SQLExceptionpublic short readUnsignedByte()
throws java.sql.SQLException
java.sql.SQLExceptionpublic short readShort()
throws java.sql.SQLException
java.sql.SQLExceptionpublic int readUnsignedShort()
throws java.sql.SQLException
java.sql.SQLExceptionpublic int readInt()
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.math.BigInteger readUnsignedLong()
throws java.sql.SQLException
java.sql.SQLExceptionpublic long readLong()
throws java.sql.SQLException
java.sql.SQLExceptionpublic float readFloat()
throws java.sql.SQLException
java.sql.SQLExceptionpublic double readDouble()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void readBytes(byte[] aDest)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void readBytes(byte[] aDest,
int aOffset,
int aLength)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void readBytes(byte[] aDest,
int aLength)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void readBytes(java.nio.ByteBuffer aBuf)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.lang.String readString(int aLength)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.lang.String readString(byte[] aBytesValue)
public java.lang.String readCharVarcharColumnString(int aColumnSize,
int aSkipSize,
boolean aIsNationalCharset)
throws java.sql.SQLException
aColumnSize - 컬럼데이터 사이즈aSkipSize - 스킵사이즈aIsNationalCharset - 다국어캐릭터셋인지 여부java.sql.SQLException - 정상적으로 컬럼데이터를 받아오지 못한 경우public int getLobCacheThreshold()
public void setLobCacheThreshold(int aLobCacheThreshold)
public void setRemoveRedundantMode(boolean aMode,
AltibaseProperties aProps)
public ColumnFactory getColumnFactory()
public CmConnType getConnType()
public void setConnType(java.lang.String aConnType)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void setProps(AltibaseProperties aProps)
aProps - AltibaseProperties 객체public java.lang.String[] getCipherSuitList()
public int getSockRcvBufSize()
public void setSockRcvBufSize(int aSockRcvBufSize)
throws java.io.IOException
java.io.IOExceptionpublic void setSockRcvBufBlockRatio(int aSockRcvBufBlockRatio)
throws java.io.IOException
java.io.IOExceptionpublic void setAsyncContext(CmProtocolContext aContext)
public boolean isAsyncSent()
public CmProtocolContext getAsyncContext()
public int getSocketFD()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void setMessageCallback(AltibaseMessageCallback aCallback)
aCallback - 콜백객체public AltibaseMessageCallback getMessageCallback()
public ListBufferHandle getTempListBufferHandle()
public void checkDecodingBuffer(int aLobDataLength)
throws java.sql.SQLException
aLobDataLength - LOB데이터길이java.sql.SQLExceptionpublic void setResponseTimeout(int aResponseTimeout)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void setSocket(CmSocket aSocket)
public int getResponseTimeout()