Previous in Contents Next in Contents

Commit Method

This method commits changes to the event sink.

Syntax

ReplicationEventSinkConfig.Commit

Remarks

You must have Site Server Publishing administrator privileges on the server to get or set this property.

You must commit any event sink changes and stop and restart the Content Deployment server before the event sink changes take effect. Use the ReplicationServer.Stop method to stop the server and the ReplicationServer.Start method to start the server.

Example

The following example adds Project1's events to those that the Microsoft® Windows NT® event sink monitors, commits the change, and stops and restarts the server.

Option Explicit 
On Error Resume Next

const CRS_ERROR_NO_MORE_ITEMS  = 0&80003B17

dim ReplServer
set ReplServer = CreateObject("CrsApi.ReplicationServer")
ReplServer.Initialize("")

dim Iterator
Iterator = 0
dim EvSink

do while True
  'Clear any error text
  Err.Clear
  'Get an event sink
  set EvSink = ReplServer.EnumEventSinks(Iterator)
  'Quit if empty object returned (no more instances)
  if IsEmpty(EvSink) then exit do
  'Quit if "No more items" error 
  dim ReplError
  ReplError = Err.Number
  if ReplError = CRS_ERROR_NO_MORE_ITEMS then exit do
  if EvSink.CLSID = "NT" then
    EvSink.ProjectFilter("Project1")
    EvSink.Commit
    ReplServer.Stop
    ReplServer.Start
  end if
Loop

'Release objects
set EvSink     = Nothing
set ReplServer = Nothing

See Also

ReplicationServer.AddEventSink, ReplicationServer.EnumEventSinks


© 1997-2000 Microsoft Corporation. All rights reserved.