Class HttpPoster
- java.lang.Object
-
- org.apache.manifoldcf.agents.output.gts.HttpPoster
-
public class HttpPoster extends java.lang.ObjectPosts an input stream to the GTS
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classHttpPoster.CodeDetailsCode+details paper objectprotected classHttpPoster.DeleteThreadKillable thread that does deletions.protected classHttpPoster.IngestThreadKillable thread that does ingestions.protected static classHttpPoster.LaxTrustManagerOur own trust manager, which ignores certificate issuesprotected classHttpPoster.StatusThreadKillable thread that does a status check.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidprotected static intHEADER_CHUNKstatic java.lang.StringingestBufferSizePropertyIngestion buffer size property.static java.lang.StringingestCredentialsRealmstatic java.lang.StringingestMaxConnectionsPropertystatic java.lang.StringingestPasswordPropertystatic java.lang.StringingestRescheduleIntervalstatic java.lang.StringingestResponseRetryCountstatic java.lang.StringingestResponseRetryIntervalstatic java.lang.StringingestURIPropertystatic java.lang.StringingestUserPropertyprotected static javax.net.ssl.SSLSocketFactorysecureSocketFactoryThis is the secure socket factory we will use.
-
Constructor Summary
Constructors Constructor Description HttpPoster(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, java.lang.String realm, java.lang.String userID, java.lang.String password, java.lang.String postURI)Initialized the http poster.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckPost()Post a check request.protected java.net.SocketcreateSocket(long responseRetryCount)Create a socket in a manner consistent with all of our specified parameters.voiddeletePost(java.lang.String documentURI, org.apache.manifoldcf.agents.interfaces.IOutputRemoveActivity activities)Post a delete request.protected java.lang.StringgetResponse(java.io.BufferedReader stream)Get the response code of the postprotected static javax.net.ssl.SSLSocketFactorygetSecureSocketFactory()Build a secure socket factory based on no keystore and a lax trust manager.booleanindexPost(java.lang.String documentURI, java.util.List<java.lang.String> collections, java.lang.String documentTemplate, java.lang.String authorityNameString, org.apache.manifoldcf.agents.interfaces.RepositoryDocument document, org.apache.manifoldcf.agents.interfaces.IOutputAddActivity activities)Post the input stream to ingestprotected static java.lang.StringmetadataEncode(java.lang.String inputString)Encode for metadata.protected static voidwriteACLs(java.lang.StringBuilder aclXml, java.lang.String type, java.lang.String[] acl, java.lang.String[] denyAcl, java.lang.String authorityNameString, org.apache.manifoldcf.agents.interfaces.IOutputAddActivity activities)Write acls into a StringBuilderprotected voidwriteCredentials(java.io.OutputStream out)Write credentials to output
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
ingestBufferSizeProperty
public static java.lang.String ingestBufferSizeProperty
Ingestion buffer size property.
-
ingestCredentialsRealm
public static java.lang.String ingestCredentialsRealm
-
ingestResponseRetryCount
public static java.lang.String ingestResponseRetryCount
-
ingestResponseRetryInterval
public static java.lang.String ingestResponseRetryInterval
-
ingestRescheduleInterval
public static java.lang.String ingestRescheduleInterval
-
ingestURIProperty
public static java.lang.String ingestURIProperty
-
ingestUserProperty
public static java.lang.String ingestUserProperty
-
ingestPasswordProperty
public static java.lang.String ingestPasswordProperty
-
ingestMaxConnectionsProperty
public static java.lang.String ingestMaxConnectionsProperty
-
HEADER_CHUNK
protected static final int HEADER_CHUNK
- See Also:
- Constant Field Values
-
secureSocketFactory
protected static javax.net.ssl.SSLSocketFactory secureSocketFactory
This is the secure socket factory we will use. I'm presuming it's thread-safe, but if not, synchronization blocks are in order when it's used.
-
-
Constructor Detail
-
HttpPoster
public HttpPoster(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, java.lang.String realm, java.lang.String userID, java.lang.String password, java.lang.String postURI) throws org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionInitialized the http poster.- Parameters:
userID- is the unencoded user name, or null.password- is the unencoded password, or null.postURI- the uri to post the request to- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
-
Method Detail
-
indexPost
public boolean indexPost(java.lang.String documentURI, java.util.List<java.lang.String> collections, java.lang.String documentTemplate, java.lang.String authorityNameString, org.apache.manifoldcf.agents.interfaces.RepositoryDocument document, org.apache.manifoldcf.agents.interfaces.IOutputAddActivity activities) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, org.apache.manifoldcf.agents.interfaces.ServiceInterruptionPost the input stream to ingest- Parameters:
documentURI- is the document's uri.document- is the document structure to ingest.- Returns:
- true if the ingestion was successful, or false if the ingestion is illegal.
- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruption
-
writeACLs
protected static void writeACLs(java.lang.StringBuilder aclXml, java.lang.String type, java.lang.String[] acl, java.lang.String[] denyAcl, java.lang.String authorityNameString, org.apache.manifoldcf.agents.interfaces.IOutputAddActivity activities) throws org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionWrite acls into a StringBuilder- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
checkPost
public void checkPost() throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, org.apache.manifoldcf.agents.interfaces.ServiceInterruptionPost a check request.- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruption
-
deletePost
public void deletePost(java.lang.String documentURI, org.apache.manifoldcf.agents.interfaces.IOutputRemoveActivity activities) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, org.apache.manifoldcf.agents.interfaces.ServiceInterruptionPost a delete request.- Parameters:
documentURI- is the document's URI.- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruption
-
getResponse
protected java.lang.String getResponse(java.io.BufferedReader stream) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, org.apache.manifoldcf.agents.interfaces.ServiceInterruptionGet the response code of the post- Parameters:
stream- the stream the response is going to come from- Returns:
- the response string
- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruption
-
writeCredentials
protected void writeCredentials(java.io.OutputStream out) throws java.io.IOExceptionWrite credentials to output- Throws:
java.io.IOException
-
metadataEncode
protected static java.lang.String metadataEncode(java.lang.String inputString)
Encode for metadata.- Parameters:
inputString- is the input string.- Returns:
- output, encoded.
-
getSecureSocketFactory
protected static javax.net.ssl.SSLSocketFactory getSecureSocketFactory() throws org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionBuild a secure socket factory based on no keystore and a lax trust manager. This allows use of SSL for privacy but not identification.- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
createSocket
protected java.net.Socket createSocket(long responseRetryCount) throws java.io.IOException, org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionCreate a socket in a manner consistent with all of our specified parameters.- Throws:
java.io.IOExceptionorg.apache.manifoldcf.core.interfaces.ManifoldCFException
-
-