|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.jtopenlite.HostServerConnection
com.ibm.jtopenlite.ddm.DDMConnection
public class DDMConnection
Represents a TCP/IP socket connection to the System i Distributed Data Management (DDM) host server (QUSRWRK/QRWTSRVR job).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.ibm.jtopenlite.HostServerConnection |
|---|
HostServerConnection.HostInputStream, HostServerConnection.HostOutputStream |
| Field Summary | |
|---|---|
static int |
DEFAULT_DDM_SERVER_PORT
|
| Fields inherited from class com.ibm.jtopenlite.HostServerConnection |
|---|
in_, out_ |
| Method Summary | |
|---|---|
Message[] |
close(DDMFile file)
Closes the specified file and returns any messages that were issued. |
void |
deleteCurrent(DDMFile file)
Removes the current record from the file. |
Message[] |
execute(String command)
Executes the specified CL command within the DDM host server job. |
static DDMConnection |
getConnection(String system,
String user,
String password)
Establishes a new socket connection to the specified system and authenticates the specified user and password. |
static DDMConnection |
getConnection(SystemInfo info,
String user,
String password)
Establishes a new socket connection to the specified system and authenticates the specified user and password. |
static DDMConnection |
getConnection(SystemInfo info,
String user,
String password,
int ddmPort)
Establishes a new socket connection to the specified system and port, and authenticates the specified user and password. |
DDMRecordFormat |
getRecordFormat(DDMFile file)
Retrieves the record format of the specified file. |
DDMRecordFormat |
getRecordFormat(String library,
String file)
Retrieves the record format of the specified file. |
DDMFile |
open(String library,
String file,
String member,
String recordFormat)
Opens the specified file for sequential read-only access and a preferred batch size of 100. |
DDMFile |
open(String library,
String file,
String member,
String recordFormat,
int readWriteType,
boolean keyed,
int preferredBatchSize,
int numBuffers)
Opens the specified file for reading or writing records. |
void |
position(DDMFile file,
DDMReadCallback listener,
int recordNumber)
Positions the cursor to the specified record number. |
void |
positionAfterLast(DDMFile file)
Positions the cursor to the end of the file (after the last record). |
void |
positionBeforeFirst(DDMFile file)
Positions the cursor to the beginning of the file (before the first record). |
void |
positionToFirst(DDMFile file)
Positions the cursor to the first record in the file. |
void |
positionToKeyEqual(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
Positions the file cursor to the record whose key is equal to the specified key. |
void |
positionToKeyGreater(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
Positions the file cursor to the record whose key is greater than the specified key. |
void |
positionToKeyGreaterOrEqual(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
Positions the file cursor to the record whose key is greater than or equal to the specified key. |
void |
positionToKeyLess(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
Positions the file cursor to the record whose key is less than the specified key. |
void |
positionToKeyLessOrEqual(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
Positions the file cursor to the record whose key is less than or equal to the specified key. |
void |
positionToLast(DDMFile file)
Positions the cursor to the last record in the file. |
void |
positionToNext(DDMFile file,
DDMReadCallback listener)
Positions the cursor to the next record in the file. |
void |
positionToPrevious(DDMFile file,
DDMReadCallback listener)
Positions the cursor to the previous record in the file. |
void |
read(DDMFile file,
DDMReadCallback listener,
int recordNumber)
Reads the record with the specified record number from the file. |
void |
readCurrent(DDMFile file,
DDMReadCallback listener)
Reads the current record from the specified file and positions the cursor on or after it. |
void |
readFirst(DDMFile file,
DDMReadCallback listener)
Reads the first record from the specified file and positions the cursor on or after it. |
void |
readKeyEqual(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
Reads the next record whose key is equal to the specified key. |
void |
readKeyGreater(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
Reads the next record whose key is greater than the specified key. |
void |
readKeyGreaterOrEqual(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
Reads the next record whose key is greater than or equal to the specified key. |
void |
readKeyLess(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
Reads the next record whose key is less than the specified key. |
void |
readKeyLessOrEqual(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
Reads the next record whose key is less than or equal to the specified key. |
void |
readLast(DDMFile file,
DDMReadCallback listener)
Reads the last record from the specified file and positions the cursor on or after it. |
void |
readNext(DDMFile file,
DDMReadCallback listener)
Reads the next record from the specified file and positions the cursor on or after it. |
void |
readPrevious(DDMFile file,
DDMReadCallback listener)
Reads the previous record from the specified file and positions the cursor on or before it. |
protected void |
sendEndJobRequest()
No-op. |
void |
updateCurrent(DDMFile file,
byte[] data,
int offset,
boolean[] nullFieldValues)
Updates the current record with the specified data. |
void |
updateCurrent(DDMFile file,
DDMWriteCallback listener)
Updates the current record with the first record provided by the callback. |
void |
write(DDMFile file,
byte[] data,
int offset,
boolean[] nullFieldValues,
DDMReadCallback listener)
Writes a single record to the end of the file. |
void |
write(DDMFile file,
DDMWriteCallback listener)
Writes records provided by the callback to the file. |
| Methods inherited from class com.ibm.jtopenlite.HostServerConnection |
|---|
close, connect, finalize, getEncryptedPassword, getInfo, getJobName, getUser, isClosed, isDatastreamDebug, isDefaultDatastreamDebug, setDatastreamDebug, writePadEBCDIC, writePadEBCDIC10, writeStringToUnicodeBytes |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_DDM_SERVER_PORT
| Method Detail |
|---|
protected void sendEndJobRequest()
throws IOException
sendEndJobRequest in class HostServerConnectionIOException
public static DDMConnection getConnection(String system,
String user,
String password)
throws IOException
IOException
public static DDMConnection getConnection(SystemInfo info,
String user,
String password)
throws IOException
IOException
public static DDMConnection getConnection(SystemInfo info,
String user,
String password,
int ddmPort)
throws IOException
IOException
public Message[] close(DDMFile file)
throws IOException
IOException
public DDMFile open(String library,
String file,
String member,
String recordFormat)
throws IOException
library - The name of the library in which the file resides. For example, "QSYS".file - The name of the physical or logical file.member - The member within the file. This can be a special value such as "*FIRST".recordFormat - The name of the record format. This value can also be obtained from DDMRecordFormat.getName().
IOException
public DDMFile open(String library,
String file,
String member,
String recordFormat,
int readWriteType,
boolean keyed,
int preferredBatchSize,
int numBuffers)
throws IOException
library - The name of the library in which the file resides. For example, "QSYS".file - The name of the physical or logical file.member - The member within the file. This can be a special value such as "*FIRST".recordFormat - The name of the record format. This value can also be obtained from DDMRecordFormat.getName().readWriteType - The read-write access type to use. Allowed values are:
keyed - Indicates if the file should be opened for sequential or keyed access.preferredBatchSize - The number of records to read or write at a time. This is a preferred number because the DDMConnection
may decide to use a different batch size depending on circumstances (e.g. READ_WRITE files always use a batch size of 1).numBuffers - The number of data buffers to allocate for use when reading new records. The DDMConnection will round-robin
through the data buffers as it calls DDMReadCallback.newRecord(). This can be useful
for multi-threaded readers that process new record data, such as DDMThreadedReader. In such cases,
each processing thread could be assigned a specific data buffer, to avoid contention. See DDMDataBuffer.
IOException
public DDMRecordFormat getRecordFormat(String library,
String file)
throws IOException
IOException
public DDMRecordFormat getRecordFormat(DDMFile file)
throws IOException
IOException
public void read(DDMFile file,
DDMReadCallback listener,
int recordNumber)
throws IOException
IOException
public void readKeyEqual(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
throws IOException
IOException
public void readKeyGreater(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
throws IOException
IOException
public void readKeyGreaterOrEqual(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
throws IOException
IOException
public void readKeyLess(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
throws IOException
IOException
public void readKeyLessOrEqual(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
throws IOException
IOException
public void positionToKeyEqual(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
throws IOException
IOException
public void positionToKeyGreater(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
throws IOException
IOException
public void positionToKeyGreaterOrEqual(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
throws IOException
IOException
public void positionToKeyLess(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
throws IOException
IOException
public void positionToKeyLessOrEqual(DDMFile file,
DDMReadCallback listener,
byte[] key,
int numberOfKeyFields)
throws IOException
IOException
public void readNext(DDMFile file,
DDMReadCallback listener)
throws IOException
IOException
public void readPrevious(DDMFile file,
DDMReadCallback listener)
throws IOException
IOException
public void readFirst(DDMFile file,
DDMReadCallback listener)
throws IOException
IOException
public void readLast(DDMFile file,
DDMReadCallback listener)
throws IOException
IOException
public void readCurrent(DDMFile file,
DDMReadCallback listener)
throws IOException
IOException
public void positionToNext(DDMFile file,
DDMReadCallback listener)
throws IOException
IOException
public void positionToPrevious(DDMFile file,
DDMReadCallback listener)
throws IOException
IOException
public void positionToFirst(DDMFile file)
throws IOException
IOException
public void positionToLast(DDMFile file)
throws IOException
IOException
public void positionAfterLast(DDMFile file)
throws IOException
IOException
public void positionBeforeFirst(DDMFile file)
throws IOException
IOException
public void position(DDMFile file,
DDMReadCallback listener,
int recordNumber)
throws IOException
IOException
public void write(DDMFile file,
byte[] data,
int offset,
boolean[] nullFieldValues,
DDMReadCallback listener)
throws IOException
IOException
public void write(DDMFile file,
DDMWriteCallback listener)
throws IOException
IOException
public void updateCurrent(DDMFile file,
byte[] data,
int offset,
boolean[] nullFieldValues)
throws IOException
IOException
public void updateCurrent(DDMFile file,
DDMWriteCallback listener)
throws IOException
IOException
public Message[] execute(String command)
throws IOException
IOException
public void deleteCurrent(DDMFile file)
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||