|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectasjava.uniobjects.UniBase
asjava.uniobjects.UniFile
UniFile is used to access to all file operations
| Field Summary | |
|---|---|
protected int |
uniFileHandle
|
| Fields inherited from class asjava.uniobjects.UniBase |
|---|
inPacket, outPacket, uniConnection, uniEncryptionType, uniParentSession, uniStatus |
| Constructor Summary | |
|---|---|
UniFile()
Default constructor for this class. |
|
UniFile(UniSession aSession,
java.lang.Object aFileName,
int aDictFlag)
|
|
| Method Summary | |
|---|---|
void |
clearFile()
clears a file, deleting all records contained within it. |
void |
close()
closes the file. |
void |
deleteRecord()
deletes the record identified by setRecordID. |
void |
deleteRecord(java.lang.Object aRecordIDObj)
deletes the record identified by aRecordIDObj. |
UniDataSet |
deleteRecord(UniDataSet aDataSet)
deletes the records identified by aDataSet UniDataSet object |
protected UniDataSet |
fileAction(int actionRequested,
UniDataSet dataSet,
java.lang.Object fieldList,
int lockType)
|
UniDynArray |
getAkInfo(java.lang.Object akNameObj)
obtains information concerning the secondary key indexes available for this object. |
int |
getBlockingStrategy()
returns the current blocking strategy. |
java.lang.String |
getFileName()
returns the name of the file this object represents |
int |
getFileType()
returns the type of file this is. |
int |
getLockStrategy()
returns the current locking strategy. |
UniString |
getRecord()
returns the contents of the record that was last read. |
java.lang.String |
getRecordID()
returns the ID of the record that was last read. |
int |
getReleaseStrategy()
returns the current release strategy. |
boolean |
isOpen()
Denotes whether the file is open. |
boolean |
isRecordLocked()
determines whether or not a user or session currently holds a lock on a given record ID. |
boolean |
isRecordLocked(java.lang.Object aRecordIDObj)
determines whether or not a user or session currently holds a lock on a given record ID. |
UniString |
iType(java.lang.Object aRecordIDObj,
java.lang.Object aITypeIDObj)
Evalutes the specified I-descriptor and returns the evaluated string. |
void |
lockFile()
locks this UniVerse file. |
void |
lockRecord(int aLockFlag)
locks the recordID established with the setRecordIDmethod. |
void |
lockRecord(java.lang.Object aRecordIDObj,
int aLockFlag)
locks the recordID established with the aRecordIDObj argument.. |
UniDataSet |
lockRecord(UniDataSet aDataSet,
int aLockFlag)
locks the recordIDs established with the UniDataSet object argument.. |
void |
open()
Opens the named file. |
UniString |
read()
reads the UniVerse record from this file. |
UniString |
read(java.lang.Object aRecordIDObj)
reads the UniVerse record from this file. |
UniString |
read(java.lang.Object aRecordIDObj,
int aLockFlag)
reads the UniVerse record from this file. |
UniDataSet |
read(UniDataSet aRowSet)
reads the set of UniVerse records passed in via the UniDataSet object. |
UniString |
readField(java.lang.Object aRecordIDObj,
int aFieldNumber)
reads the specified field from the UniVerse record identified. |
UniString |
readField(java.lang.Object aRecordIDObj,
int aFieldNumber,
int aLockFlag)
reads the specified field from the UniVerse record identified. |
UniDataSet |
readField(UniDataSet aRowSet,
int aFieldNumber)
reads the set of UniVerse records passed in via the UniDataSet object. |
UniDataSet |
readField(UniDataSet aRowSet,
java.lang.Object aFieldNumber)
reads the set of UniVerse records passed in via the UniDataSet object. |
UniString |
readNamedField(java.lang.Object aFieldNameObj)
reads the field identifed by the named field in aFieldNameObj. |
UniString |
readNamedField(java.lang.Object aRecordIDObj,
java.lang.Object aFieldNameObj)
reads the field identifed by the named field in aFieldNameObj. |
UniDataSet |
readNamedField(UniDataSet aRowSet,
java.lang.Object aFieldNameObj)
reads the set of UniVerse records passed in via the UniDataSet object. |
void |
setBlockingStrategy(int aBlock)
set the blocking strategy to the value indicated by the aBlock
parameter. |
void |
setFileName(java.lang.Object aFileNameObj)
set the filename to be opened |
void |
setLockStrategy(int aLock)
set the locking strategy to the value indicated by the aLock
parameter. |
void |
setRecord(java.lang.Object aStringObj)
set the data portion of the record, primarily to be used for subsequent write methods. |
void |
setRecordID(java.lang.Object aStringObj)
set the record ID of the record to be read |
void |
setReleaseStrategy(int aRelease)
set the release strategy to the value indicated by the aRelease
parameter. |
void |
unlockFile()
unlocks the file |
void |
unlockRecord()
unlocks the recordID established with the setRecordIDmethod. |
void |
unlockRecord(java.lang.Object aRecordIDObj)
unlocks the recordID established with the aRecordIDObj parameter. |
void |
unlockRecord(UniDataSet aDataSet)
unlocks the recordIDs established with the UniDataSet object argument.. |
void |
write()
used to write the data specified with the setRecord and setRecordID
methods into the file. |
void |
write(java.lang.Object aRecordIDObj,
java.lang.Object aRecordDataObj)
used to write the data specified with the aRecordIDObj and aRecordDataObj
parameters into the file. |
void |
write(java.lang.Object aRecordIDObj,
java.lang.Object aRecordDataObj,
int aLockFlag)
used to write the data specified with the aRecordIDObj and aRecordDataObj
parameters into the file. |
UniDataSet |
write(UniDataSet aDataSet)
used to write the data specified with the aDataSet
parameters into the file. |
void |
writeField(int uniFieldNumber)
used to write the data specified with the setRecord and setRecordID
methods into the file, but only the field specified. |
void |
writeField(java.lang.Object aRecordIDObj,
java.lang.Object aRecordDataObj,
int aFieldNumber)
used to write the data specified with the aRecordIDObj and aRecordDataObj
parameters into the file, but only the field specified. |
void |
writeField(java.lang.Object aRecordIDObj,
java.lang.Object aRecordDataObj,
int aFieldNumber,
int aLockFlag)
used to write the data specified with the aRecordIDObj and aRecordDataObj
parameters into the file, but only the field specified. |
UniDataSet |
writeField(UniDataSet aDataSet,
int uniFieldNumber)
used to write the data specified with the aDataSet
parameters into the file. |
UniDataSet |
writeField(UniDataSet aDataSet,
java.lang.Object uniFieldName)
used to write the data specified with the aDataSet
parameters into the file. |
void |
writeNamedField(java.lang.Object aFieldName,
java.lang.Object aString)
used to write the data specified with the aRecordIDObj and aRecordDataObj
parameters into the file, but only the name field specified. |
void |
writeNamedField(java.lang.Object aRecordID,
java.lang.Object aFieldName,
java.lang.Object aString)
used to write the data specified with the aRecordID and aRecordDataObj
parameters into the file, but only the name field specified. |
UniDataSet |
writeNamedField(UniDataSet aDataSet,
java.lang.Object aFieldName)
used to write the data specified with the aDataSet
parameters into the file. |
| Methods inherited from class asjava.uniobjects.UniBase |
|---|
getEncryptionType, isCommandActive, setEncryptionType, status |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int uniFileHandle
| Constructor Detail |
public UniFile()
throws UniFileException
UniFileException - is thrown if an error occurs
public UniFile(UniSession aSession,
java.lang.Object aFileName,
int aDictFlag)
throws UniFileException
| Method Detail |
public void clearFile()
throws UniFileException
BlockingStrategy, which can be set with the
setBlockingStrategy method, determines the behavior
UniFileException - is thrown is an error occurs
public void close()
throws UniFileException
UniFileException - is thrown is an error occurs
public void deleteRecord()
throws UniFileException
setRecordID.
UniFileException - is thrown is an error occurs
public UniDataSet deleteRecord(UniDataSet aDataSet)
throws UniFileException
aDataSet UniDataSet object
aDataSet - UniDataSet object which identifies which record IDs to be deleted.
UniFileException - is thrown is an error occurs
public void deleteRecord(java.lang.Object aRecordIDObj)
throws UniFileException
aRecordIDObj.
aRecordIDObj - identifies which record ID is to be deleted.
UniFileException - is thrown is an error occurs
public UniDynArray getAkInfo(java.lang.Object akNameObj)
throws UniFileException
akNameObj is passed in as an empty string, then the list of
available indices is returned
akNameObj - name of the index to query about
UniFileException - is thrown if an error occurspublic int getBlockingStrategy()
UniSession.setDefaultBlockingStrategy method. Valid values are:
status to indicate
the state of the lock.
setBlockingStrategy(int)public java.lang.String getFileName()
setFileName(java.lang.Object)public int getFileType()
public int getLockStrategy()
UniSession.setDefaultLockStrategy method. Valid values are:
setLockStrategy(int)public UniString getRecord()
read, readField, or readNamedField is performed.
setRecord(java.lang.Object),
read(),
readField(java.lang.Object, int),
readNamedField(java.lang.Object)public java.lang.String getRecordID()
read, readField, or readNamedField is performed.
setRecordID(java.lang.Object),
read(),
readField(java.lang.Object, int),
readNamedField(java.lang.Object)public int getReleaseStrategy()
UniSession.setDefaultReleaseStrategy method. Valid values are:
setLockStrategy
method. Locks can only be released with the
unlockRecordmethod
setRecordID method
setReleaseStrategy(int),
setLockStrategy(int),
unlockRecord()public boolean isOpen()
true value indicates the file is
still open for use, a false indicates the file is closed and unavailable
until reopened.
public boolean isRecordLocked()
throws UniFileException
UniFileException - is thrown if an error occurs
public boolean isRecordLocked(java.lang.Object aRecordIDObj)
throws UniFileException
aRecordIDObj - represents the record ID to be checked.
UniFileException - is thrown if an error occurs
public UniString iType(java.lang.Object aRecordIDObj,
java.lang.Object aITypeIDObj)
throws UniFileException
aRecordIDObj - record ID of the record supplied as data to the Itype facilityaITypeIDObj - record ID of the Idescriptor record to be evaluated
UniFileException - is thrown if an error occurs
public void lockFile()
throws UniFileException
UniFileException - is thrown if an error is detected
public void lockRecord(int aLockFlag)
throws UniFileException
setRecordIDmethod.
This method is used to override the current locking strategy
aLockFlag - Type of lock to set. Valid values are:
UniFileException - is thrown if an error is detected
public void lockRecord(java.lang.Object aRecordIDObj,
int aLockFlag)
throws UniFileException
aRecordIDObj argument..
This method is used to override the current locking strategy
aRecordIDObj - String denoting which record ID to lockaLockFlag - Type of lock to set. Valid values are:
UniFileException - is thrown if an error is detected
public UniDataSet lockRecord(UniDataSet aDataSet,
int aLockFlag)
throws UniFileException
UniDataSet object argument..
This method is used to override the current locking strategy
aDataSet - UniDataSet denoting which record IDs to lockaLockFlag - Type of lock to set. Valid values are:
UniFileException - is thrown if an error is detected
public void open()
throws UniFileException
UniFileException - is thrown if an error occurs
public UniString read()
throws UniFileException
setRecordID method.
UniFileException - will be thrown if an error occurssetRecordID(java.lang.Object)
public UniDataSet read(UniDataSet aRowSet)
throws UniFileException
aRowSet - list of record IDs to be read from this file
UniFileException - will be thrown if an error occurs
public UniString read(java.lang.Object aRecordIDObj)
throws UniFileException
aRecordIDObj argument that is passed in.
aRecordIDObj - record ID to be read from the file
UniFileException - will be thrown if an error occurs
public UniString read(java.lang.Object aRecordIDObj,
int aLockFlag)
throws UniFileException
aRecordIDObj argument that is passed in. It will also lock the
record according to the aLockFlag argument that is passed in.
aRecordIDObj - record ID to be read from the fileaLockFlag - is the type of lock that is to be set. See setLockStrategy
for details on valid values
UniFileException - will be thrown if an error occurssetLockStrategy(int)
public UniString readField(java.lang.Object aRecordIDObj,
int aFieldNumber)
throws UniFileException
aRecordIDObj argument that is passed in. It will
return only the field number specified in aFieldNumber
aRecordIDObj - record ID to be read from the fileaFieldNumber - integer representing which field is to be read
UniFileException - will be thrown if an error occurs
public UniString readField(java.lang.Object aRecordIDObj,
int aFieldNumber,
int aLockFlag)
throws UniFileException
aRecordIDObj argument that is passed in. It will
return only the field number specified in aFieldNumber. It will set
a lock on the record based on the value of aLockFlag
aRecordIDObj - record ID to be read from the fileaFieldNumber - integer representing which field is to be readaLockFlag - type of lock to be set on the record
UniFileException - will be thrown if an error occurs
public UniDataSet readField(UniDataSet aRowSet,
int aFieldNumber)
throws UniFileException
aRowSet - list of record IDs to be read from this file
UniFileException - will be thrown if an error occurs
public UniDataSet readField(UniDataSet aRowSet,
java.lang.Object aFieldNumber)
throws UniFileException
aRowSet - list of record IDs to be read from this file
UniFileException - will be thrown if an error occurs
public UniString readNamedField(java.lang.Object aFieldNameObj)
throws UniFileException
aFieldNameObj. It
does this by extracting the physical field number from the dictionary associated
with this file, and then performs a readField on that field. It will
use the record ID established via the setRecordID as the record to
be read
aFieldNameObj - name of the field in the dictionary to use as the field number
UniFileException - will be thrown if an error occurs
public UniString readNamedField(java.lang.Object aRecordIDObj,
java.lang.Object aFieldNameObj)
throws UniFileException
aFieldNameObj. It
does this by extracting the physical field number from the dictionary associated
with this file, and then performs a readField on that field.
aRecordIDObj - record ID to be readaFieldNameObj - name of the field in the dictionary to use as the field number
UniFileException - will be thrown if an error occurs
public UniDataSet readNamedField(UniDataSet aRowSet,
java.lang.Object aFieldNameObj)
throws UniFileException
aRowSet - list of record IDs to be read from this fileaFieldNameObj - name of the field in the dictionary to use as the field number
UniFileException - will be thrown if an error occurs
public void setBlockingStrategy(int aBlock)
throws UniFileException
aBlock
parameter.
aBlock - integer representing the blocking strategy to be used
UniFileException - is thrown if an invalid blocking strategy is setgetBlockingStrategy()public void setFileName(java.lang.Object aFileNameObj)
aFileNameObj - name of the UniVerse file to be openedgetFileName()
public void setLockStrategy(int aLock)
throws UniFileException
aLock
parameter.
aLock - integer representing the locking strategy to be used
UniFileException - is thrown if an invalid blocking strategy is setgetLockStrategy()public void setRecord(java.lang.Object aStringObj)
write methods.
aStringObj - data portion of the recordgetRecord(),
write()
public void setRecordID(java.lang.Object aStringObj)
throws UniFileException
aStringObj - String representing the record ID to be read from the file
UniFileException - is thrown if an error occursgetRecordID()
public void setReleaseStrategy(int aRelease)
throws UniFileException
aRelease
parameter.
aRelease - integer representing the release strategy to be used
UniFileExceptiongetReleaseStrategy()
public void unlockFile()
throws UniFileException
UniFileException - is thrown if an error is detectedlockFile()
public void unlockRecord()
throws UniFileException
setRecordIDmethod.
UniFileException - is thrown if an error is detectedsetRecordID(java.lang.Object)
public void unlockRecord(UniDataSet aDataSet)
throws UniFileException
UniDataSet object argument..
aDataSet - UniDataSet denoting which record IDs to lock
UniFileException - is thrown if an error is detected
public void unlockRecord(java.lang.Object aRecordIDObj)
throws UniFileException
aRecordIDObj parameter.
aRecordIDObj - record id to be unlocked
UniFileException - is thrown if an error is detectedsetRecordID(java.lang.Object)
public void write()
throws UniFileException
setRecord and setRecordID
methods into the file. After completion, the status method can be used
to determine the results of the operation. A 0 indicates the record was locked, a -2
indicates it was not locked
UniFileException - is thrown if an error occurssetRecord(java.lang.Object),
setRecordID(java.lang.Object),
UniBase.status()
public void write(java.lang.Object aRecordIDObj,
java.lang.Object aRecordDataObj)
throws UniFileException
aRecordIDObj and aRecordDataObj
parameters into the file. After completion, the status method can be used
to determine the results of the operation. A 0 indicates the record was locked, a -2
indicates it was not locked
aRecordIDObj - record ID that is to be writtenaRecordDataObj - record data that is to be written
UniFileException - is thrown if an error occurssetRecord(java.lang.Object),
setRecordID(java.lang.Object),
UniBase.status()
public void write(java.lang.Object aRecordIDObj,
java.lang.Object aRecordDataObj,
int aLockFlag)
throws UniFileException
aRecordIDObj and aRecordDataObj
parameters into the file. After completion, the status method can be used
to determine the results of the operation. A 0 indicates the record was locked, a -2
indicates it was not locked. You can use this version to also specify the kind of
locking to be used during the write operation
aRecordIDObj - record ID that is to be writtenaRecordDataObj - record data that is to be writtenaLockFlag - type of lock to be set
UniFileException - is thrown if an error occurssetRecord(java.lang.Object),
setRecordID(java.lang.Object),
UniBase.status()
public UniDataSet write(UniDataSet aDataSet)
throws UniFileException
aDataSet
parameters into the file. After completion, the returned UniDataSet object can be used
to determine the results of the operation. A 0 indicates the record was locked, a -2
indicates it was not locked
aDataSet - UniDataSet object representing the data that is to be written
UniFileException - is thrown if an error occurs
public void writeField(int uniFieldNumber)
throws UniFileException
setRecord and setRecordID
methods into the file, but only the field specified. After completion, the status method can be used
to determine the results of the operation. A 0 indicates the record was locked, a -2
indicates it was not locked
uniFieldNumber - field to be written
UniFileException - is thrown if an error occurssetRecord(java.lang.Object),
setRecordID(java.lang.Object),
UniBase.status()
public UniDataSet writeField(UniDataSet aDataSet,
int uniFieldNumber)
throws UniFileException
aDataSet
parameters into the file. After completion, the returned UniDataSet object can be used
to determine the results of the operation. A 0 indicates the record was locked, a -2
indicates it was not locked
aDataSet - UniDataSet object representing the data that is to be writtenuniFieldNumber - field to be written
UniFileException - is thrown if an error occurs
public UniDataSet writeField(UniDataSet aDataSet,
java.lang.Object uniFieldName)
throws UniFileException
aDataSet
parameters into the file. After completion, the returned UniDataSet object can be used
to determine the results of the operation. A 0 indicates the record was locked, a -2
indicates it was not locked
aDataSet - UniDataSet object representing the data that is to be writtenuniFieldName - field to be written
UniFileException - is thrown if an error occurs
public void writeField(java.lang.Object aRecordIDObj,
java.lang.Object aRecordDataObj,
int aFieldNumber)
throws UniFileException
aRecordIDObj and aRecordDataObj
parameters into the file, but only the field specified. After completion, the status method can be used
to determine the results of the operation. A 0 indicates the record was locked, a -2
indicates it was not locked
aRecordIDObj - record ID to be writtenaRecordDataObj - data to be writtenaFieldNumber - field within the record to be written
UniFileException - is thrown if an error occursUniBase.status()
public void writeField(java.lang.Object aRecordIDObj,
java.lang.Object aRecordDataObj,
int aFieldNumber,
int aLockFlag)
throws UniFileException
aRecordIDObj and aRecordDataObj
parameters into the file, but only the field specified. After completion, the status method can be used
to determine the results of the operation. A 0 indicates the record was locked, a -2
indicates it was not locked. You can also specify the specific locking to be used via
the aLockFlag parameter
aRecordIDObj - record ID to be writtenaRecordDataObj - data to be writtenaFieldNumber - field within the record to be writtenaLockFlag - integer representing the type of lock to be set.
UniFileException - is thrown if an error occursUniBase.status()
public void writeNamedField(java.lang.Object aFieldName,
java.lang.Object aString)
throws UniFileException
aRecordIDObj and aRecordDataObj
parameters into the file, but only the name field specified. The Named Field
is extracted from the files Dictionary. After completion, the status method can be used
to determine the results of the operation. A 0 indicates the record was locked, a -2
indicates it was not locked
aFieldName - name of the field that is to be writtenaString - data to be written to that field
UniFileException - is thrown if an error occursUniBase.status()
public void writeNamedField(java.lang.Object aRecordID,
java.lang.Object aFieldName,
java.lang.Object aString)
throws UniFileException
aRecordID and aRecordDataObj
parameters into the file, but only the name field specified. The Named Field
is extracted from the files Dictionary. After completion, the status method can be used
to determine the results of the operation. A 0 indicates the record was locked, a -2
indicates it was not locked
aRecordID - record ID that is to be writtenaFieldName - name of the field that is to be writtenaString - data to be written to that field
UniFileException - is thrown if an error occursUniBase.status()
public UniDataSet writeNamedField(UniDataSet aDataSet,
java.lang.Object aFieldName)
throws UniFileException
aDataSet
parameters into the file. After completion, the returned UniDataSet object can be used
to determine the results of the operation. A 0 indicates the record was locked, a -2
indicates it was not locked
aDataSet - UniDataSet object representing the data that is to be writtenaFieldName - field to be written
UniFileException - is thrown if an error occurs
protected UniDataSet fileAction(int actionRequested,
UniDataSet dataSet,
java.lang.Object fieldList,
int lockType)
throws UniFileException
UniFileException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||