Class ReplicationUnit
- java.lang.Object
-
- com.orchestranetworks.service.extensions.ReplicationUnit
-
public abstract class ReplicationUnit extends Object
A replication unit is defined by the data model.- See Also:
- Replicating data to relational tables
-
-
Constructor Summary
Constructors Constructor Description ReplicationUnit()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract RefreshPolicygetRefreshPolicy()Returns theRefreshPolicyof this replication unit.abstract ReplicaTablegetReplicaTable(SchemaNode aTableNode)Returns the replica of the specified table node.abstract Iterator<ReplicaTable>getReplicaTables()Returns the table replicas defined by this replication unit.abstract ReplicationUnitKeygetReplicationUnitKey()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 ReplicationUnitnewReplicationUnit(ReplicationUnitKey aUnitKey, Adaptation aDataSet)Returns the replication unit for the specified dataset and unit name.abstract voidperformRefresh(ProcedureContext aContext)Refreshes the tables included by this replication unit.abstract ProcedureResultperformRefresh(Session aSession)Refreshes the tables included by this replication unit.
-
-
-
Method Detail
-
newReplicationUnit
public static ReplicationUnit newReplicationUnit(ReplicationUnitKey aUnitKey, Adaptation aDataSet)
Returns the replication unit for the specified dataset and unit name.- Parameters:
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.- Throws:
IllegalArgumentException- if one argument isnull, if the specified replication unit is not defined by the data model, if its refresh is notonDemand, or if the dataset does not match the replication unit definition.- See Also:
- Replication refresh policy
-
getReplicationUnitsForTable
public static final List<ReplicationUnit> getReplicationUnitsForTable(SchemaNode aTableNode, Repository aRepository)
Returns all the replication units involving the specified table in the context of a repository.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.
- Throws:
IllegalArgumentException- if the specified node isnull, or if it is not a table node.IllegalArgumentException- if the specified repository isnull.- Since:
- 5.8.0
-
performRefresh
public abstract ProcedureResult performRefresh(Session aSession)
Refreshes the tables included by this replication unit. This method cannot be invoked from a running procedure.- Parameters:
aSession- authenticated session allowed to perform the replication.- Returns:
- the result of the execution; specifically, the success of the refresh must be checked using this object.
- Throws:
IllegalArgumentException- if the specified table is not included by any replication units with the refresh policyonDemand.- See Also:
- Replication refresh policy
-
performRefresh
public abstract void performRefresh(ProcedureContext aContext) throws OperationException
Refreshes the tables included by this replication unit.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).
- Parameters:
aContext- context of the procedure currently running.- Throws:
IllegalArgumentException- if the specified context isnull, 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.- See Also:
- Replication refresh policy
-
getReplicationUnitKey
public abstract ReplicationUnitKey getReplicationUnitKey()
Returns the key of this replication unit.- Since:
- 5.8.0
- See Also:
ReplicationUnitKey
-
getReplicaTables
public abstract Iterator<ReplicaTable> getReplicaTables()
Returns the table replicas defined by this replication unit. Returns an empty iterator if this replication unit does not define table replicas.- Since:
- 5.8.0
-
getReplicaTable
public abstract ReplicaTable getReplicaTable(SchemaNode aTableNode)
Returns the replica of the specified table node.Returns
nullif the current replication unit does not define a replica for the specified table node.- Throws:
IllegalArgumentException- if the specified node isnull, or if it is not a table node.- Since:
- 5.8.0
-
getRefreshPolicy
public abstract RefreshPolicy getRefreshPolicy()
Returns theRefreshPolicyof this replication unit.- Since:
- 5.8.0
-
-