public class ProtocolTestAdapter
extends java.lang.Object
The only purpose of this class is to make certain constants and methods that are package private available outside of this package for testing purposes. See DERBY-2031.
Modifier and Type | Field | Description |
---|---|---|
private CcsidManager |
ccsidManager |
|
static int |
CP_CODPNT |
|
static int |
CP_MGRLVLLS |
|
static int |
CP_MGRLVLRM |
|
private static CodePointNameTable |
CP_NAMES |
Shared code point name table (write once, then only reads/lookups).
|
static int |
CP_PRCCNVCD |
|
static int |
CP_PRCCNVRM |
|
static int |
CP_SECCHKCD |
|
static int |
CP_SECMEC |
|
static int |
CP_SQLCARD |
|
static int |
CP_SVRCOD |
|
static int |
CP_SYNERRCD |
|
static int |
CP_SYNTAXRM |
|
private java.io.OutputStream |
out |
|
private DDMReader |
reader |
|
private java.net.Socket |
socket |
|
static byte |
SPACE |
|
private DDMWriter |
writer |
Constructor | Description |
---|---|
ProtocolTestAdapter(java.net.Socket socket) |
Initializes the adapter for use with the given socket.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Closes the resources associated with the adapter.
|
byte[] |
convertFromJavaString(java.lang.String str) |
Converts a string to a byte array according to the CCSID manager.
|
java.lang.Integer |
decodeCodePoint(java.lang.String codePointName) |
Returns the code point id for the given code point name.
|
java.lang.String |
lookupCodePoint(int codePoint) |
Returns the name of the given code point.
|
boolean |
rMoreData() |
|
boolean |
rMoreDdmData() |
|
boolean |
rMoreDssData() |
|
byte |
rReadByte() |
|
byte[] |
rReadBytes() |
|
int |
rReadLengthAndCodePoint(boolean f) |
|
int |
rReadNetworkInt() |
|
int |
rReadNetworkShort() |
|
void |
rReadReplyDss() |
|
java.lang.String |
rReadString(int length,
java.lang.String enc) |
|
void |
rSkipBytes() |
|
void |
rSkipDdm() |
|
void |
rSkipDss() |
|
void |
setUtf8Ccsid() |
Instructs the
DDMReader and DDMWriter to use UTF-8. |
void |
wCreateDssObject() |
|
void |
wCreateDssReply() |
|
void |
wCreateDssRequest() |
|
void |
wEndDdm() |
|
void |
wEndDdmAndDss() |
|
void |
wEndDss() |
|
void |
wEndDss(byte b) |
|
void |
wFlush() |
|
void |
wPadBytes(byte ch,
int len) |
|
private static java.io.IOException |
wrap(DRDAProtocolException dpe) |
Wraps a protocol exception in a generic I/O exception, since
DRDAProtocolException is package private. |
void |
wStartDdm(int cp) |
|
void |
wWriteByte(int b) |
|
void |
wWriteBytes(byte[] buf) |
|
void |
wWriteCodePoint4Bytes(int cp,
int v) |
|
void |
wWriteInt(int v) |
|
void |
wWriteScalar1Byte(int cp,
int value) |
|
void |
wWriteScalar2Bytes(int cp,
int value) |
|
void |
wWriteScalarBytes(int cp,
byte[] buf) |
|
void |
wWriteScalarPaddedBytes(int cp,
byte[] buf,
int length,
byte ch) |
|
void |
wWriteScalarString(int cp,
java.lang.String str) |
|
void |
wWriteShort(int v) |
public static final byte SPACE
public static final int CP_SQLCARD
public static final int CP_SVRCOD
public static final int CP_CODPNT
public static final int CP_PRCCNVCD
public static final int CP_SYNERRCD
public static final int CP_MGRLVLLS
public static final int CP_PRCCNVRM
public static final int CP_SYNTAXRM
public static final int CP_MGRLVLRM
public static final int CP_SECMEC
public static final int CP_SECCHKCD
private static final CodePointNameTable CP_NAMES
private final CcsidManager ccsidManager
private final DDMWriter writer
private final java.net.Socket socket
private final DDMReader reader
private final java.io.OutputStream out
public ProtocolTestAdapter(java.net.Socket socket) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public java.lang.String lookupCodePoint(int codePoint)
codePoint
- code point to look upnull
if code point is unknown.public java.lang.Integer decodeCodePoint(java.lang.String codePointName)
codePointName
- the name of the code point to look upnull
if the code point
name is unknown.public byte[] convertFromJavaString(java.lang.String str)
public void setUtf8Ccsid()
DDMReader
and DDMWriter
to use UTF-8.public void wCreateDssRequest()
public void wCreateDssObject()
public void wCreateDssReply()
public void wEndDss()
public void wEndDss(byte b)
public void wEndDdm()
public void wEndDdmAndDss()
public void wStartDdm(int cp)
public void wWriteScalarString(int cp, java.lang.String str)
public void wWriteScalar2Bytes(int cp, int value)
public void wWriteScalar1Byte(int cp, int value)
public void wWriteScalarBytes(int cp, byte[] buf)
public void wWriteScalarPaddedBytes(int cp, byte[] buf, int length, byte ch)
public void wWriteByte(int b)
public void wWriteBytes(byte[] buf)
public void wWriteShort(int v)
public void wWriteInt(int v)
public void wWriteCodePoint4Bytes(int cp, int v)
public void wPadBytes(byte ch, int len)
public void wFlush() throws java.io.IOException
java.io.IOException
public void rReadReplyDss() throws java.io.IOException
java.io.IOException
public void rSkipDss() throws java.io.IOException
java.io.IOException
public void rSkipDdm() throws java.io.IOException
java.io.IOException
public void rSkipBytes() throws java.io.IOException
java.io.IOException
public boolean rMoreData()
public boolean rMoreDssData()
public boolean rMoreDdmData()
public int rReadNetworkShort() throws java.io.IOException
java.io.IOException
public byte rReadByte() throws java.io.IOException
java.io.IOException
public byte[] rReadBytes() throws java.io.IOException
java.io.IOException
public int rReadLengthAndCodePoint(boolean f) throws java.io.IOException
java.io.IOException
public int rReadNetworkInt() throws java.io.IOException
java.io.IOException
public java.lang.String rReadString(int length, java.lang.String enc) throws java.io.IOException
java.io.IOException
private static java.io.IOException wrap(DRDAProtocolException dpe)
DRDAProtocolException
is package private.Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.