Partilhar via


CReplicationClient Class

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

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

Abort

Cancels any pending Commerce Server Staging (CSS) transactions on the destination servers during the current connection.

Commit

Applies pending CSS transactions on each destination server that is defined for the CSS project.

Connect

Initiates connections to each destination server that is defined for the CSS project.

DeleteFile

Deletes a file on each destination server that is defined for the CSS project.

Disconnect

Closes the connections to the destination servers that are defined for the CSS project.

GetExtendedErrorInfo

Retrieves any available error information about a CReplicationClient object.

Initialize

Initializes the CReplicationClient object and sets the CSS project context for the object.

SendFile

Sends a single file to each destination server that is defined for the CSS project.

SendFiles

Sends multiple files to each destination server that is defined for the CSS project.

Properties

Property

Description

FastMode

Gets or sets a flag that determines whether files are replicated in fast mode or in frame mode.

Bb508986.alert_note(en-US,CS.70).gifNote:
Fast mode is not a supported feature. This property is for internal use only by the CSS API.

Force

Gets or sets a flag that determines whether CSS files should be replicated even if their content has not changed since the last deployment.

NumDestinations

Gets the number of destination servers defined for a project.

SkipLockedFiles

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

Bb508986.alert_note(en-US,CS.70).gifNote:
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.

See Also

Other Resources

Commerce Server Staging Reference

CReplicationServer Class

Commerce Server Staging Reference