Package com.softwaremining.vendors.cics
Class CicsPersistence
java.lang.Object
com.softwaremining.wrappers.CBLBean
com.softwaremining.wrappers.AbstractBasePersistence
com.softwaremining.sql.AbstractIndexedFile
com.softwaremining.sql.SQLWrapper
com.softwaremining.vendors.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, suppressNextReadCurrent
Fields inherited from class com.softwaremining.sql.AbstractIndexedFile
delegateDAO
Fields inherited from class com.softwaremining.wrappers.AbstractBasePersistence
fileName, ownerClassName, status
Fields 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_setFieldFormatted
Fields 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_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_REWRITE_WITHOUT_READ, STATUS_SM_FAIL_UNKOWN_REASON, STATUS_SM_NOT_ASSIGNED, STATUS_SUCCESS, UNCERTAIN_OF_RETURN_VALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
assignFileName
(AbstractDataObject fieldName) In Sequential File Processing - it overwrites the default name of the SQL Table automatically assigned by the system.void
assignFileName
(String fileName) In Sequential File Processing - it overwrites the default name of the SQL Table automatically assigned by the system.void
assignGenericRecordKeyLength
(int genericKeyLength) void
assignKeyValue
(AbstractDataObject keyValueField) updates the value of Record-Keys defined for this class with every read.void
assignLength
(int maxLength) Related to the length of the RECORDS.void
assignLock
(boolean newLocValue) Blank method - no functionality is currently deemed to be requiredvoid
assignRecordKey
(ISMObject _recordKey) Used only used by CicsPersistent Subclasses.void
assignRecordKeyLength
(int keyLength) Deprecated.void
assignRecordKeyValue
(String newValue) void
assignResponseCodeField
(ISMObject status) protected void
assignResponseCodeValue
(int value) Used internally to set the IO operation status-values.void
assignTableName
(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.void
assignTempStorage
(ISMObject object) Deprecated.void
assignTreatAsSQLWrapper
(boolean treatAsSQLWrapper) allows CicsPersistent classes to be treated as SQLWrapper (Object-relational VSAM Files) by batch programs.void
Delete all records .int
close()
Close the fileint
delete()
Equivalent of COBOL delete (for VSAM).int
similar to clear().int
int
Used internally to set the IO operation status-values.int
insert()
Insert a record - populate the values from the existing fieldsint
similar to insert().boolean
for internal use onlyint
Translation of COBOL Read Next ...int
Translation of COBOL Read Prev ...protected int
constructorprotected int
processException
(CBLException e, boolean invokeHandler) Set appropriate responseCodes, and invoke the conditionHandlerprotected int
processException
(CBLException e, boolean invokeHandler, int overridingResponseCode) Set appropriate responseCodes, and invoke the conditionHandlerint
read()
Translation of CICS READ Read is usually used to read random organized data.int
to be removed - CICS subsystem does not call this - see 0011729 similar to readNext().void
releaseResources
(boolean forceRelease) this is called internally - after a program is CANCEL'ed.protected void
Indexed files with totally different formats will sometimes still need to go to same database table.void
After setting a GENERIC-KEY, the original Non-generic-Key has to be restored.used internally by softwareMiningint
seek()
Translation of CICS STARTBR Opens a data-set/resultset matching the keys.int
int
translation of CICS STARTBRint
seekRecord
(ISMObject[] keys, int conditionType) int
seekRecord
(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 void
setEibFunction
(String value) Used internally to set the IO operation status-values.void
setStorageLength
(int newLength) to do ...int
update()
Update the current record with the current record structure.int
similar to update().int
validateConditionType
(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, assignAdditionalSQLOrderBy, assignAlternateKey, assignCachedSeekValues, assignChangeGEConditonToLIKE, assignChangeGTEQ2EQForLIKECondition, assignConnection, assignDbDecorator, assignExpandGTEQSearches, assignFetchDirectionIsForward, assignFetchSize, assignFileOpened, assignGDGCondition, assignGDGProperty, assignGenerate_OrderBy_ForReadStatements, assignIgnoreOriginalKeys, assignKeyIsUnique, assignKeyValue, assignLastSeekCondition, assignLastSeekConditionLookedForEquality, assignLowerLimitForExpandGTEQSearches, assignOpenMode, assignRecordKey, assignRecordKeysAllDescending, assignRelativeKey, assignResultSet, assignResultSetFetchSize, assignRowFacade, assignSequentialKeyGeneration, assignSQLConditions, assignSQLTableName, assignSuppressSeek, assignThrowInvalidKeyException, assignTopRowSelectStrategyCount, assignTopRowSelectStrategyRange, assignUpperLimitForExpandGTEQSearches, 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, retrieveLastSeekCondition, retrieveOpenMode, retrieveRecordKey, retrieveRecordKeyValue, retrieveResultSet, retrieveResultSetFetchSize, retrieveRowFacade, retrieveTableName, retrieveThrowInvalidKeyException, retrieveTopRowSelectStrategyCount, retrieveTopRowSelectStrategyStartingRow, setLock, setRelativeKey, trimCachedSeekValues, useOidTableForKeyGeneration
Methods inherited from class com.softwaremining.sql.AbstractIndexedFile
_assignKeyValue, assignAccessMode, assignDelegateDAO, assignStatus, clear, commit, deleteAllRecord, next, open, prev, readWithLock, retrieveDelegateDAO, rollback, seek, seek, seekRecord, unlock
Methods inherited from class com.softwaremining.wrappers.AbstractBasePersistence
assignStatus, assignStatusAsPrimitive, assignStatusValue, assignStatusValue, readRow, retrieveAccessMode, retrieveFileName, retrieveFileName, retrieveFirstLevelEntry, retrieveSessionId, retrieveStatusField, retrieveStatusValue
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, 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, printFieldPosition, printFieldValues, printOrderedFieldPosition, PrintOrderedFieldPositionsAndValue, resetCachedValues, resetCompressedFieldList, resetStructure, resize, retrieveActualLength, retrieveAsInt, retrieveAsString, retrieveCachedInitializationValue, retrieveCompressedFields, retrieveDependedFieldsList, retrieveEbcdicBytes, retrieveEbcdicValue, retrieveEncodedValue, retrieveField, retrieveField, retrieveFieldAtMemoryPosition, retrieveFieldFormatted, retrieveFields, retrieveIsTargetOfPointers, retrievePrimitiveFields, retrieveRawEbcdicBytes, retrieveSQLObject, retrieveStorageCellSize, retrieveStorageChars, retrieveSubstring, retrieveSubstring, retrieveTopLevelField, retrieveValue, retrieveValue, setValue, stringValue, subtractCorrespondingValue, subtractCorrespondingValue, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.softwaremining.wrappers.ISMBean
assignExemptFromMemRelease, assignSessionId, assignValue, initialize, isExemptFromMemRelease, isResourceAlreadyReleased, resetStructure, retrieveActualLength, retrieveAsString, retrieveField, retrieveField, retrieveTopLevelField, retrieveValue, stringValue
Methods 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:
resetCicsDelegate
in 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:
assignKeyValue
in interfaceISQLWrapper
- Overrides:
assignKeyValue
in classSQLWrapper
-
assignFileName
In Sequential File Processing - it overwrites the default name of the SQL Table automatically assigned by the system.- Overrides:
assignFileName
in 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:
seekRecord
in interfaceISQLWrapper
- Overrides:
seekRecord
in classAbstractIndexedFile
-
seek
-
seekRecord
Description copied from class:AbstractIndexedFile
translation of COBOL START The method will open a result-set, read the information and then Close the result-set.- Specified by:
seekRecord
in interfaceISQLWrapper
- Overrides:
seekRecord
in classAbstractIndexedFile
- Parameters:
key
-conditionType
-
-
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:
read
in interfaceISQLWrapper
- Overrides:
read
in classAbstractIndexedFile
- Returns:
- IPersistence.STATUS_SUCCESS if records are found, Otherwise returns other values from IPersistence;
-
insert
public int insert()Description copied from class:AbstractIndexedFile
Insert a record - populate the values from the existing fields- Specified by:
insert
in interfaceISQLWrapper
- Overrides:
insert
in classAbstractIndexedFile
-
update
public int update()Description copied from class:AbstractIndexedFile
Update the current record with the current record structure. If at end of file is reached, it does not throw an exception- Specified by:
update
in interfaceISQLWrapper
- Overrides:
update
in classAbstractIndexedFile
-
delete
public int delete()Description copied from class:AbstractIndexedFile
Equivalent of COBOL delete (for VSAM).- Specified by:
delete
in interfaceISQLWrapper
- Overrides:
delete
in 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:
insertRecord
in 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:
readRecord
in 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:
updateRecord
in 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:
deleteRecord
in 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:AbstractIndexedFile
Translation of COBOL Read Next ...- Overrides:
nextRecord
in 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:AbstractIndexedFile
Translation of COBOL Read Prev ...- Overrides:
prevRecord
in classAbstractIndexedFile
- Returns:
- IPersistence.STATUS_SUCCESS if records are found, Otherwise returns other values from IPersistence;
-
close
public int close()Description copied from class:AbstractBasePersistence
Close the file- Specified by:
close
in interfaceISQLWrapper
- Overrides:
close
in 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:
retrieveNativeKeys
in interfaceISQLWrapper
- Overrides:
retrieveNativeKeys
in classSQLWrapper
- Returns:
-
getRecordKey
-
assignRecordKey
Description copied from interface:ISQLWrapper
Used only used by CicsPersistent Subclasses.- Specified by:
assignRecordKey
in interfaceISQLWrapper
- Overrides:
assignRecordKey
in 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:
isAllowedToExpandGTEQSearches
in interfaceISQLWrapper
- Overrides:
isAllowedToExpandGTEQSearches
in classSQLWrapper
-
assignTreatAsSQLWrapper
public void assignTreatAsSQLWrapper(boolean treatAsSQLWrapper) allows CicsPersistent classes to be treated as SQLWrapper (Object-relational VSAM Files) by batch programs.- Specified by:
assignTreatAsSQLWrapper
in interfaceISQLWrapper
- Overrides:
assignTreatAsSQLWrapper
in classSQLWrapper
- Parameters:
treatAsSQLWrapper
-
-
assignLock
public void assignLock(boolean newLocValue) Blank method - no functionality is currently deemed to be required- Overrides:
assignLock
in classAbstractBasePersistence
- Parameters:
newLocValue
-
-
validateConditionType
for internal use only- Specified by:
validateConditionType
in interfaceISQLWrapper
- Overrides:
validateConditionType
in classSQLWrapper
- Parameters:
conditionType
-- 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:SQLWrapper
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. 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:
assignTableName
in interfaceISQLWrapper
- Overrides:
assignTableName
in classSQLWrapper
- Parameters:
newName
-
-
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:SQLWrapper
this is called internally - after a program is CANCEL'ed. it is to help with the GC process- Specified by:
releaseResources
in interfaceISMBean
- Overrides:
releaseResources
in classSQLWrapper
- Parameters:
forceRelease
-
-