Class FoundationObject
java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.foundations.core.FoundationObject
- All Implemented Interfaces:
DataExceptionContributor,JsonSerializable,RecordSerializable,XmlSerializable,Serializable
- Direct Known Subclasses:
CalculatedField,DataMappingObject,Dataset,DecisionTableObject,DecisionTreeObject,JdbcConnection,JdbcSchema,PipelineObject,SchemaObject
Abstract super-class for DP Foundation classes that require a consistent error handling mechanism.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longprotected Stringstatic final Loggerprotected static final SimpleDateFormatFields inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
SERIALIZED_CLASS_NAME, TYPEFields inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
XML_SERIALIZED_CLASS_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddExceptionProperties(DataException exception) Adds this object's current state to aDataException.Throws aDataExceptionif this object is invalid, otherwise returns it; the base implementation checks nothing.protected FoundationObjectassertValid(Collection<? extends FoundationObject> objects) CallsassertValid()on each of the given objects; a null collection is ignored.protected FoundationObjectclone()Creates an exception with the specified message and containing this endpoint's properties (name-value pairs).Converts an exception to aDataException, prefixing the original message with the specified text and adding this endpoint's properties (name-value pairs).Converts an exception to aDataExceptionand adds this endpoint's properties (name-value pairs).final longThe auto numbered ID of this instance.final StringThe name of this instance (- ). static longRestarts the internal ID sequence shared by all instances so the next one created gets ID 1.Methods inherited from class com.northconcepts.datapipeline.foundations.core.Bean
fromRecord, toRecord, toStringMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.northconcepts.datapipeline.core.DataExceptionContributor
addExceptionPropertiesMethods inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
fromJson, fromJson, toJson, toJson, toJsonMethods inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
fromXml, fromXml, fromXmlElement, toXml, toXml, toXml, toXml, toXml, toXmlElement
-
Field Details
-
log
public static final Logger log -
TIMESTAMP_FORMAT
-
internalId
protected long internalId -
internalName
-
-
Constructor Details
-
FoundationObject
public FoundationObject()
-
-
Method Details
-
resetInternalId
public static long resetInternalId()Restarts the internal ID sequence shared by all instances so the next one created gets ID 1. -
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
getInternalId
public final long getInternalId()The auto numbered ID of this instance. -
getInternalName
The name of this instance (- ). -
addExceptionProperties
Adds this object's current state to aDataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.- Specified by:
addExceptionPropertiesin interfaceDataExceptionContributor- Overrides:
addExceptionPropertiesin classBean
-
exception
Converts an exception to aDataException, 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 aDataException. In either case the result message will contain the new prefix along with this endpoint properties. -
exception
Converts an exception to aDataExceptionand 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 aDataException. In either case the result message will contain this endpoint properties. -
exception
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.
-
assertValid
Throws aDataExceptionif this object is invalid, otherwise returns it; the base implementation checks nothing. -
assertValid
CallsassertValid()on each of the given objects; a null collection is ignored.
-