public abstract class ReplicationUnit extends Object
Constructor and Description |
---|
ReplicationUnit() |
Modifier and Type | Method and Description |
---|---|
abstract RefreshPolicy |
getRefreshPolicy()
Returns the
RefreshPolicy
of this replication unit. |
abstract ReplicaTable |
getReplicaTable(SchemaNode aTableNode)
Returns the replica of the specified table node.
|
abstract Iterator<ReplicaTable> |
getReplicaTables()
Returns the table replicas defined by this
replication unit.
|
abstract ReplicationUnitKey |
getReplicationUnitKey()
Returns the key of this replication unit.
|
static List<ReplicationUnit> |
getReplicationUnitsForTable(SchemaNode aTableNode,
Repository aRepository)
Returns all the replication units involving the specified table
in the context of a repository.
|
static ReplicationUnit |
newReplicationUnit(ReplicationUnitKey aUnitKey,
Adaptation aDataSet)
Returns the replication unit for the specified dataset and unit name.
|
abstract void |
performRefresh(ProcedureContext aContext)
Refreshes the tables included by this replication unit.
|
abstract ProcedureResult |
performRefresh(Session aSession)
Refreshes the tables included by this replication unit.
|
public static ReplicationUnit newReplicationUnit(ReplicationUnitKey aUnitKey, Adaptation aDataSet)
aUnitKey
- identifies the replication unit, namely the table(s) to be replicated in the specified dataset.aDataSet
- dataset for which at least one table will be replicated.IllegalArgumentException
- if one argument is null
, if the specified replication unit is not
defined
by the data model, if its refresh is not onDemand
, or if the
dataset does
not match the replication unit definition.public static final List<ReplicationUnit> getReplicationUnitsForTable(SchemaNode aTableNode, Repository aRepository)
Returns an empty list if this method is called before the resolution of the replications units defined in the data model containing the specified node, or if this data model does not define a replication unit for the specified table node.
IllegalArgumentException
- if the specified node is null
, or if it is not
a table node.IllegalArgumentException
- if the specified repository is null
.public abstract ProcedureResult performRefresh(Session aSession)
aSession
- authenticated session allowed to perform the replication.IllegalArgumentException
- if the specified table is not included by any replication units with the refresh
policy
onDemand
.public abstract void performRefresh(ProcedureContext aContext) throws OperationException
Caution: If the procedure context specifies a commit threshold, intermediate commits can be performed outside the execution of this method. However, the replication operations performed by this method are not taken into account by the threshold (and no commits will take place during the replication itself).
aContext
- context of the procedure currently running.IllegalArgumentException
- if the specified context is null
, or is not running on the same
dataspace as the current dataset.IllegalStateException
- if this method is not invoked from a still running procedure.OperationException
- thrown if operation cannot complete, or if executed on the D3 replica delivery
dataspace.public abstract ReplicationUnitKey getReplicationUnitKey()
ReplicationUnitKey
public abstract Iterator<ReplicaTable> getReplicaTables()
public abstract ReplicaTable getReplicaTable(SchemaNode aTableNode)
Returns null
if the current replication unit
does not define a replica for the specified table node.
IllegalArgumentException
- if the specified node is null
, or if it is not
a table node.public abstract RefreshPolicy getRefreshPolicy()
RefreshPolicy
of this replication unit.