use of org.apache.manifoldcf.core.interfaces.IDBInterface in project manifoldcf by apache.
the class AmazonCloudSearchConnector method deinstall.
@Override
public void deinstall(IThreadContext threadContext) throws ManifoldCFException {
IDBInterface mainDatabase = DBInterfaceFactory.make(threadContext, ManifoldCF.getMasterDatabaseName(), ManifoldCF.getMasterDatabaseUsername(), ManifoldCF.getMasterDatabasePassword());
DocumentChunkManager dcmanager = new DocumentChunkManager(mainDatabase);
dcmanager.deinstall();
}
use of org.apache.manifoldcf.core.interfaces.IDBInterface in project manifoldcf by apache.
the class AmazonCloudSearchConnector method getSession.
/**
* Set up a session
*/
protected void getSession() throws ManifoldCFException {
if (documentChunkManager == null) {
IDBInterface databaseHandle = DBInterfaceFactory.make(currentContext, ManifoldCF.getMasterDatabaseName(), ManifoldCF.getMasterDatabaseUsername(), ManifoldCF.getMasterDatabasePassword());
documentChunkManager = new DocumentChunkManager(databaseHandle);
}
serverHost = params.getParameter(AmazonCloudSearchConfig.SERVER_HOST);
if (serverHost == null)
throw new ManifoldCFException("Server host parameter required");
serverPath = params.getParameter(AmazonCloudSearchConfig.SERVER_PATH);
if (serverPath == null)
throw new ManifoldCFException("Server path parameter required");
String proxyProtocol = params.getParameter(AmazonCloudSearchConfig.PROXY_PROTOCOL);
String proxyHost = params.getParameter(AmazonCloudSearchConfig.PROXY_HOST);
String proxyPort = params.getParameter(AmazonCloudSearchConfig.PROXY_PORT);
// Https is OK here without a custom trust store because we know we are talking to an Amazon instance, which has certs that
// are presumably non-custom.
String urlStr = "https://" + serverHost + serverPath;
poster = new HttpPost(urlStr);
// set proxy
if (proxyHost != null && proxyHost.length() > 0) {
try {
HttpHost proxy = new HttpHost(proxyHost, Integer.parseInt(proxyPort), proxyProtocol);
RequestConfig config = RequestConfig.custom().setProxy(proxy).build();
poster.setConfig(config);
} catch (NumberFormatException e) {
throw new ManifoldCFException("Number format exception: " + e.getMessage(), e);
}
}
poster.addHeader("Content-Type", "application/json");
}
use of org.apache.manifoldcf.core.interfaces.IDBInterface in project manifoldcf by apache.
the class AmazonCloudSearchConnector method install.
@Override
public void install(IThreadContext threadContext) throws ManifoldCFException {
IDBInterface mainDatabase = DBInterfaceFactory.make(threadContext, ManifoldCF.getMasterDatabaseName(), ManifoldCF.getMasterDatabaseUsername(), ManifoldCF.getMasterDatabasePassword());
DocumentChunkManager dcmanager = new DocumentChunkManager(mainDatabase);
dcmanager.install();
}
Aggregations