|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.access.DataPort
public class DataPort
An engine to port data between two DataNodes. These nodes can potentially connect to databases from different vendors. The only assumption is that all of the DbEntities (tables) being ported are present in both source and destination databases and are adequately described by Cayenne mapping.
DataPort implements a Cayenne-based algorithm to read data from source DataNode and write to destination DataNode. It uses DataPortDelegate interface to externalize various things, such as determining what entities to port (include/exclude from port based on some criteria), logging the progress of port operation, qualifying the queries, etc.
Field Summary | |
---|---|
protected boolean |
cleaningDestination
|
protected DataPortDelegate |
delegate
|
protected DataNode |
destinationNode
|
protected java.util.Collection |
entities
|
static int |
INSERT_BATCH_SIZE
|
protected int |
insertBatchSize
|
protected DataNode |
sourceNode
|
Constructor Summary | |
---|---|
DataPort()
|
|
DataPort(DataPortDelegate delegate)
Creates a new DataPort instance, setting its delegate. |
Method Summary | |
---|---|
void |
execute()
Runs DataPort. |
DataPortDelegate |
getDelegate()
Returns previously initialized DataPortDelegate object. |
DataNode |
getDestinationNode()
|
java.util.Collection |
getEntities()
|
int |
getInsertBatchSize()
|
DataNode |
getSourceNode()
|
boolean |
isCleaningDestination()
Returns true if a DataPort was configured to delete all data from the destination tables. |
protected void |
processDelete(java.util.List entities)
Cleans up destination tables data. |
protected void |
processInsert(java.util.List entities)
Reads source data from source, saving it to destination. |
void |
setCleaningDestination(boolean cleaningDestination)
Defines whether DataPort should delete all data from destination tables before doing the port. |
void |
setDelegate(DataPortDelegate delegate)
|
void |
setDestinationNode(DataNode destinationNode)
Sets the DataNode serving as a destination of the ported data. |
void |
setEntities(java.util.Collection entities)
Sets the initial list of entities to process. |
void |
setInsertBatchSize(int insertBatchSize)
Sets a parameter used for tuning insert batches. |
void |
setSourceNode(DataNode sourceNode)
Sets the DataNode serving as a source of the ported data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int INSERT_BATCH_SIZE
protected DataNode sourceNode
protected DataNode destinationNode
protected java.util.Collection entities
protected boolean cleaningDestination
protected DataPortDelegate delegate
protected int insertBatchSize
Constructor Detail |
---|
public DataPort()
public DataPort(DataPortDelegate delegate)
Method Detail |
---|
public void execute() throws CayenneException
CayenneException
protected void processDelete(java.util.List entities)
protected void processInsert(java.util.List entities) throws CayenneException
CayenneException
public java.util.Collection getEntities()
public DataNode getSourceNode()
public DataNode getDestinationNode()
public void setEntities(java.util.Collection entities)
public void setSourceNode(DataNode sourceNode)
public void setDestinationNode(DataNode destinationNode)
public DataPortDelegate getDelegate()
public void setDelegate(DataPortDelegate delegate)
public boolean isCleaningDestination()
public void setCleaningDestination(boolean cleaningDestination)
public int getInsertBatchSize()
public void setInsertBatchSize(int insertBatchSize)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |