Class ReplicationClient
A client which monitors and obtains new revisions from a IReplicator. It can be used to either periodically check for updates by invoking StartUpdateThread(Int64, String), or manually by calling UpdateNow().
Whenever a new revision is available, the RequiredFiles(IDictionary<String, IList<RevisionFile>>) are copied to the Directory specified by PerSessionDirectoryFactory and a handler is notified.
Inheritance
Assembly: Lucene.Net.Replicator.dll
Syntax
public class ReplicationClient : IDisposable
Remarks
@lucene.experimental
Constructors
Name | Description |
---|---|
ReplicationClient(IReplicator, IReplicationHandler, ISourceDirectoryFactory) | Constructor. |
Fields
Name | Description |
---|---|
INFO_STREAM_COMPONENT | The component name to use with IsEnabled(String) |
Properties
Name | Description |
---|---|
InfoStream | Gets or sets the InfoStream to use for logging messages. |
IsUpdateThreadAlive | Returns true if the update thread is alive. The update thread is alive if it has been StartUpdateThread(Int64, String) and not StopUpdateThread(), as well as didn't hit an error which caused it to terminate (i.e. HandleUpdateException(Exception) threw the exception further). |
Methods
Name | Description |
---|---|
Dispose() | |
Dispose(Boolean) | |
EnsureOpen() | Throws |
HandleUpdateException(Exception) | Called when an exception is hit by the replication thread. The default implementation prints the full stacktrace to the InfoStream set in InfoStream, or the Default one. You can override to log the exception elsewhere. |
RequiredFiles(IDictionary<String, IList<RevisionFile>>) | Returns the files required for replication. By default, this method returns all files that exist in the new revision, but not in the handler. |
StartUpdateThread(Int64, String) | Start the update thread with the specified interval in milliseconds. For
debugging purposes, you can optionally set the name to set on
Lucene.Net.Replicator.ReplicationClient.ReplicationThread.Name. If you pass |
StopUpdateThread() | Stop the update thread. If the update thread is not running, silently does nothing. This method returns after the update thread has stopped. |
ToString() | |
UpdateNow() | Executes the update operation immediately, regardless if an update thread is running or not. |