Package com.softwaremining.wrappers
Class AbstractBasePersistence
java.lang.Object
com.softwaremining.wrappers.CBLBean
com.softwaremining.wrappers.AbstractBasePersistence
- All Implemented Interfaces:
IPersistence,AbstractDataObject,ICBLBeanNGroup,ICBLContainer,IFieldContainer,ISMBean,ISMDataType
- Direct Known Subclasses:
AbstractFile,AbstractIndexedFile,IndexedFileSingleProcess
For internal use only
-
Field Summary
FieldsFields inherited from class com.softwaremining.wrappers.CBLBean
EBCDIC_JIT_PD_SUPPORT_FOR_SEQ_FILES, INDEX_FOR_NON_ARRAY_VERSION_OF_FIELD, INDEX_ZERO, log, tmp_lengthofAssignedValue, totalRuntime_allocate, totalRuntime_calcFieldOffsets, totalRuntime_getMemoryPosition, totalRuntime_setFieldFormattedFields inherited from interface com.softwaremining.sql.IPersistence
ACCESS_MODE_DYNAMIC, ACCESS_MODE_RANDOM, ACCESS_MODE_SEQUENTIAL, ASCENDING_RECORD_KEY, CONDITION_TYPE_EQUALS, CONDITION_TYPE_GREATER, CONDITION_TYPE_GREATER_OR_EQUALS, CONDITION_TYPE_IGNORE, CONDITION_TYPE_IGNORE_FOR_SQL_LIKE, CONDITION_TYPE_LESS, CONDITION_TYPE_LESS_OR_EQUALS, CONDITION_TYPE_LIKE, CONDITION_TYPE_NO_CONDITION, CONDITION_TYPE_NOT_ASSIGNED, DESCENDING_RECORD_KEY, OPEN_MODE_EXTEND, OPEN_MODE_I_O, OPEN_MODE_INPUT, OPEN_MODE_NOT_OPENED, OPEN_MODE_OUTPUT, STATUS_AT_END, STATUS_CLOSE_FILE_FILE_NOT_OPEN, STATUS_DUP_KEY, STATUS_FAILED_CLOSING, STATUS_INCORRECT_READ_OF_UNOPENED_FILE, STATUS_INCORRECT_RECORDSIZE_REWRITE, STATUS_INSERT_ERR_INAPPROPRIATE_FILE, STATUS_INSERT_ERR_INVALID_KEY, STATUS_LOCK, STATUS_NOT_FOUND, STATUS_OPEN_FILE_FILE_NOT_FOUND, STATUS_REWRITE_WITHOUT_READ, STATUS_SM_FAIL_UNKOWN_REASON, STATUS_SM_NOT_ASSIGNED, STATUS_SUCCESS, UNCERTAIN_OF_RETURN_VALUE -
Constructor Summary
ConstructorsConstructorDescriptiondefault constructorstandard constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidassignAccessMode(int accessMode) Similar to the COBOL ACCESS Mode - defaults to ACCESS_MODE_RANDOMvoidassignFileName(String fileName) In Sequential File Processing - it overwrites the default name of an input/output file automatically assigned by the system.voidassignLock(boolean value) voidassignStatus(CBLBean wrapper) set the status objectvoidassignStatus(ISMObject status) set the status objectvoidassignStatusAsPrimitive(int newStatus) Used internally to set the IO operation status-values.voidassignStatusValue(int value) Used internally to set the IO operation status-values.protected voidassignStatusValue(String value) Method for assigning a string to the status.voidassignTableName(String fileName) In Sequential File Processing - it overwrites the default name of an input/output file automatically assigned by the system.abstract intclear()abstract intclose()Close the fileintdelete()equivalent of COBOL delete (for VSAM).abstract intwhen operation is Unsuccessful throw Exception (e.g KeyNotFountException).intinsert()Insert a record - populate the values from the existing fieldsabstract intwhen operation is Unsuccessful throw Exception (e.g DuplicateKeyException).intnext()read the next record from file.abstract intwhen operation is Unsuccessful throw Exception (e.g AtEndException).abstract intopen(int openMode) intprev()abstract intwhen operation is Unsuccessful throw Exception (e.g AtEndException).intread()READ is used in conjunction with SEEK statements.abstract intTypically called repeatedly to read next record sequentially from a file.booleanreadRow()Similar to read() - but returns true or false rather than an integer from IPersistenceintSimilar to the COBOL ACCESS ModeretrieveFileName(boolean prefixFileNameWithCallingProgram) In Sequential File Processing - it returns the default name of an input/output fileabstract AbstractCBLFieldabstract intfinal LongFor internal use onlyUsed internally to set the IO operation status-values.intUsed internally to set the IO operation status-values.intupdate()Update the current record with the current record structure.abstract intwhen operation is Unsuccessful throw Exception (e.g DuplicateKeyException).Methods inherited from class com.softwaremining.wrappers.CBLBean
addCorrespondingValue, addCorrespondingValue, allocate, assignAddressTo, assignAddressTo, assignBean, assignBytesEncoded, assignCachedInitializationValue, assignCorrespondingValue, assignCorrespondingValue, assignDefaultValue, assignDependingField, assignEbcdicBytes, assignEbcdicJIT_PdSupportForSequentialFiles, assignEncodedValue, assignExemptFromMemRelease, assignExternal, assignHighValues, assignInternalVars, assignLowValues, assignRawEbcdicBytes, assignRecordSize, assignRedefines, assignRedefines, assignSessionId, assignStringFormatted, assignSubstring, assignSubstring, assignToAddressOf, assignToAddressOf, assignToAddressOf, assignToAddressOf, assignToAllFields, assignValue, assignValue, assignValue, assignValue, assignValue, assignValue, assignValue, assignValue, calculateStorageSize, containsPointers, equals, equals, equals, equals, equalsRightTrimmed, fieldsCount, fill, fill, fill, fill, fill, getValue, hasPackedDecimalFields, initDefaultValues, initialize, initialize, isExemptFromMemRelease, isFilled, isFilled, isFilled, isFilled, isGreaterThan, isGreaterThan, isGreaterThan, isHighValues, isInvolvedInDependency, isInvolvedInExternalDependency, isLessOrEqualTo, isLessOrEqualTo, isLessOrEqualTo, isLessOrEqualTo, isLessOrEqualTo, isLessThan, isLessThan, isLessThan, isLessThan, isLessThan, isLowValues, isRedefinedByAnotherClass, isResourceAlreadyReleased, lengthOf, print, printFieldPosition, printFieldValues, printOrderedFieldPosition, releaseResources, releaseResources, resetCachedValues, resetCompressedFieldList, resetStorageManager, resetStructure, resize, retrieveActualLength, retrieveAsInt, retrieveAsString, retrieveCachedInitializationValue, retrieveCompressedFields, retrieveDependedFieldsList, retrieveEbcdicBytes, retrieveEbcdicValue, retrieveEncodedValue, retrieveField, retrieveField, retrieveFieldAtMemoryPosition, retrieveFieldFormatted, retrieveFields, retrieveIsTargetOfPointers, retrievePrimitiveFields, retrieveRawEbcdicBytes, retrieveRedefinesList, retrieveSQLObject, retrieveStorageBytes, retrieveStorageCellSize, retrieveSubstring, retrieveSubstring, retrieveTopLevelField, retrieveValue, retrieveValue, setValue, stringValue, subtractCorrespondingValue, subtractCorrespondingValue, toString
-
Field Details
-
fileName
-
ownerClassName
-
status
-
-
Constructor Details
-
AbstractBasePersistence
public AbstractBasePersistence()default constructor -
AbstractBasePersistence
standard constructor- Parameters:
owner-
-
-
Method Details
-
assignFileName
In Sequential File Processing - it overwrites the default name of an input/output file automatically assigned by the system.- Parameters:
fileName-
-
assignTableName
In Sequential File Processing - it overwrites the default name of an input/output file automatically assigned by the system.- Parameters:
fileName-
-
retrieveFileName
In Sequential File Processing - it returns the default name of an input/output file- Parameters:
fileName-
-
retrieveFileName
-
assignAccessMode
public void assignAccessMode(int accessMode) Similar to the COBOL ACCESS Mode - defaults to ACCESS_MODE_RANDOM- Parameters:
accessMode- : types are defined in IPersistence.ACCESS_MODE_xxx : Sequential, Random or Dynamic
-
retrieveAccessMode
public int retrieveAccessMode()Similar to the COBOL ACCESS Mode- Parameters:
accessMode- : types are defined in IPersistence.ACCESS_MODE_xxx : Sequential, Random or Dynamic
-
assignStatus
set the status object- Parameters:
status-
-
assignStatus
set the status object- Parameters:
status-
-
assignStatusValue
public void assignStatusValue(int value) Used internally to set the IO operation status-values. Also if a FileStatus field is defined, the system will allocate correct values to it.- Parameters:
value- - .. one of ACMBasePersistent.STATUS_xxxx
-
assignStatusValue
Method for assigning a string to the status. Note that in MicroFOcus, the LOCK status is represented bt "9D", ie the 2nd value is a String- Parameters:
value-
-
retrieveStatusValue
public int retrieveStatusValue()Used internally to set the IO operation status-values. Also if a FileStatus field is defined, the system will allocate correct values to it.- Returns:
- - the status value .. one of ACMBasePersistent.STATUS_xxxx
-
retrieveStatusField
Used internally to set the IO operation status-values. -
assignStatusAsPrimitive
public void assignStatusAsPrimitive(int newStatus) Used internally to set the IO operation status-values. -
assignLock
public void assignLock(boolean value) -
retrieveFirstLevelEntry
-
open
- Throws:
IOCriticalException
-
close
Close the file- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOCriticalException
-
retrieveOpenMode
public abstract int retrieveOpenMode() -
nextRecord
when operation is Unsuccessful throw Exception (e.g AtEndException). See com.softwaremining.wrappers.exceptions- Returns:
- Throws:
IOStatusException
-
prevRecord
when operation is Unsuccessful throw Exception (e.g AtEndException). See com.softwaremining.wrappers.exceptions- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
readRecord
Typically called repeatedly to read next record sequentially from a file. Otherwise, it performs a SEEK on the current RecordKey - and then reads the file. when operation is Unsuccessful throw Exception (e.g AtEndException). See com.softwaremining.wrappers.exceptions- Returns:
- Throws:
IOStatusException
-
updateRecord
when operation is Unsuccessful throw Exception (e.g DuplicateKeyException). See com.softwaremining.wrappers.exceptions- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
insertRecord
when operation is Unsuccessful throw Exception (e.g DuplicateKeyException). See com.softwaremining.wrappers.exceptions- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
deleteRecord
when operation is Unsuccessful throw Exception (e.g KeyNotFountException). See com.softwaremining.wrappers.exceptions- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
clear
- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
readRow
public boolean readRow()Similar to read() - but returns true or false rather than an integer from IPersistence- Returns:
-
read
public int read()READ is used in conjunction with SEEK statements. Read the next record, trapping at end exceptions ....- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
-
next
public int next()read the next record from file. DOES NOT THROW AtEndException ... instead only the FileStatus will be changed.- Returns:
- false if there was no more record, or problem encountered. Otherwise returns true;
-
insert
public int insert()Insert a record - populate the values from the existing fields -
update
public int update()Update the current record with the current record structure. If at end of file is reached, it does not throw an exception -
delete
public int delete()equivalent of COBOL delete (for VSAM). -
prev
public int prev() -
retrieveSessionId
Description copied from class:CBLBeanFor internal use only- Specified by:
retrieveSessionIdin interfaceISMBean- Overrides:
retrieveSessionIdin classCBLBean
-