public abstract class AS400File
extends java.lang.Object
implements java.io.Serializable
KeyedFile
.
AS400FileRecordDescription
,
MemberList
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
BLANK
Constant indicating a text description of *BLANK.
|
static int |
COMMIT_LOCK_LEVEL_ALL
Constant indicating a commit lock level of *ALL.
|
static int |
COMMIT_LOCK_LEVEL_CHANGE
Constant indicating a commit lock level of *CHANGE.
|
static int |
COMMIT_LOCK_LEVEL_CURSOR_STABILITY
Constant indicating a commit lock level of *CS.
|
static int |
COMMIT_LOCK_LEVEL_DEFAULT
Constant indicating that the commit lock level specified on the
startCommitmentControl() method should be used.
|
static int |
COMMIT_LOCK_LEVEL_NONE
Constant indicating that no commitment control should be used for the file.
|
protected boolean |
longRecordNumber |
static int |
READ_ALLOW_SHARED_READ_LOCK
Constant indicating lock type of read willing to share with
other readers.
|
static int |
READ_ALLOW_SHARED_WRITE_LOCK
Constant indicating lock type of read willing to share with
updaters.
|
static int |
READ_EXCLUSIVE_LOCK
Constant indicating lock type of read willing to share with no one.
|
static int |
READ_ONLY
Constant indicating open type of read only.
|
static int |
READ_WRITE
Constant indicating open type of read/write.
|
static java.lang.String |
SOURCE_MEMBER_TEXT
Constant indicating a text description of *SRCMBRTXT.
|
static java.lang.String |
TYPE_DATA
Constant indicating a file type of *DATA.
|
static java.lang.String |
TYPE_SOURCE
Constant indicating a file type of *SRC.
|
static int |
WRITE_ALLOW_SHARED_READ_LOCK
Constant indicating lock type of update willing to share with
readers.
|
static int |
WRITE_ALLOW_SHARED_WRITE_LOCK
Constant indicating lock type of update willing to share with
updaters.
|
static int |
WRITE_EXCLUSIVE_LOCK
Constant indicating lock type of update willing to share with
no one.
|
static int |
WRITE_ONLY
Constant indicating open type of write only.
|
Constructor and Description |
---|
AS400File()
Constructs an AS400File object.
|
AS400File(AS400 system,
java.lang.String name)
Constructs an AS400File object.
|
Modifier and Type | Method and Description |
---|---|
void |
addFileListener(FileListener listener)
Adds a listener to be notified when a FileEvent is fired.
|
void |
addPhysicalFileMember(java.lang.String name,
java.lang.String textDescription)
Adds a physical file member to the file represented by this object.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound
property is changed.
|
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained
property is changed.
|
void |
close()
Closes the file on the system.
|
void |
commit()
Commits all transactions since the last commit boundary.
|
static void |
commit(AS400 system)
Commits all transactions since the last commit boundary for the specified system.
|
void |
create(int recordLength,
java.lang.String fileType,
java.lang.String textDescription)
Creates a physical file with the specified record length and file type.
|
void |
create(RecordFormat recordFormat,
java.lang.String textDescription)
Creates a physical file using the specified record format.
|
void |
create(RecordFormat recordFormat,
java.lang.String textDescription,
java.lang.String altSeq,
java.lang.String ccsid,
java.lang.String order,
java.lang.String ref,
boolean unique,
java.lang.String format,
java.lang.String text)
Creates a physical file using the specified record format and any specified
keywords.
|
void |
create(java.lang.String ddsSourceFile,
java.lang.String textDescription)
Creates a physical file using the specified DDS source file.
|
void |
delete()
Deletes the file.
|
void |
deleteCurrentRecord()
Deletes the record at the current cursor position.
|
void |
deleteMember()
Deletes the member associated with this object from the file.
|
void |
endCommitmentControl()
Ends commitment control for this connection.
|
static void |
endCommitmentControl(AS400 system)
Ends commitment control for the specified connection.
|
protected void |
finalize()
Closes the file when this object is garbage collected.
|
int |
getBlockingFactor()
Returns the blocking factor being used for this file.
|
int |
getCommitLockLevel()
Returns the commit lock level for this file as specified on open.
|
int[] |
getExplicitLocks()
Returns the explicit locks that have been obtained for the file using this AS400File object.
|
java.lang.String |
getFileName()
Returns the file name.
|
java.lang.String |
getLibraryName()
Returns the library name.
|
java.lang.String |
getMemberName()
Returns the member name.
|
java.lang.String |
getPath()
Returns the integrated file system pathname for the file as specified on the
constructor or the setPath() method.
|
RecordFormat |
getRecordFormat()
Returns the record format of this file.
|
AS400 |
getSystem()
Returns the system object for this object.
|
boolean |
isCommitmentControlStarted()
Indicates if commitment control is started for
the connection.
|
static boolean |
isCommitmentControlStarted(AS400 system)
Indicates if commitment control is started for the specified system.
|
boolean |
isOpen()
Indicates if the file is open.
|
boolean |
isReadNoUpdate()
Indicates if the records should be locked for update when doing reads in a READ_WRITE open mode.
|
boolean |
isReadOnly()
Indicates if this object is open for read only.
|
boolean |
isReadWrite()
Indicates if this object is open for read/write.
|
boolean |
isSSPFile()
Indicates if this object is being treated as an SSP file.
|
boolean |
isWriteOnly()
Indicates if this object is open for write only.
|
void |
lock(int lockToObtain)
Obtains a lock on the file.
|
void |
open()
Opens the file.
|
void |
open(int openType,
int blockingFactor,
int commitLockLevel)
Opens the file.
|
void |
positionCursorAfterLast()
Positions the file cursor to after the last record.
|
void |
positionCursorBeforeFirst()
Positions the file cursor to before the first record.
|
void |
positionCursorToFirst()
Positions the file cursor to the first record.
|
void |
positionCursorToLast()
Positions the file cursor to the last record.
|
void |
positionCursorToNext()
Positions the file cursor to the next record.
|
void |
positionCursorToPrevious()
Positions the file cursor to the previous record.
|
Record |
read()
Reads the record at the current cursor position.
|
abstract Record[] |
readAll()
Reads all the records in the file.
|
Record |
readFirst()
Reads the first record in the file.
|
Record |
readLast()
Reads the last record in the file.
|
Record |
readNext()
Reads the next record in the file from the current cursor position.
|
Record |
readPrevious()
Reads the previous record in the file from the current cursor position.
|
void |
refreshRecordCache()
Refreshes the record cache for this file.
|
void |
releaseExplicitLocks()
Releases all locks acquired via the lock() method.
|
void |
removeFileListener(FileListener listener)
Removes a listener from the file listeners list.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a listener from the change list.
|
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a listener from the veto change listeners list.
|
void |
rollback()
Rolls back any transactions since the last commit/rollback boundary.
|
static void |
rollback(AS400 system)
Rolls back any transactions since the last commit/rollback boundary for the specified system.
|
AS400Message[] |
runCommand(java.lang.String command)
Runs a CL command in the DDM host server job.
|
void |
setPath(java.lang.String name)
Sets the integrated file system pathname for the file.
|
void |
setReadNoUpdate(boolean readNoUpdate)
Sets the readNoUpdate flag, which determines whether the records should be locked for update
when doing reads or positionCursor operations in a READ_WRITE open mode.
|
void |
setRecordFormat()
Sets the record format to be used for this file.
|
void |
setRecordFormat(int recordFormat)
Sets the record format to be used for this file.
|
void |
setRecordFormat(RecordFormat recordFormat)
Sets the record format to be used for this file.
|
void |
setRecordFormat(java.lang.String recordFormat)
Sets the record format to be used for this file.
|
void |
setSSPFile(boolean treatAsSSP)
Sets the SSP flag for this file.
|
void |
setSystem(AS400 system)
Sets the system to which to connect.
|
static void |
startCommitmentControl(AS400 system,
int commitLockLevel)
Starts commitment control for the specified system.
|
void |
startCommitmentControl(int commitLockLevel)
Starts commitment control on this file (for this connection).
|
void |
update(Record record)
Updates the record at the current cursor position.
|
void |
write(Record record)
Writes a record to the file.
|
void |
write(Record[] records)
Writes an array of records to the file.
|
protected boolean longRecordNumber
public static final java.lang.String BLANK
public static final int COMMIT_LOCK_LEVEL_ALL
public static final int COMMIT_LOCK_LEVEL_CHANGE
public static final int COMMIT_LOCK_LEVEL_CURSOR_STABILITY
public static final int COMMIT_LOCK_LEVEL_DEFAULT
public static final int COMMIT_LOCK_LEVEL_NONE
public static final int READ_ALLOW_SHARED_READ_LOCK
lock(int)
,
Constant Field Valuespublic static final int READ_ALLOW_SHARED_WRITE_LOCK
lock(int)
,
Constant Field Valuespublic static final int READ_EXCLUSIVE_LOCK
lock(int)
,
Constant Field Valuespublic static final int READ_ONLY
open()
,
Constant Field Valuespublic static final int READ_WRITE
open()
,
Constant Field Valuespublic static final java.lang.String SOURCE_MEMBER_TEXT
public static final java.lang.String TYPE_DATA
public static final java.lang.String TYPE_SOURCE
public static final int WRITE_ALLOW_SHARED_READ_LOCK
lock(int)
,
Constant Field Valuespublic static final int WRITE_ALLOW_SHARED_WRITE_LOCK
lock(int)
,
Constant Field Valuespublic static final int WRITE_EXCLUSIVE_LOCK
lock(int)
,
Constant Field Valuespublic static final int WRITE_ONLY
open()
,
Constant Field Valuespublic AS400File()
public AS400File(AS400 system, java.lang.String name)
system
- The system to which to connect. The system cannot
be null.name
- The integrated file system pathname of the file. The name
cannot be null.public void addFileListener(FileListener listener)
listener
- The FileListener.removeFileListener(com.ibm.as400.access.FileListener)
public void addPhysicalFileMember(java.lang.String name, java.lang.String textDescription) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
name
- The name of the member to create. The name cannot
exceed 10 characters in length. The name cannot be null.textDescription
- The text description with which to create the file.
This value must be 50 characters or less. If this value is null, the
text description will be blank.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped
unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the
system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public void close() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the
system.public void commit() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped
unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the
system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public static void commit(AS400 system) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
system
- The system for which transactions will be committed.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped
unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the
system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public void create(int recordLength, java.lang.String fileType, java.lang.String textDescription) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
recordLength
- The record length with which to create the file. Valid values
are 1 through 32766 inclusive.fileType
- The file type with which to create the file. Valid values are
AS400File.TYPE_DATA or AS400File.TYPE_SOURCE.
If AS400File.TYPE_DATA is specified, the record
format for the file contains one field. If AS400File.TYPE_SOURCE is
specified, the record format for the file contains three
fields: source sequence number, date, and source statement.textDescription
- The text description with which to create the file.
This value must be 50 characters or less.
If this value is null, the empty string, or AS400File.BLANK,
the text description is blank.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public void create(java.lang.String ddsSourceFile, java.lang.String textDescription) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
ddsSourceFile
- The integrated file system pathname of the file containing the
DDS source for the file being created.textDescription
- The text description with which to create the file.
This value must be between 1 and 50 characters inclusive.
If this value is null, the empty string, or AS400File.BLANK,
the text description will be blank.
Specify AS400File.SOURCE_MEMBER_TEXT for the text description if the text
description from ddsSourceFile is to be used.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public void create(RecordFormat recordFormat, java.lang.String textDescription) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
recordFormat
- The record format for the file.textDescription
- The text description with which to create the file.
This value must be between 1 and 50 characters inclusive.
If this value is null, the empty string, or AS400File.BLANK,
the text description will be blank.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public void create(RecordFormat recordFormat, java.lang.String textDescription, java.lang.String altSeq, java.lang.String ccsid, java.lang.String order, java.lang.String ref, boolean unique, java.lang.String format, java.lang.String text) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
recordFormat
- The record format of the file.textDescription
- The text description with which to create the file.
This value must be between 1 and 50 characters inclusive.
If this value is null, the empty string, or AS400File.BLANK,
the text description will be blank.altSeq
- The value to be specified for the file-level keyword ALTSEQ. If no
value is to be specified, null may be specified.ccsid
- The value to be specified for the file-level keyword CCSID. If no
value is to be specified, null may be specified.order
- The value to be specified to indicate in which order records will be
retrieved from the file. Valid values are one of the following file-level keywords:
ref
- The value to be specified for the file-level keyword REF. If no
value is to be specified, null may be specified.unique
- The value that indicates if the file-level keyword UNIQUE is to be specified. true if
UNIQUE should be specified; false otherwise.format
- The value to be specified for the record-level keyword FORMAT. If no
value is to be specified, null may be specified.text
- The value to be specified for the record-level keyword TEXT. If no
value is to be specified, null may be specified. The single quotes required to
surround the TEXT keyword value are added by this class.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public void delete() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
,
deleteMember()
public void deleteCurrentRecord() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void deleteMember() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public void endCommitmentControl() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public static void endCommitmentControl(AS400 system) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
system
- The system for which commitment control should be ended.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- If an exception is thrown while cleaning up.public int getBlockingFactor()
open()
public int getCommitLockLevel()
public int[] getExplicitLocks()
lock(int)
public java.lang.String getFileName()
public java.lang.String getLibraryName()
public java.lang.String getMemberName()
public java.lang.String getPath()
AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
public RecordFormat getRecordFormat()
create(com.ibm.as400.access.RecordFormat, java.lang.String)
,
setRecordFormat()
public AS400 getSystem()
AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public boolean isCommitmentControlStarted()
public static boolean isCommitmentControlStarted(AS400 system)
system
- The system that is checked to determine if commitment control is started.public boolean isOpen()
public boolean isReadNoUpdate()
true
if the records should not be locked for update when doing reads in a
READ_WRITE open mode; false
otherwise.setReadNoUpdate(boolean)
public boolean isReadOnly()
public boolean isReadWrite()
public boolean isSSPFile()
setSSPFile()
.setSSPFile(boolean)
public boolean isWriteOnly()
public void lock(int lockToObtain) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
lockToObtain
- The type of lock to acquire on the file.
Valid lock values are:
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public void open() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
,
setRecordFormat()
public void open(int openType, int blockingFactor, int commitLockLevel) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
openType
- The manner in which to open the file. Valid values are:
blockingFactor
- The number of records to retrieve or to write during a
read or write operation.commitLockLevel
- Used to control record locking during a transaction if
commitment control has been started for the connection.
Valid values are:
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400File(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
,
refreshRecordCache()
,
setRecordFormat()
public void positionCursorAfterLast() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void positionCursorBeforeFirst() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void positionCursorToFirst() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void positionCursorToLast() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void positionCursorToNext() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void positionCursorToPrevious() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record read() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public abstract Record[] readAll() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.public Record readFirst() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record readLast() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record readNext() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public Record readPrevious() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void refreshRecordCache() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void releaseExplicitLocks() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.lock(int)
public void removeFileListener(FileListener listener)
listener
- The FileListener.addFileListener(com.ibm.as400.access.FileListener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void rollback() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.public static void rollback(AS400 system) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
system
- The system for which transactions will be rolled back.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.public AS400Message[] runCommand(java.lang.String command) throws AS400SecurityException, java.lang.InterruptedException, java.io.IOException
Note: If using Toolbox native optimizations, the CL command will run in the current job, since there will not be an associated DDM host server job.
command
- The CL command to run.AS400SecurityException
- If a security or authority error occurs.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.CommandCall
public void setPath(java.lang.String name) throws java.beans.PropertyVetoException
name
- The integrated file system pathname of the file.java.beans.PropertyVetoException
- If a change is vetoed.public void setReadNoUpdate(boolean readNoUpdate)
readNoUpdate
- true
if the records should not be locked for update when doing
reads in a READ_WRITE open mode; false
otherwise.isReadNoUpdate()
public void setRecordFormat() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException, java.beans.PropertyVetoException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.java.beans.PropertyVetoException
- If a change is vetoed.AS400FileRecordDescription.retrieveRecordFormat()
public void setRecordFormat(int recordFormat) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException, java.beans.PropertyVetoException
recordFormat
- The index of the record format to be used.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.java.beans.PropertyVetoException
- If a change is vetoed.AS400FileRecordDescription.retrieveRecordFormat()
public void setRecordFormat(java.lang.String recordFormat) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException, java.beans.PropertyVetoException
recordFormat
- The name of the record format to be used.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.java.beans.PropertyVetoException
- If a change is vetoed.AS400FileRecordDescription.retrieveRecordFormat()
public void setRecordFormat(RecordFormat recordFormat) throws java.beans.PropertyVetoException
Note: This method is not supported for multi-format logical files. Multi-format logical files must use one of the other setRecordFormat() methods.
recordFormat
- The record format for this file.java.beans.PropertyVetoException
- If a change is vetoed.setRecordFormat(int)
,
setRecordFormat(java.lang.String)
public void setSSPFile(boolean treatAsSSP)
treatAsSSP
- The flag indicating how to treat the file.isSSPFile()
public void setSystem(AS400 system) throws java.beans.PropertyVetoException
system
- The system to which to connect.java.beans.PropertyVetoException
- If a change is vetoed.public void startCommitmentControl(int commitLockLevel) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
commitLockLevel
- The type of commitment control
to exercise. Valid values are:
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.public static void startCommitmentControl(AS400 system, int commitLockLevel) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
system
- The system for which commitment control should be started.commitLockLevel
- The type of commitment control
to exercise. Valid values are:
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.public void update(Record record) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
record
- The record with which to update. The record must be a record whose
format matches the record format of this object. To ensure that this
requirement is met, use the
RecordFormat.getNewRecord()
method to obtain a default record whose fields can be set appropriately by
the Java program and then written to the file.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void write(Record record) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
record
- The record to write. The record must be a record whose
format matches the record format of this object. To ensure that this
requirement is met, use the
RecordFormat.getNewRecord()
method to obtain a default record whose fields can be set appropriately by
the Java program and then written to the file.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void write(Record[] records) throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
records
- The records to write. The records must have a format
which matches the record format of this object. To ensure that this
requirement is met, use the
RecordFormat.getNewRecord()
method to obtain default records whose fields can be set appropriately by
the Java program and then written to the file.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.