Class HttpReplicator
- java.lang.Object
-
- org.apache.lucene.replicator.http.HttpClientBase
-
- org.apache.lucene.replicator.http.HttpReplicator
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Replicator
@Deprecated public class HttpReplicator extends HttpClientBase implements Replicator
Deprecated.use org.apache.lucene.replicator.nrt insteadAn HTTP implementation ofReplicator. Assumes the API supported byReplicationService.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.replicator.http.HttpClientBase
DEFAULT_CONNECTION_TIMEOUT, DEFAULT_SO_TIMEOUT, url
-
-
Constructor Summary
Constructors Constructor Description HttpReplicator(String host, int port, String path, org.apache.http.conn.HttpClientConnectionManager conMgr)Deprecated.Construct with specified connection manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SessionTokencheckForUpdate(String currVersion)Deprecated.Check whether the given version is up-to-date and returns aSessionTokenwhich can be used for fetching the revision files, otherwise returnsnull.InputStreamobtainFile(String sessionID, String source, String fileName)Deprecated.Returns anInputStreamfor the requested file and source in the context of the givensession.voidpublish(Revision revision)Deprecated.Publish a newRevisionfor consumption by clients.voidrelease(String sessionID)Deprecated.Notify that the specifiedSessionTokenis no longer needed by the caller.-
Methods inherited from class org.apache.lucene.replicator.http.HttpClientBase
close, doAction, doAction, ensureOpen, executeGET, executePOST, isClosed, responseInputStream, responseInputStream, throwKnownError, verifyStatus
-
-
-
-
Method Detail
-
checkForUpdate
public SessionToken checkForUpdate(String currVersion) throws IOException
Deprecated.Description copied from interface:ReplicatorCheck whether the given version is up-to-date and returns aSessionTokenwhich can be used for fetching the revision files, otherwise returnsnull.NOTE: when the returned session token is no longer needed, you should call
Replicator.release(String)so that the session resources can be reclaimed, including the revision files.- Specified by:
checkForUpdatein interfaceReplicator- Throws:
IOException
-
obtainFile
public InputStream obtainFile(String sessionID, String source, String fileName) throws IOException
Deprecated.Description copied from interface:ReplicatorReturns anInputStreamfor the requested file and source in the context of the givensession.NOTE: it is the caller's responsibility to close the returned stream.
- Specified by:
obtainFilein interfaceReplicator- Throws:
SessionExpiredException- if the specified session has already expiredIOException
-
publish
public void publish(Revision revision) throws IOException
Deprecated.Description copied from interface:ReplicatorPublish a newRevisionfor 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 bereleasedby the replicator.- Specified by:
publishin interfaceReplicator- Throws:
IOException
-
release
public void release(String sessionID) throws IOException
Deprecated.Description copied from interface:ReplicatorNotify that the specifiedSessionTokenis no longer needed by the caller.- Specified by:
releasein interfaceReplicator- Throws:
IOException
-
-