|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.northconcepts.datapipeline.core.DataEndpoint
public abstract class DataEndpoint
Abstract super-class for reading and writing records. Common operations
like open(), close(), and getRecordCount() are defined here.
| Nested Class Summary | |
|---|---|
static class |
DataEndpoint.State
|
| Field Summary | |
|---|---|
static int |
BUFFER_SIZE
|
static org.apache.log4j.Logger |
log
|
| Constructor Summary | |
|---|---|
DataEndpoint()
|
|
| Method Summary | |
|---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a DataException. |
void |
assertNotOpened()
Asserts that this endpoint has not yet started reading or writing, otherwise an exception is thrown. |
void |
assertOpened()
Asserts that this endpoint has started reading or writing, otherwise an exception is thrown. |
void |
close()
Indicates that this endpoint has finished reading or writing. |
protected void |
decrementRecordCount()
Reduces this endpoint's record-count by 1. |
DataException |
exception(String message)
Creates an exception with the specified message and containing this endpoint's properties (name-value pairs). |
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). |
DataException |
exception(Throwable exception)
Converts an exception to a DataException and adds this endpoint's properties (name-value pairs). |
protected void |
finalize()
Closes this endpoint if it's still open. |
String |
getDescription()
|
long |
getRecordCount()
Returns this endpoint's record-count as a long. |
BigInteger |
getRecordCountAsBigInteger()
Returns this endpoint's record-count as a BigInteger. |
String |
getRecordCountAsString()
Returns this endpoint's record-count as a String. |
DataEndpoint.State |
getState()
|
protected void |
incrementRecordCount()
Increases this endpoint's record-count by 1. |
boolean |
isClosed()
Indicates if this endpoint has finished transferring data. |
boolean |
isOpen()
Indicates if this endpoint is ready for reading or writing. |
boolean |
isRecordCountBigInteger()
Indicates if this endpoint's record-count is too big (over 1000000000000000000L or 1.0e+18) for a long
and should be retrieved as a BigInteger using getRecordCountAsBigInteger(). |
void |
open()
Makes this endpoint ready for reading or writing. |
protected void |
resetRecordCount()
Restarts this endpoint's record-count at 0. |
DataEndpoint |
setDescription(String description)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.log4j.Logger log
public static final int BUFFER_SIZE
| Constructor Detail |
|---|
public DataEndpoint()
| Method Detail |
|---|
public String getDescription()
public DataEndpoint setDescription(String description)
public void open()
throws DataException
DataException
public void close()
throws DataException
DataExceptionpublic DataEndpoint.State getState()
public boolean isOpen()
public boolean isClosed()
public void assertOpened()
public void assertNotOpened()
public DataException addExceptionProperties(DataException exception)
DataException. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.
public DataException exception(String message,
Throwable exception)
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.
public DataException exception(Throwable exception)
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.
public DataException exception(String message)
The returned exception can then be thrown in the normal way.
protected void finalize()
throws Throwable
finalize in class ObjectThrowablepublic String toString()
toString in class Objectprotected void incrementRecordCount()
getRecordCountAsBigInteger(),
getRecordCount(),
isRecordCountBigInteger()protected void decrementRecordCount()
getRecordCountAsBigInteger(),
getRecordCount(),
isRecordCountBigInteger()protected void resetRecordCount()
getRecordCountAsBigInteger(),
getRecordCount(),
isRecordCountBigInteger()public boolean isRecordCountBigInteger()
long
and should be retrieved as a BigInteger using getRecordCountAsBigInteger().
getRecordCountAsBigInteger(),
getRecordCount()public long getRecordCount()
long. If the count grows above 1000000000000000000L or 1.0e+18,
it will wrap to 1, but getRecordCountAsBigInteger() will contain the full value.
getRecordCountAsBigInteger(),
isRecordCountBigInteger()public BigInteger getRecordCountAsBigInteger()
BigInteger.
getRecordCount(),
isRecordCountBigInteger()public String getRecordCountAsString()
String.
getRecordCountAsBigInteger(),
getRecordCount(),
isRecordCountBigInteger()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||