Class DataEndpoint
java.lang.Object
com.northconcepts.datapipeline.core.DataObject
com.northconcepts.datapipeline.core.Endpoint
com.northconcepts.datapipeline.core.DataEndpoint
- Direct Known Subclasses:
DataEndpointGroup,DataReader,DataWriter,RecordBuffer,Window
Abstract super-class for reading and writing records. Common operations
like
open(), close(), and getRecordCount() are defined here.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumLifecycle states of an endpoint:NEWuntil opened, thenOPENED, thenCLOSED. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Recordstatic final Stringstatic final Stringstatic final Stringprotected static final StringFields inherited from class com.northconcepts.datapipeline.core.Endpoint
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEFields inherited from class com.northconcepts.datapipeline.core.DataObject
id, log, name, TIMESTAMP_FORMAT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddExceptionProperties(DataException exception) Adds this endpoint's current state to aDataException.voidclose()Indicates that this endpoint has finished reading or writing.protected voidReduces this endpoint's record-count by 1.static voidTurns JMX (Java Management Extensions) monitoring invalid input: '&' management on and exposes running Jobs and EventBuses as managed beans.Returns the most recent record seen by this endpoint while it is open ornull.Returns theEndpointheld inside this one ornullif there isn't one.longReturns this endpoint's record-count as along.Returns this endpoint's record-count as aBigInteger.Returns this endpoint's record-count as aString.Returns the deepest, nestedEndpointheld inside this one, otherwise this instance is returned if there aren't any nestedEndpoints.protected voidIncreases this endpoint's record-count by 1.booleanIndicates if this endpoint's record-count is too big (over 1000000000000000000L or 1.0e+18) for alongand should be retrieved as aBigIntegerusinggetRecordCountAsBigInteger().voidopen()Makes this endpoint ready for reading or writing.protected voidRestarts this endpoint's record-count at 0.toString()Methods inherited from class com.northconcepts.datapipeline.core.Endpoint
addElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescription
-
Field Details
-
VENDOR
- See Also:
-
PRODUCT
- See Also:
-
PRODUCT_VERSION
- See Also:
-
XML_INPUT_FACTORY_KEY
- See Also:
-
lastRecord
-
-
Constructor Details
-
DataEndpoint
public DataEndpoint()
-
-
Method Details
-
getNestedEndpoint
Description copied from class:EndpointReturns theEndpointheld inside this one ornullif there isn't one.- Overrides:
getNestedEndpointin classEndpoint
-
getRootEndpoint
Description copied from class:EndpointReturns the deepest, nestedEndpointheld inside this one, otherwise this instance is returned if there aren't any nestedEndpoints.- Overrides:
getRootEndpointin classEndpoint
-
getLastRecord
Returns the most recent record seen by this endpoint while it is open ornull. -
open
Makes this endpoint ready for reading or writing.- Overrides:
openin classEndpoint- Throws:
DataException
-
close
Indicates that this endpoint has finished reading or writing.- Overrides:
closein classEndpoint- Throws:
DataException
-
addExceptionProperties
Description copied from class:EndpointAdds this endpoint's current state to aDataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.- Overrides:
addExceptionPropertiesin classEndpoint
-
toString
-
incrementRecordCount
protected void incrementRecordCount()Increases this endpoint's record-count by 1.- See Also:
-
decrementRecordCount
protected void decrementRecordCount()Reduces this endpoint's record-count by 1.- See Also:
-
resetRecordCount
protected void resetRecordCount()Restarts this endpoint's record-count at 0.- See Also:
-
isRecordCountBigInteger
public boolean isRecordCountBigInteger()Indicates if this endpoint's record-count is too big (over 1000000000000000000L or 1.0e+18) for alongand should be retrieved as aBigIntegerusinggetRecordCountAsBigInteger().- See Also:
-
getRecordCount
public long getRecordCount()Returns this endpoint's record-count as along. If the count grows above 1000000000000000000L or 1.0e+18, it will wrap to 1, butgetRecordCountAsBigInteger()will contain the full value.- See Also:
-
getRecordCountAsBigInteger
Returns this endpoint's record-count as aBigInteger.- See Also:
-
getRecordCountAsString
Returns this endpoint's record-count as aString.- See Also:
-
enableJmx
public static void enableJmx()Turns JMX (Java Management Extensions) monitoring invalid input: '&' management on and exposes running Jobs and EventBuses as managed beans.
-