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

public abstract class AbstractBasePersistence extends CBLBean implements IPersistence
For internal use only
  • Field Details

    • fileName

      protected String fileName
    • ownerClassName

      protected String ownerClassName
    • status

      protected ISMObject status
  • Constructor Details

    • AbstractBasePersistence

      public AbstractBasePersistence()
      default constructor
    • AbstractBasePersistence

      public AbstractBasePersistence(BaseService owner)
      standard constructor
      Parameters:
      owner -
  • Method Details

    • assignFileName

      public void assignFileName(String fileName)
      In Sequential File Processing - it overwrites the default name of an input/output file automatically assigned by the system.
      Parameters:
      fileName -
    • assignTableName

      public void assignTableName(String fileName)
      In Sequential File Processing - it overwrites the default name of an input/output file automatically assigned by the system.
      Parameters:
      fileName -
    • retrieveFileName

      public String retrieveFileName(boolean prefixFileNameWithCallingProgram)
      In Sequential File Processing - it returns the default name of an input/output file
      Parameters:
      fileName -
    • retrieveFileName

      public String 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

      public void assignStatus(ISMObject status)
      set the status object
      Parameters:
      status -
    • assignStatus

      public void assignStatus(CBLBean wrapper)
      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

      protected void assignStatusValue(String value)
      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

      public ISMObject 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

      public abstract AbstractCBLField retrieveFirstLevelEntry()
    • open

      public abstract int open(int openMode) throws IOCriticalException
      Throws:
      IOCriticalException
    • close

      public abstract int close() throws IOCriticalException
      Close the file
      Returns:
      when successful it returns IPersistence.STATUS_SUCCESS
      Throws:
      IOCriticalException
    • retrieveOpenMode

      public abstract int retrieveOpenMode()
    • nextRecord

      public abstract int nextRecord() throws IOStatusException
      when operation is Unsuccessful throw Exception (e.g AtEndException). See com.softwaremining.wrappers.exceptions
      Returns:
      Throws:
      IOStatusException
    • prevRecord

      public abstract int prevRecord() throws IOStatusException
      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

      public abstract int readRecord() throws IOStatusException
      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

      public abstract int updateRecord() throws IOStatusException
      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

      public abstract int insertRecord() throws IOStatusException
      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

      public abstract int deleteRecord() throws IOStatusException
      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

      public abstract int clear() throws IOStatusException
      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

      public final Long retrieveSessionId()
      Description copied from class: CBLBean
      For internal use only
      Specified by:
      retrieveSessionId in interface ISMBean
      Overrides:
      retrieveSessionId in class CBLBean