Class DataObject

java.lang.Object
com.northconcepts.datapipeline.core.DataObject
Direct Known Subclasses:
Endpoint, JmsConnection, JmsSettings, MultiRowPreparedStatementInsert, MultiRowStatementInsert, PreparedStatementInsert

public abstract class DataObject extends Object
Abstract super-class for classes that work with data and require a consistent error handling mechanism.
  • Field Details

    • log

      public static final Logger log
    • TIMESTAMP_FORMAT

      protected static final SimpleDateFormat TIMESTAMP_FORMAT
    • id

      protected final long id
    • name

      protected final String name
  • Constructor Details

    • DataObject

      public DataObject()
  • Method Details

    • resetID

      public static long resetID()
      Restarts the ID sequence shared by all instances, so the next one created gets ID 1.
    • getId

      public final long getId()
      The auto numbered ID of this instance.
    • getName

      public final String getName()
      The name of this instance (-).
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addExceptionProperties

      public DataException addExceptionProperties(DataException exception)
      Adds this object's current state to a DataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.
    • exception

      public DataException exception(String message, Throwable exception)
      Converts an exception to a DataException, prefixing the original message with the specified text and adding this endpoint's properties (name-value pairs).

      The returned exception can then be thrown in the normal way.

      If the supplied exception is an instanceof DataException, it will be returned, otherwise it will be nested inside a DataException. In either case the result message will contain the new prefix along with this endpoint properties.

    • exception

      public DataException exception(Throwable exception)
      Converts an exception to a DataException and adds this endpoint's properties (name-value pairs).

      The returned exception can then be thrown in the normal way.

      If the supplied exception is an instanceof DataException, it will be returned, otherwise it will be nested inside a DataException. In either case the result message will contain this endpoint properties.

    • exception

      public DataException exception(String message)
      Creates an exception with the specified message and containing this endpoint's properties (name-value pairs).

      The returned exception can then be thrown in the normal way.