package org.collectionspace.services.common.storage;\r
\r
import org.collectionspace.services.common.api.Tools;\r
+import org.collectionspace.services.common.config.ConfigUtils;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
public static String CSPACE_DATASOURCE_NAME = "CspaceDS";\r
public static String NUXEO_DATASOURCE_NAME = "NuxeoDS";\r
// Default database names\r
- public static String DEFAULT_CSPACE_DATABASE_NAME = "cspace";\r
- public static String DEFAULT_NUXEO_REPOSITORY_NAME = "default";\r
- public static String DEFAULT_NUXEO_DATABASE_NAME = "nuxeo";\r
+ public static String DEFAULT_CSPACE_DATABASE_NAME = ConfigUtils.DEFAULT_CSPACE_DATABASE_NAME;\r
+ public static String DEFAULT_NUXEO_REPOSITORY_NAME = ConfigUtils.DEFAULT_NUXEO_REPOSITORY_NAME;\r
+ public static String DEFAULT_NUXEO_DATABASE_NAME = ConfigUtils.DEFAULT_NUXEO_DATABASE_NAME;\r
//\r
// Private constants\r
//\r
public class ConfigUtils {
final static Logger logger = LoggerFactory.getLogger(ConfigUtils.class);
+ // Default database names
+ public static String DEFAULT_CSPACE_DATABASE_NAME = "cspace";
+ public static String DEFAULT_NUXEO_REPOSITORY_NAME = "default";
+ public static String DEFAULT_NUXEO_DATABASE_NAME = "nuxeo";
+
/*
* Returns the list of repository/DB names defined by a tenant bindings file
*/
return result;
}
+ /*
+ * By convention, the repository name and database name are the same. However, this
+ * call encapulates that convention and allows overrides.
+ */
+ public static String getDatabaseName(TenantBindingType tenantBindingType, String domainName) {
+ String result = getRepositoryName(tenantBindingType, domainName);
+
+ if (result.equalsIgnoreCase(DEFAULT_NUXEO_REPOSITORY_NAME) == true) {
+ result = DEFAULT_NUXEO_DATABASE_NAME;
+ }
+
+ return result;
+ }
+
public static String getRepositoryName(TenantBindingType tenantBindingType, String domainName) {
String result = null;