CReplicationClient Class
Copies individual files to destination servers. This class provides finer control for replicating individual files than that provided by the CReplicationProject class.
Note
The CReplicationClient class can be used only to copy files from one server to another. It cannot be used to copy files associated with an Internet Information Services (IIS) metabase or business data project.
Methods
Method |
Description |
---|---|
Cancels any pending Commerce Server Staging (CSS) transactions on the destination servers during the current connection. |
|
Applies pending CSS transactions on each destination server that is defined for the CSS project. |
|
Initiates connections to each destination server that is defined for the CSS project. |
|
Deletes a file on each destination server that is defined for the CSS project. |
|
Closes the connections to the destination servers that are defined for the CSS project. |
|
Retrieves any available error information about a CReplicationClient object. |
|
Initializes the CReplicationClient object and sets the CSS project context for the object. |
|
Sends a single file to each destination server that is defined for the CSS project. |
|
Sends multiple files to each destination server that is defined for the CSS project. |
Properties
Property |
Description |
---|---|
Gets or sets a flag that determines whether files are replicated in fast mode or in frame mode.
Note:
Fast mode is not a supported feature. This property is for internal use only by the CSS API.
|
|
Gets or sets a flag that determines whether CSS files should be replicated even if their content has not changed since the last deployment. |
|
Gets the number of destination servers defined for a project. |
|
Gets or sets a flag that specifies how CSS should manage the replication of locked files. |
Remarks
You can use the methods and properties of the CReplicationClient class only to copy files to a different host server. You cannot use these methods or properties to replicate files on the same host or to replicate an IIS metabase project or a business data project.
The CReplicationClient object is designed to replicate individual files and not a complete project. However, the CReplicationClient object works under the context of a project to manage specific aspects of the replication operation.
The following table provides additional information about this class.
Assembly |
CSSAPILib |
Namespace |
Microsoft.CommerceServer.Staging.Interop
Note:
You must also add a using directive for the System.ServiceProcesses namespace.
|
Corresponding COM class |
ReplicationClient |
CLSID |
819666E8-B7DD-4573-AF9D-DDC995DB366D |
ProgID |
CssApi.ReplicationClient |
Example
You create a new CReplicationClient object to open either a new project or an existing project. In the following example, the project named Project1 is opened to send a single file, Newfile.htm, to the destination servers that are defined for Project1.
CReplicationClient replicationClient = new CReplicationClient();
replicationClient.Initialize("Project1");
replicationClient.SendFile("Newfile.htm");
After you create the CReplicationClient object, you must call the Initialize method on the CReplicationClient object, unless the object is created through a CReplicationProject object. If the object is created through a CReplicationProject object, you do not have to call the Initialize method.