Package com.softwaremining.cics
Class CicsPersistence
java.lang.Object
com.softwaremining.wrappers.CBLBean
com.softwaremining.wrappers.AbstractBasePersistence
com.softwaremining.sql.AbstractIndexedFile
com.softwaremining.sql.SQLWrapper
com.softwaremining.cics.CicsPersistence
- All Implemented Interfaces:
IPersistence,ISQLWrapper,AbstractDataObject,ICBLBeanNGroup,ICBLContainer,IFieldContainer,ISMBean,ISMDataType
- Direct Known Subclasses:
QueueRecord
This class is the super class of data-items accessed by CICS IO operations
e.g. CICS READ , WRITE, DELETE, REWRITE
-
Field Summary
Fields inherited from class com.softwaremining.sql.SQLWrapper
connection, nativeKeys, openMode, postFixTableNameToImplicitDatabaseKey, resultSet, sequentialKeyGeneration, suppressNextReadCurrentFields inherited from class com.softwaremining.sql.AbstractIndexedFile
delegateDAOFields inherited from class com.softwaremining.wrappers.AbstractBasePersistence
fileName, ownerClassName, statusFields inherited from class com.softwaremining.wrappers.CBLBean
EBCDIC_JIT_PD_SUPPORT_FOR_SEQ_FILES, INDEX_FOR_NON_ARRAY_VERSION_OF_FIELD, INDEX_ZERO, 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassignFileName(AbstractDataObject fieldName) In Sequential File Processing - it overwrites the default name of the SQL Table automatically assigned by the system.voidassignFileName(String fileName) In Sequential File Processing - it overwrites the default name of the SQL Table automatically assigned by the system.voidassignGenericRecordKeyLength(int genericKeyLength) voidassignKeyValue(AbstractDataObject keyValueField) updates the value of Record-Keys defined for this class with every read.voidassignLength(int maxLength) Related to the length of the RECORDS.voidassignLock(boolean newLocValue) Blank method - no functionality is currently deemed to be requiredvoidassignRecordKey(ISMObject _recordKey) Used only used by CicsPersistent Subclasses.voidassignRecordKeyLength(int keyLength) Deprecated.voidassignRecordKeyValue(String newValue) voidassignResponseCodeField(ISMObject status) protected voidassignResponseCodeValue(int value) Used internally to set the IO operation status-values.voidassignTableName(String newName) Called Programs declaring instances of the persistence classes
FOr Indexed-Files, this call often relates to setting name to a data-file name E.g.voidassignTempStorage(ISMObject object) Deprecated.voidassignTreatAsSQLWrapper(boolean treatAsSQLWrapper) allows CicsPersistent classes to be treated as SQLWrapper (Object-relational VSAM Files) by batch programs.voidDelete all records .intclose()Close the fileintdelete()Equivalent of COBOL delete (for VSAM).intsimilar to clear().intintUsed internally to set the IO operation status-values.intinsert()Insert a record - populate the values from the existing fieldsintsimilar to insert().booleanfor internal use onlyintTranslation of COBOL Read Next ...intTranslation of COBOL Read Prev ...protected intconstructorprotected intprocessException(CBLException e, boolean invokeHandler) Set appropriate responseCodes, and invoke the conditionHandlerprotected intprocessException(CBLException e, boolean invokeHandler, int overridingResponseCode) Set appropriate responseCodes, and invoke the conditionHandlerintread()Translation of CICS READ Read is usually used to read random organized data.intto be removed - CICS subsystem does not call this - see 0011729 similar to readNext().voidreleaseResources(boolean forceRelease) this is called internally - after a program is CANCEL'ed.protected voidIndexed files with totally different formats will sometimes still need to go to same database table.voidAfter setting a GENERIC-KEY, the original Non-generic-Key has to be restored.used internally by softwareMiningintseek()Translation of CICS STARTBR Opens a data-set/resultset matching the keys.intinttranslation of CICS STARTBRintseekRecord(ISMObject[] keys, int conditionType) intseekRecord(ISMObject key, int conditionType) translation of COBOL START The method will open a result-set, read the information and then Close the result-set.protected voidsetEibFunction(String value) Used internally to set the IO operation status-values.voidsetStorageLength(int newLength) to do ...intupdate()Update the current record with the current record structure.intsimilar to update().intvalidateConditionType(ISMObject key, int conditionType) for internal use onlyMethods inherited from class com.softwaremining.sql.SQLWrapper
_clear, _close, _commit, _deleteAllRecord, _deleteRecord, _insertRecord, _nextRecord, _open, _prevRecord, _readRecord, _readWithLock, _rollback, _seekRecord, _unlock, _updateRecord, addRecordKey, addSearchParameter, addSearchParameter, assignAdditionalKeyPosition, assignAdditionalSQLConditions, assignAdditionalSQLConditions, assignAdditionalSQLForeignKeyCondition, assignAdditionalSQLOrderBy, assignAlternateKey, assignCachedSeekValues, assignChangeGEConditonToLIKE, assignChangeGTEQ2EQForLIKECondition, assignConnection, assignDbDecorator, assignExpandGTEQSearches, assignFetchDirectionIsForward, assignFetchSize, assignFileOpened, assignGDGCondition, assignGDGProperty, assignGenerate_OrderBy_ForReadStatements, assignIgnoreOriginalKeys, assignIncludeRedefinedFieldsInCRUD, assignKeyIsUnique, assignKeyValue, assignLastSeekCondition, assignLastSeekConditionLookedForEquality, assignLowerLimitForExpandGTEQSearches, assignOpenMode, assignRecordKey, assignRecordKeysAllDescending, assignRelativeKey, assignResultSet, assignResultSetFetchSize, assignRowFacade, assignSequentialKeyGeneration, assignSQLConditions, assignSQLTableName, assignSuppressSeek, assignThrowInvalidKeyException, assignTopRowSelectStrategyCount, assignTopRowSelectStrategyRange, assignUpperLimitForExpandGTEQSearches, clearAdditionalSQLCondition, clearSearchParameter, createAndretrieveSearchParameterInstance, isChangeGEConditonToLIKE, isChangeGTEQ2EQForLIKECondition, isFetchDirectionBackward, isFetchDirectionForward, isFileOpened, isIgnoreOriginalKeys, isKept, isKeyUnique, isLastSeekConditionLookedForEquality, isReduceGEorEQ, isSeekSuppressed, isSequentialKeyGeneration, isSuppressNextReadCurrent, readCurrent, reduceGEorEQ, releaseResources, resetRowFacade, restoreResultSet, retreiveLowerLimitForExpandGTEQSearches, retreiveUpperLimitForExpandGTEQSearches, retrieveAdditionalSearchParameters, retrieveAdditionalSQLCondition, retrieveAdditionalSQLOrderBy, retrieveAscentDescendOrder, retrieveCachedSeekValues, retrieveConnection, retrieveDbDecorator, retrieveForeignKeys, retrieveGenerate_OrderBy_ForReadStatements, retrieveImplicitDatabaseKey, retrieveIncludeRedefinedFieldsInCRUD, retrieveLastSeekCondition, retrieveOpenMode, retrieveRecordKey, retrieveRecordKeyValue, retrieveResultSet, retrieveResultSetFetchSize, retrieveRowFacade, retrieveTableName, retrieveThrowInvalidKeyException, retrieveTopRowSelectStrategyCount, retrieveTopRowSelectStrategyStartingRow, setLock, setRelativeKey, trimCachedSeekValues, useOidTableForKeyGenerationMethods inherited from class com.softwaremining.sql.AbstractIndexedFile
_assignKeyValue, assignAccessMode, assignDelegateDAO, assignStatus, clear, commit, deleteAllRecord, next, open, prev, readWithLock, retrieveDelegateDAO, rollback, seek, seek, seekRecord, unlockMethods inherited from class com.softwaremining.wrappers.AbstractBasePersistence
assignStatus, assignStatusAsPrimitive, assignStatusValue, assignStatusValue, readRow, retrieveAccessMode, retrieveFileName, retrieveFileName, retrieveFirstLevelEntry, retrieveSessionId, retrieveStatusField, retrieveStatusValueMethods 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, 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.softwaremining.wrappers.ISMBean
assignExemptFromMemRelease, assignSessionId, assignValue, initialize, isExemptFromMemRelease, isResourceAlreadyReleased, resetStructure, retrieveActualLength, retrieveAsString, retrieveField, retrieveField, retrieveTopLevelField, retrieveValue, stringValueMethods inherited from interface com.softwaremining.sql.ISQLWrapper
assignStatusValue, retrieveAccessMode, retrieveFileName, retrieveSessionId, retrieveStatusValue
-
Constructor Details
-
CicsPersistence
-
-
Method Details
-
getOwningCicsService
-
resetCicsDelegate
protected void resetCicsDelegate()Indexed files with totally different formats will sometimes still need to go to same database table. Assigning a DelegateDAO causes the delegate class to be used for access to the SQLDatabase. The values are then transfered between "this" class and delegateDAO- Overrides:
resetCicsDelegatein classAbstractIndexedFile- Parameters:
delegateDAO-
-
processException
constructor- Parameters:
owner-eibaid- / public CicsPersistence(CicsBaseService owner ,Eibaid eibaid) { super(owner); this.eibaid = eibaid; this.owningCicsService = owner; }
-
processException
Set appropriate responseCodes, and invoke the conditionHandler- Parameters:
e-- Returns:
-
processException
Set appropriate responseCodes, and invoke the conditionHandler- Parameters:
e-- Returns:
-
assignResponseCodeValue
protected void assignResponseCodeValue(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 ..
-
assignResponseCodeField
-
setEibFunction
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 ..
-
getResponseCode
public int getResponseCode()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
-
getResponse2Code
public int getResponse2Code() -
assignKeyValue
updates the value of Record-Keys defined for this class with every read.- Specified by:
assignKeyValuein interfaceISQLWrapper- Overrides:
assignKeyValuein classSQLWrapper
-
assignFileName
In Sequential File Processing - it overwrites the default name of the SQL Table automatically assigned by the system.- Overrides:
assignFileNamein classAbstractBasePersistence- Parameters:
fileName-
-
assignFileName
In Sequential File Processing - it overwrites the default name of the SQL Table automatically assigned by the system.
The version with AbstractDataObject is only created when the code contains multiple-differing uses of the DAO with point to different tables, and the Translator cannot establish which table-name to use. It will hence try to differ the table-name assignment till later.
However, majority of the Cics persistence statement will immediately be preceeded by their owndao.assignFileName(String)
and the values passed to this method will hence be of no use and ignored.- Parameters:
fileName-
-
seek
public int seek()Translation of CICS STARTBR Opens a data-set/resultset matching the keys. But does not read it.- Returns:
-
seekRecord
translation of CICS STARTBR- Returns:
- Throws:
IOStatusException
-
seekRecord
- Specified by:
seekRecordin interfaceISQLWrapper- Overrides:
seekRecordin classAbstractIndexedFile
-
seek
-
seekRecord
Description copied from class:AbstractIndexedFiletranslation of COBOL START The method will open a result-set, read the information and then Close the result-set.- Specified by:
seekRecordin interfaceISQLWrapper- Overrides:
seekRecordin classAbstractIndexedFile
-
read
public int read()Translation of CICS READ Read is usually used to read random organized data. The softwareMining version will issue an SQL statement to read find and read the first record whose value matches the record-Keys- Specified by:
readin interfaceISQLWrapper- Overrides:
readin classAbstractIndexedFile- Returns:
- IPersistence.STATUS_SUCCESS if records are found, Otherwise returns other values from IPersistence;
-
insert
public int insert()Description copied from class:AbstractIndexedFileInsert a record - populate the values from the existing fields- Specified by:
insertin interfaceISQLWrapper- Overrides:
insertin classAbstractIndexedFile
-
update
public int update()Description copied from class:AbstractIndexedFileUpdate the current record with the current record structure. If at end of file is reached, it does not throw an exception- Specified by:
updatein interfaceISQLWrapper- Overrides:
updatein classAbstractIndexedFile
-
delete
public int delete()Description copied from class:AbstractIndexedFileEquivalent of COBOL delete (for VSAM).- Specified by:
deletein interfaceISQLWrapper- Overrides:
deletein classAbstractIndexedFile
-
insertRecord
similar to insert(). But to be used when no RESPONSE CODE field is utilised. On any problems - it invokes the pre-defined condition handlers- Overrides:
insertRecordin classAbstractIndexedFile- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
readRecord
to be removed - CICS subsystem does not call this - see 0011729 similar to readNext(). But to be used when no RESPONSE CODE field is utilised. On any problems - it invokes the pre-defined condition handlers- Overrides:
readRecordin classAbstractIndexedFile- Returns:
- IPersistence.STATUS_SUCCESS if records are found, Otherwise returns other values from IPersistence;
- Throws:
IOStatusException
-
updateRecord
similar to update(). But to be used when no RESPONSE CODE field is utilised. On any problems - it invokes the pre-defined condition handlers- Overrides:
updateRecordin classAbstractIndexedFile- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
deleteRecord
similar to clear(). But to be used when no RESPONSE CODE field is utilised. On any problems - it invokes the pre-defined condition handlers- Overrides:
deleteRecordin classAbstractIndexedFile- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
clearRecord
Delete all records . But to be used when no RESPONSE CODE field is utilised. On any problems - it invokes the pre-defined condition handlers- Throws:
IOStatusException
-
nextRecord
Description copied from class:AbstractIndexedFileTranslation of COBOL Read Next ...- Overrides:
nextRecordin classAbstractIndexedFile- Returns:
- IPersistence.STATUS_SUCCESS if records are found, Otherwise returns other values from IPersistence;
- Throws:
IOStatusException
-
prevRecord
public int prevRecord()Description copied from class:AbstractIndexedFileTranslation of COBOL Read Prev ...- Overrides:
prevRecordin classAbstractIndexedFile- Returns:
- IPersistence.STATUS_SUCCESS if records are found, Otherwise returns other values from IPersistence;
-
close
public int close()Description copied from class:AbstractBasePersistenceClose the file- Specified by:
closein interfaceISQLWrapper- Overrides:
closein classAbstractIndexedFile- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
-
setStorageLength
public void setStorageLength(int newLength) to do ... not implemented- Parameters:
newLength-
-
retrieveNativeKeys
used internally by softwareMining- Specified by:
retrieveNativeKeysin interfaceISQLWrapper- Overrides:
retrieveNativeKeysin classSQLWrapper
-
getRecordKey
-
assignRecordKey
Description copied from interface:ISQLWrapperUsed only used by CicsPersistent Subclasses.- Specified by:
assignRecordKeyin interfaceISQLWrapper- Overrides:
assignRecordKeyin classSQLWrapper
-
assignRecordKeyValue
-
restoreNonGenericKey
public void restoreNonGenericKey()After setting a GENERIC-KEY, the original Non-generic-Key has to be restored. This method does that. -
assignGenericRecordKeyLength
public void assignGenericRecordKeyLength(int genericKeyLength) -
isAllowedToExpandGTEQSearches
public boolean isAllowedToExpandGTEQSearches()for internal use only- Specified by:
isAllowedToExpandGTEQSearchesin interfaceISQLWrapper- Overrides:
isAllowedToExpandGTEQSearchesin classSQLWrapper
-
assignTreatAsSQLWrapper
public void assignTreatAsSQLWrapper(boolean treatAsSQLWrapper) allows CicsPersistent classes to be treated as SQLWrapper (Object-relational VSAM Files) by batch programs.- Specified by:
assignTreatAsSQLWrapperin interfaceISQLWrapper- Overrides:
assignTreatAsSQLWrapperin classSQLWrapper- Parameters:
treatAsSQLWrapper-
-
assignLock
public void assignLock(boolean newLocValue) Blank method - no functionality is currently deemed to be required- Overrides:
assignLockin classAbstractBasePersistence- Parameters:
newLocValue-
-
validateConditionType
for internal use only- Specified by:
validateConditionTypein interfaceISQLWrapper- Overrides:
validateConditionTypein classSQLWrapper- Returns:
-
assignRecordKeyLength
Deprecated.not used / not necessary here
In CICS: If a specified KEYLENGTH value differs from the length that is defined for the underlying file and the operation is NOT generic , the INVREQ condition occurs.
Currently in SM Framework, keyLenght are ignored if operation is NOT generic. -
assignTempStorage
Deprecated.The following method is the translation of cics read "SET" ...
THE METHOD IS NOT USED - has no impact. the system uses other heuristics to achieve same results. but the API is generated for safety (SoftwareMining may add functionality at a later stage).- Parameters:
object-
-
assignTableName
Description copied from class:SQLWrapperCalled Programs declaring instances of the persistence classes
FOr Indexed-Files, this call often relates to setting name to a data-file name E.g. for
SELECT CUSTOMER-FILE assign to "CUSTOMER.DAT"
Results in:
customerFile.assignTableName("customer.dat");
or
customerFile.assignTableName(System.getEnv("CUST");
this is incorrect. We cannot keep changing the table names.
But we cannot suppress its generation - as the system should be able to swap between IndexedFiles and SQLWrappe/OR . IndexedFiles WILL need this. Besides, this may "sometimes" be useful. So, the system is going to continue generating the call to this method.
However, the real name can be set by the persistence class itself - using "assignSQLTableName"- Specified by:
assignTableNamein interfaceISQLWrapper- Overrides:
assignTableNamein classSQLWrapper
-
assignLength
public void assignLength(int maxLength) Related to the length of the RECORDS. Used in insert/update (CICS WRITE / REWRITE): Specifies the maximum length of record to be written.- Parameters:
maxLength-
-
releaseResources
public void releaseResources(boolean forceRelease) Description copied from class:SQLWrapperthis is called internally - after a program is CANCEL'ed. it is to help with the GC process- Specified by:
releaseResourcesin interfaceISMBean- Overrides:
releaseResourcesin classSQLWrapper
-