com.esri.arcgis.geodatabasedistributed
Interface IReplicationAgent

All Superinterfaces:
Serializable
All Known Subinterfaces:
IReplicationAgent2
All Known Implementing Classes:
ReplicationAgent

public interface IReplicationAgent
extends Serializable

Provides access to replica operations.

Remarks

The IReplicationAgent interface provides methods to create and synchronize replicas and extract data in connected environments. To perform these operations in a disconnected environment see methods on the IGeoDataServer interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Method Summary
 void createReplica(String versionName, IGeoDataServer srcGDS, IGeoDataServer destGDS, String replicaName, IGPReplicaDescription desc, IGPReplicaOptions repOptions)
          Creates a replica pair in the workspaces bound to the input geodataservers.
 void extractData(String versionName, IGeoDataServer srcGDS, IGeoDataServer destGDS, IGPReplicaDescription desc)
          Extracts data from the source geodata server into the destination geodata server.
 boolean synchronizeReplica(IGeoDataServer gds1, IGeoDataServer gds2, IGPReplica rep1, IGPReplica rep2, int pol, int dir, boolean columnLevel)
          Synchronizes a replica pair.
 

Method Detail

createReplica

void createReplica(String versionName,
                   IGeoDataServer srcGDS,
                   IGeoDataServer destGDS,
                   String replicaName,
                   IGPReplicaDescription desc,
                   IGPReplicaOptions repOptions)
                   throws IOException,
                          AutomationException
Creates a replica pair in the workspaces bound to the input geodataservers.

Remarks

The IReplicationAgent::CreateReplica method is used to create replicas in a connected environment. This method may be used to create check-out replicas, two way replicas, or one way replicas. To create replicas in a disconnected environement please see the IGeodataserver::CreateReplica method for more information

This method requires two input geodataserver objects,a srcGDS and a destGDS. The replicas will be created in the geodatabases represented by the input geodataserver objects. The srcGDS will host the parent replica, and the destGDS will host the child replica in the replica pair. See the GeoDataServer2 coclass for more information. The ReplicaName is a string that uniquely identifies the replica.

The versionName is the version on the geodatabase represented by the srcGDS from which the replica will be created.

The desc parameter defines the data which will be replicated. See the GPReplicaDescription coclass for more information.

The repOptions parameter defines replica options such as the replica access type. See the GPReplicaOptions coclass for more information.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
versionName - The versionName (in)
srcGDS - A reference to a com.esri.arcgis.geodatabasedistributed.IGeoDataServer (in)
destGDS - A reference to a com.esri.arcgis.geodatabasedistributed.IGeoDataServer (in)
replicaName - The replicaName (in)
desc - A reference to a com.esri.arcgis.geodatabase.IGPReplicaDescription (in)
repOptions - A reference to a com.esri.arcgis.geodatabase.IGPReplicaOptions (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

synchronizeReplica

boolean synchronizeReplica(IGeoDataServer gds1,
                           IGeoDataServer gds2,
                           IGPReplica rep1,
                           IGPReplica rep2,
                           int pol,
                           int dir,
                           boolean columnLevel)
                           throws IOException,
                                  AutomationException
Synchronizes a replica pair.

Remarks

The SynchronizeReplica method provides a way to synchronize changes between a replica pair in a connected environment. This method may be used with check-out replicas, two way replicas, or one way replicas. If you are using replication in a disconnected environment, where the replicas are not on the same network, you must use the IGeoDataServer interface to synchronize changes. Please see the GeoDataServer coclass for more information.

The SynchronizeReplica method requires two input geodataserver objects, gds1 and gds2. One geodataserver must reference the geodatabase with the parent replica and the other the geodatabase with the child replica. The order is not important. For example, if gds1 references the child, gds2 would reference the parent or vice versa.

The rep1 and rep2 parameters take GPReplica objects for the parent and child replicas. See the GPReplica coclass for more information. These parameters must be consistent with the ordering of the geodataserver objects passed in for gds1 and gds2. For example, if gds1 refers to the geodatabase with the parent replica then rep1 must reference the parent replica. The gds2 and rep2 parameters in the same way must then refer to the child replica.

During synchronization, changes are first applied to a synchronization version. For 2 way and 1 way replicas, this version is always reconciled and posted with the replica version. For check-out replicas, you can choose whether or not to reconcile and post. The pol parameter takes an esriReplicationAgentReconilePolicy enumeration value to determine how conflicts will be handled during reconcile. See the esriReplicationAgentReconcilePolicy enumeration for more information. The following describes the meaning of each enumeration:

esriRADetectConflicts -If conflicts occur, the reconcile process is aborted and you must reconcile and post manually after sycnhronization is completed.

esriRAResolveConflictsInFavorOfReplica1 - Automatically reconcile in favor of rep1 if conflicts arrise.

esriRAResolveConflictsInFavorOfReplica2 - Automatically reconcile in favor of rep2 if conflicts arrise.

esriRAResolveConflictsNone - This enumeration has meaning for check-out replicas only. It indicates that a the synchronization version should not be reconciled and post with the replica version during synchronization

The dir parameter takes an esriReplicaSynchronizeDirection enumeration value to define the direction to synchronize the changes. See esriReplicaSynchronizeDirection for more information.

If synchronizing in both directions, the reconcile policy set with the pol parameter will apply to both synchronizations. Therefore you must set the pol parameter to either resolve conflicts in favor of rep1 or resolve in favor of rep2. An error occurs if you specify any other policy when synchronizing in both directions.


Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
gds1 - A reference to a com.esri.arcgis.geodatabasedistributed.IGeoDataServer (in)
gds2 - A reference to a com.esri.arcgis.geodatabasedistributed.IGeoDataServer (in)
rep1 - A reference to a com.esri.arcgis.geodatabase.IGPReplica (in)
rep2 - A reference to a com.esri.arcgis.geodatabase.IGPReplica (in)
pol - A com.esri.arcgis.geodatabasedistributed.esriReplicationAgentReconcilePolicy constant (in)
dir - A com.esri.arcgis.geodatabasedistributed.esriReplicaSynchronizeDirection constant (in)
columnLevel - The columnLevel (in)
Returns:
The conflictsDetected
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

extractData

void extractData(String versionName,
                 IGeoDataServer srcGDS,
                 IGeoDataServer destGDS,
                 IGPReplicaDescription desc)
                 throws IOException,
                        AutomationException
Extracts data from the source geodata server into the destination geodata server.

Description

The IReplicationAgent::ExtractData method is used to copy data between geodatabases applying filters to determine the rows to copy.

This method requires two input geodataserver objects, a srcGDS and a destGDS. The srcGDS references the geodatabase that originally contains the data while the destGDS references the geodatabase where the data will be copied.

The desc parameter defines the data which will be extracted. See the GPReplicaDescription coclass for more information.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
versionName - The versionName (in)
srcGDS - A reference to a com.esri.arcgis.geodatabasedistributed.IGeoDataServer (in)
destGDS - A reference to a com.esri.arcgis.geodatabasedistributed.IGeoDataServer (in)
desc - A reference to a com.esri.arcgis.geodatabase.IGPReplicaDescription (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.