Added CkanDB in configuration
This commit is contained in:
parent
7d6de07bac
commit
41c5044255
4
pom.xml
4
pom.xml
|
@ -52,5 +52,9 @@
|
|||
<groupId>org.gcube.core</groupId>
|
||||
<artifactId>common-scope</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.core</groupId>
|
||||
<artifactId>common-encryption</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,36 @@
|
|||
package org.gcube.gcat.api.configuration;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
public class CKANDB {
|
||||
|
||||
protected String url;
|
||||
protected String username;
|
||||
protected String password;
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
}
|
|
@ -6,9 +6,6 @@ import java.util.Set;
|
|||
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.gcube.com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.gcube.com.fasterxml.jackson.annotation.JsonSetter;
|
||||
import org.gcube.com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import org.gcube.com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import org.gcube.common.scope.impl.ScopeBean;
|
||||
|
||||
/**
|
||||
|
@ -18,7 +15,9 @@ public class CatalogueConfiguration {
|
|||
|
||||
public static final String CONTEXT_KEY = "context";
|
||||
public static final String CKAN_URL_KEY = "ckanURL";
|
||||
public static final String SYS_ADMIN_TOKEN_KEY = "sysAdminToken";
|
||||
public static final String SOLR_URL_KEY = "solrURL";
|
||||
public static final String CKAN_DB_KEY = "ckanDB";
|
||||
|
||||
protected String id;
|
||||
|
||||
|
@ -28,6 +27,7 @@ public class CatalogueConfiguration {
|
|||
protected Set<String> supportedOrganizations;
|
||||
|
||||
protected String ckanURL;
|
||||
|
||||
protected String sysAdminToken;
|
||||
|
||||
protected String solrURL;
|
||||
|
@ -37,7 +37,7 @@ public class CatalogueConfiguration {
|
|||
|
||||
protected boolean moderationEnabled;
|
||||
|
||||
private ObjectMapper mapper;
|
||||
protected CKANDB ckanDB;
|
||||
|
||||
/*
|
||||
* Return the CKAN organization name using the current context name
|
||||
|
@ -81,12 +81,11 @@ public class CatalogueConfiguration {
|
|||
this.ckanURL = ckanURL;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getSysAdminToken() {
|
||||
return sysAdminToken;
|
||||
}
|
||||
|
||||
public void setSysAdminToken(String sysAdminToken) {
|
||||
public void setSysAdminToken(String sysAdminToken) throws Exception {
|
||||
this.sysAdminToken = sysAdminToken;
|
||||
}
|
||||
|
||||
|
@ -164,24 +163,17 @@ public class CatalogueConfiguration {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
public CKANDB getCkanDB() {
|
||||
return ckanDB;
|
||||
}
|
||||
|
||||
public void setCkanDB(CKANDB ckanDB) {
|
||||
this.ckanDB = ckanDB;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public ScopeBean getScopeBean() {
|
||||
return scopeBean;
|
||||
}
|
||||
|
||||
public ObjectNode toObjetNode() throws JsonProcessingException {
|
||||
if(mapper==null) {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
return mapper.valueToTree(this);
|
||||
}
|
||||
|
||||
public String toJsonString() throws JsonProcessingException {
|
||||
if(mapper==null) {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
return mapper.writeValueAsString(this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue