public class HttpPoster extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
HttpPoster.CodeDetails
Code+details paper object
|
protected class |
HttpPoster.DeleteThread
Killable thread that does deletions.
|
protected class |
HttpPoster.IngestThread
Killable thread that does ingestions.
|
protected static class |
HttpPoster.LaxTrustManager
Our own trust manager, which ignores certificate issues
|
protected class |
HttpPoster.StatusThread
Killable thread that does a status check.
|
Modifier and Type | Field and Description |
---|---|
static String |
_rcsid |
protected static int |
HEADER_CHUNK |
static String |
ingestBufferSizeProperty
Ingestion buffer size property.
|
static String |
ingestCredentialsRealm |
static String |
ingestMaxConnectionsProperty |
static String |
ingestPasswordProperty |
static String |
ingestRescheduleInterval |
static String |
ingestResponseRetryCount |
static String |
ingestResponseRetryInterval |
static String |
ingestURIProperty |
static String |
ingestUserProperty |
protected static SSLSocketFactory |
secureSocketFactory
This is the secure socket factory we will use.
|
Constructor and Description |
---|
HttpPoster(IThreadContext threadContext,
String realm,
String userID,
String password,
String postURI)
Initialized the http poster.
|
Modifier and Type | Method and Description |
---|---|
void |
checkPost()
Post a check request.
|
protected Socket |
createSocket(long responseRetryCount)
Create a socket in a manner consistent with all of our specified parameters.
|
void |
deletePost(String documentURI,
IOutputRemoveActivity activities)
Post a delete request.
|
protected String |
getResponse(BufferedReader stream)
Get the response code of the post
|
protected static SSLSocketFactory |
getSecureSocketFactory()
Build a secure socket factory based on no keystore and a lax trust manager.
|
boolean |
indexPost(String documentURI,
List<String> collections,
String documentTemplate,
String authorityNameString,
RepositoryDocument document,
IOutputAddActivity activities)
Post the input stream to ingest
|
protected static String |
metadataEncode(String inputString)
Encode for metadata.
|
protected static void |
writeACLs(StringBuilder aclXml,
String type,
String[] acl,
String[] denyAcl,
String authorityNameString,
IOutputAddActivity activities)
Write acls into a StringBuilder
|
protected void |
writeCredentials(OutputStream out)
Write credentials to output
|
public static final String _rcsid
public static String ingestBufferSizeProperty
public static String ingestCredentialsRealm
public static String ingestResponseRetryCount
public static String ingestResponseRetryInterval
public static String ingestRescheduleInterval
public static String ingestURIProperty
public static String ingestUserProperty
public static String ingestPasswordProperty
public static String ingestMaxConnectionsProperty
protected static final int HEADER_CHUNK
protected static SSLSocketFactory secureSocketFactory
public HttpPoster(IThreadContext threadContext, String realm, String userID, String password, String postURI) throws ManifoldCFException
userID
- is the unencoded user name, or null.password
- is the unencoded password, or null.postURI
- the uri to post the request toManifoldCFException
public boolean indexPost(String documentURI, List<String> collections, String documentTemplate, String authorityNameString, RepositoryDocument document, IOutputAddActivity activities) throws ManifoldCFException, ServiceInterruption
documentURI
- is the document's uri.document
- is the document structure to ingest.ManifoldCFException,
- ServiceInterruptionManifoldCFException
ServiceInterruption
protected static void writeACLs(StringBuilder aclXml, String type, String[] acl, String[] denyAcl, String authorityNameString, IOutputAddActivity activities) throws ManifoldCFException
ManifoldCFException
public void checkPost() throws ManifoldCFException, ServiceInterruption
public void deletePost(String documentURI, IOutputRemoveActivity activities) throws ManifoldCFException, ServiceInterruption
documentURI
- is the document's URI.ManifoldCFException
ServiceInterruption
protected String getResponse(BufferedReader stream) throws ManifoldCFException, ServiceInterruption
stream
- the stream the response is going to come fromManifoldCFException
ServiceInterruption
protected void writeCredentials(OutputStream out) throws IOException
IOException
protected static String metadataEncode(String inputString)
inputString
- is the input string.protected static SSLSocketFactory getSecureSocketFactory() throws ManifoldCFException
ManifoldCFException
protected Socket createSocket(long responseRetryCount) throws IOException, ManifoldCFException
IOException
ManifoldCFException