|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.replicator.http.HttpClientBase
org.apache.lucene.replicator.http.HttpReplicator
public class HttpReplicator
An HTTP implementation of Replicator
. Assumes the API supported by
ReplicationService
.
Field Summary |
---|
Fields inherited from class org.apache.lucene.replicator.http.HttpClientBase |
---|
DEFAULT_CONNECTION_TIMEOUT, DEFAULT_SO_TIMEOUT, url |
Constructor Summary | |
---|---|
HttpReplicator(String host,
int port,
String path,
org.apache.http.conn.ClientConnectionManager conMgr)
Construct with specified connection manager. |
Method Summary | |
---|---|
SessionToken |
checkForUpdate(String currVersion)
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 . |
InputStream |
obtainFile(String sessionID,
String source,
String fileName)
Returns an InputStream for the requested file and source in the
context of the given session . |
void |
publish(Revision revision)
Publish a new Revision for consumption by clients. |
void |
release(String sessionID)
Notify that the specified SessionToken is 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, setConnectionTimeout, setSoTimeout, throwKnownError, verifyStatus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.io.Closeable |
---|
close |
Constructor Detail |
---|
public HttpReplicator(String host, int port, String path, org.apache.http.conn.ClientConnectionManager conMgr)
Method Detail |
---|
public SessionToken checkForUpdate(String currVersion) throws IOException
Replicator
SessionToken
which can be used for fetching the revision files,
otherwise returns null
.
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.
checkForUpdate
in interface Replicator
IOException
public InputStream obtainFile(String sessionID, String source, String fileName) throws IOException
Replicator
InputStream
for the requested file and source in the
context of the given session
.
NOTE: it is the caller's responsibility to close the returned stream.
obtainFile
in interface Replicator
SessionExpiredException
- if the specified session has already
expired
IOException
public void publish(Revision revision) throws IOException
Replicator
Revision
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
released
by the replicator.
publish
in interface Replicator
IOException
public void release(String sessionID) throws IOException
Replicator
SessionToken
is no longer needed by the
caller.
release
in interface Replicator
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |