Show / Hide Table of Contents

    Interface IReplicator

    An interface for replicating files. Allows a producer to Publish(IRevision) IRevisions and consumers to CheckForUpdate(String). When a client needs to be updated, it is given a SessionToken through which it can ObtainFile(String, String, String) the files of that revision. After the client has finished obtaining all the files, it should Release(String) the given session, so that the files can be reclaimed if they are not needed anymore.

    A client is always updated to the newest revision available. That is, if a client is on revision r1 and revisions r2 and r3 were published, then when the client will next check for update, it will receive r3.

    Namespace: Lucene.Net.Replicator
    Assembly: Lucene.Net.Replicator.dll
    Syntax
    public interface IReplicator : IDisposable
    Remarks
    This is a Lucene.NET EXPERIMENTAL API, use at your own risk

    Methods

    | Improve this Doc View Source

    CheckForUpdate(String)

    Check whether the given version is up-to-date and returns a SessionToken which can be used for fetching the revision files, otherwise returns null.

    Declaration
    SessionToken CheckForUpdate(string currentVersion)
    Parameters
    Type Name Description
    System.String currentVersion
    Returns
    Type Description
    SessionToken
    Remarks

    NOTE: When the returned session token is no longer needed, you should call Release(String) so that the session resources can be reclaimed, including the revision files.

    | Improve this Doc View Source

    ObtainFile(String, String, String)

    Returns an for the requested file and source in the context of the given Id.

    Declaration
    Stream ObtainFile(string sessionId, string source, string fileName)
    Parameters
    Type Name Description
    System.String sessionId
    System.String source
    System.String fileName
    Returns
    Type Description
    Stream
    Remarks

    NOTE: It is the caller's responsibility to call on the returned stream.

    Exceptions
    Type Condition
    SessionExpiredException

    The specified session has already expired

    | Improve this Doc View Source

    Publish(IRevision)

    Publish a new IRevision for consumption by clients. It is the caller's responsibility to verify that the revision files exist and can be read by clients. When the revision is no longer needed, it will be Release(String)d by the replicator.

    Declaration
    void Publish(IRevision revision)
    Parameters
    Type Name Description
    IRevision revision

    The IRevision to publish.

    | Improve this Doc View Source

    Release(String)

    Notify that the specified SessionToken is no longer needed by the caller.

    Declaration
    void Release(string sessionId)
    Parameters
    Type Name Description
    System.String sessionId
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)