Class CicsPersistence

All Implemented Interfaces:
IPersistence, ISQLWrapper, AbstractDataObject, ICBLBeanNGroup, ICBLContainer, IFieldContainer, ISMBean, ISMDataType
Direct Known Subclasses:
QueueRecord

public abstract class CicsPersistence extends SQLWrapper
This class is the super class of data-items accessed by CICS IO operations e.g. CICS READ , WRITE, DELETE, REWRITE
  • Constructor Details

    • CicsPersistence

      public CicsPersistence(BaseService owner)
  • Method Details

    • getOwningCicsService

      public CicsBaseService 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 class AbstractIndexedFile
      Parameters:
      delegateDAO -
    • processException

      protected int processException(CBLException e)
      constructor
      Parameters:
      owner -
      eibaid - / public CicsPersistence(CicsBaseService owner ,Eibaid eibaid) { super(owner); this.eibaid = eibaid; this.owningCicsService = owner; }
    • processException

      protected int processException(CBLException e, boolean invokeHandler)
      Set appropriate responseCodes, and invoke the conditionHandler
      Parameters:
      e -
      Returns:
    • processException

      protected int processException(CBLException e, boolean invokeHandler, int overridingResponseCode)
      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

      public void assignResponseCodeField(ISMObject status)
    • setEibFunction

      protected void setEibFunction(String 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 ..
    • 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

      public void assignKeyValue(AbstractDataObject keyValueField)
      updates the value of Record-Keys defined for this class with every read.
      Specified by:
      assignKeyValue in interface ISQLWrapper
      Overrides:
      assignKeyValue in class SQLWrapper
    • assignFileName

      public void assignFileName(String fileName)
      In Sequential File Processing - it overwrites the default name of the SQL Table automatically assigned by the system.
      Overrides:
      assignFileName in class AbstractBasePersistence
      Parameters:
      fileName -
    • assignFileName

      public void assignFileName(AbstractDataObject fieldName)
      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 own
      dao.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

      public int seekRecord() throws IOStatusException
      translation of CICS STARTBR
      Returns:
      Throws:
      IOStatusException
    • seekRecord

      public int seekRecord(ISMObject[] keys, int conditionType)
      Specified by:
      seekRecord in interface ISQLWrapper
      Overrides:
      seekRecord in class AbstractIndexedFile
    • seek

      public int seek(CBLBean key, int conditionType)
    • seekRecord

      public int seekRecord(ISMObject key, int conditionType)
      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 interface ISQLWrapper
      Overrides:
      seekRecord in class AbstractIndexedFile
      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 interface ISQLWrapper
      Overrides:
      read in class AbstractIndexedFile
      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 interface ISQLWrapper
      Overrides:
      insert in class AbstractIndexedFile
    • 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 interface ISQLWrapper
      Overrides:
      update in class AbstractIndexedFile
    • delete

      public int delete()
      Description copied from class: AbstractIndexedFile
      Equivalent of COBOL delete (for VSAM).
      Specified by:
      delete in interface ISQLWrapper
      Overrides:
      delete in class AbstractIndexedFile
    • insertRecord

      public int insertRecord() throws IOStatusException
      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 class AbstractIndexedFile
      Returns:
      when successful it returns IPersistence.STATUS_SUCCESS
      Throws:
      IOStatusException
    • readRecord

      public int readRecord() throws IOStatusException
      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 class AbstractIndexedFile
      Returns:
      IPersistence.STATUS_SUCCESS if records are found, Otherwise returns other values from IPersistence;
      Throws:
      IOStatusException
    • updateRecord

      public int updateRecord() throws IOStatusException
      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 class AbstractIndexedFile
      Returns:
      when successful it returns IPersistence.STATUS_SUCCESS
      Throws:
      IOStatusException
    • deleteRecord

      public int deleteRecord() throws IOStatusException
      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 class AbstractIndexedFile
      Returns:
      when successful it returns IPersistence.STATUS_SUCCESS
      Throws:
      IOStatusException
    • clearRecord

      public void clearRecord() throws IOStatusException
      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

      public int nextRecord() throws IOStatusException
      Description copied from class: AbstractIndexedFile
      Translation of COBOL Read Next ...
      Overrides:
      nextRecord in class AbstractIndexedFile
      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 class AbstractIndexedFile
      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 interface ISQLWrapper
      Overrides:
      close in class AbstractIndexedFile
      Returns:
      when successful it returns IPersistence.STATUS_SUCCESS
    • setStorageLength

      public void setStorageLength(int newLength)
      to do ... not implemented
      Parameters:
      newLength -
    • retrieveNativeKeys

      public ISMObject[] retrieveNativeKeys()
      used internally by softwareMining
      Specified by:
      retrieveNativeKeys in interface ISQLWrapper
      Overrides:
      retrieveNativeKeys in class SQLWrapper
      Returns:
    • getRecordKey

      public String getRecordKey()
    • assignRecordKey

      public void assignRecordKey(ISMObject _recordKey)
      Description copied from interface: ISQLWrapper
      Used only used by CicsPersistent Subclasses.
      Specified by:
      assignRecordKey in interface ISQLWrapper
      Overrides:
      assignRecordKey in class SQLWrapper
    • assignRecordKeyValue

      public void assignRecordKeyValue(String newValue)
    • 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 interface ISQLWrapper
      Overrides:
      isAllowedToExpandGTEQSearches in class SQLWrapper
    • 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 interface ISQLWrapper
      Overrides:
      assignTreatAsSQLWrapper in class SQLWrapper
      Parameters:
      treatAsSQLWrapper -
    • assignLock

      public void assignLock(boolean newLocValue)
      Blank method - no functionality is currently deemed to be required
      Overrides:
      assignLock in class AbstractBasePersistence
      Parameters:
      newLocValue -
    • validateConditionType

      public int validateConditionType(ISMObject key, int conditionType)
      for internal use only
      Specified by:
      validateConditionType in interface ISQLWrapper
      Overrides:
      validateConditionType in class SQLWrapper
      Parameters:
      conditionType -
      Returns:
    • assignRecordKeyLength

      @Deprecated public void assignRecordKeyLength(int keyLength)
      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 public void assignTempStorage(ISMObject object)
      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

      public void assignTableName(String newName)
      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 interface ISQLWrapper
      Overrides:
      assignTableName in class SQLWrapper
      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 interface ISMBean
      Overrides:
      releaseResources in class SQLWrapper
      Parameters:
      forceRelease -