de.esprit.appsuite.database.dbase

## Class AbstractDBLoadMonitor<R extends DBRecord>

- java.lang.Object
- - de.esprit.appsuite.database.dbase.AbstractDBLoadMonitor<R>

- All Implemented Interfaces:
    DBLoadMonitor<R>, Clearable
  Direct Known Subclasses:
    CollectingDBLoadMonitor

      public abstract class AbstractDBLoadMonitor<R extends DBRecord>
      extends java.lang.Object
      implements DBLoadMonitor<R>, Clearable

  This is the base class for a custom LoadMonitor. It just implements the cancel related methods.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractDBLoadMonitor()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancel()` Cancels the load
    `void` | `clear()` Clears the content
    `java.lang.Exception` | `getError()`
    `int` | `getRecordCount()` Returns the number of records loaded by this LoadMonitor
    `boolean` | `hasError()`
    `protected abstract boolean` | `loadedDBRecord(R record)` Needs to be overridden by subclasses to do something with the loaded record
    `boolean` | `loadedRecord(R record)` This default implementation just counts the records loaded.
    `boolean` | `wasCancelled()` Tells whether this load has been cancelled

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractDBLoadMonitor

          public AbstractDBLoadMonitor()

  - ### Method Detail

    - #### cancel

          public void cancel()

      Description copied from interface: `DBLoadMonitor`
      Cancels the load
      Specified by:
        `cancel` in interface `DBLoadMonitor<R extends DBRecord>`

    - #### wasCancelled

          public boolean wasCancelled()

      Description copied from interface: `DBLoadMonitor`
      Tells whether this load has been cancelled
      Specified by:
        `wasCancelled` in interface `DBLoadMonitor<R extends DBRecord>`

    - #### loadedRecord

          public final boolean loadedRecord(R record)

      This default implementation just counts the records loaded. Subclasses must override `loadedDBRecord(DBRecord)`.
      Specified by:
        `loadedRecord` in interface `DBLoadMonitor<R extends DBRecord>`
      Parameters:
        `record` - The record just fetched from the ResultSet
      Returns:
        true if the record could be processed successfully

    - #### hasError

          public boolean hasError()

    - #### getError

          public java.lang.Exception getError()

    - #### loadedDBRecord

          protected abstract boolean loadedDBRecord(R record)
                                             throws java.lang.Exception

      Needs to be overridden by subclasses to do something with the loaded record
      Throws:
        `java.lang.Exception`

    - #### getRecordCount

          public int getRecordCount()

      Returns the number of records loaded by this LoadMonitor

    - #### clear

          public void clear()

      Description copied from interface: `Clearable`
      Clears the content
      Specified by:
        `clear` in interface `Clearable`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.