Skip to content
Snippets Groups Projects
Commit e55f3c34 authored by Alan Braz's avatar Alan Braz
Browse files

remove inject and connect to Cloudant

parent a8d3eb98
No related branches found
No related tags found
1 merge request!6Trusted ibm
......@@ -15,8 +15,8 @@
package org.opengroup.osdu.indexer.ibm.persistence;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import org.opengroup.osdu.core.ibm.auth.ServiceCredentials;
import org.opengroup.osdu.core.ibm.cloudant.IBMCloudantClientFactory;
import org.opengroup.osdu.indexer.ibm.model.ElasticSettingSchema;
import org.slf4j.Logger;
......@@ -41,12 +41,10 @@ public class ElasticSettingSchemaRepositoryImpl implements ISchemaRepository {
private Database db;
@Inject
private IBMCloudantClientFactory cloudantFactory;
@PostConstruct
public void init(){
try {
IBMCloudantClientFactory cloudantFactory = new IBMCloudantClientFactory(new ServiceCredentials(url, apiKey));
db = cloudantFactory.getDatabase(dbNamePrefix, "SearchSettings");
} catch (Exception e) {
e.printStackTrace();
......@@ -55,12 +53,12 @@ public class ElasticSettingSchemaRepositoryImpl implements ISchemaRepository {
@Override
public void add(ElasticSettingSchema schema, String id) {
ElasticSettingsDoc sd = new ElasticSettingsDoc(); sd.setId(id);
ElasticSettingsDoc sd = new ElasticSettingsDoc();
sd.setId(id);
sd.setSettingSchema(schema);
db.save(sd);
}
@Override
public ElasticSettingSchema get(String id) {
if (db.contains(id)) {
......
......@@ -51,7 +51,7 @@ public class RequestInfoImpl implements IRequestInfo {
private IServiceAccountJwtClient serviceAccountJwtClient;
@Inject
@Qualifier("TenantInfoFactorySearch")
//@Qualifier("TenantInfoFactorySearch")
private TenantInfo tenantInfo;
@Value("${DEPLOYMENT_ENVIRONMENT}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment