From: Aron Roberts Date: Tue, 3 May 2011 23:52:42 +0000 (+0000) Subject: CSPACE-1783: Friendlier messages during CSpace server startup when a repository works... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=e933e1524fe2546ef573b0d24c0daee5705f43aa;p=tmp%2Fjakarta-migration.git CSPACE-1783: Friendlier messages during CSpace server startup when a repository workspace can't be found. --- diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/TenantRepository.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/TenantRepository.java index 401b66a50..5527727c8 100644 --- a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/TenantRepository.java +++ b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/TenantRepository.java @@ -149,6 +149,7 @@ public class TenantRepository { RepositoryClient repositoryClient = getRepositoryClient(repositoryDomain); + boolean createdNewWorkspace = false; //retrieve all workspace ids for a domain //domain specific table of workspace name and id Hashtable workspaceIds = @@ -185,8 +186,8 @@ public class TenantRepository { workspaceId = workspaceIds.get(workspace); if (workspaceId == null) { if (logger.isWarnEnabled()) { - logger.warn("Failed to retrieve workspace ID for " + workspace - + " from repository, creating a new workspace ..."); + logger.warn("Could not find workspace for " + workspace + + " in repository. Creating new workspace ..."); } workspaceId = repositoryClient.createWorkspace( repositoryDomain.getName(), @@ -199,9 +200,11 @@ public class TenantRepository { } continue; } - if (logger.isDebugEnabled()) { - logger.debug("Successfully created workspace in repository" - + " id=" + workspaceId + " for service=" + workspace + createdNewWorkspace = true; + if (logger.isInfoEnabled()) { + logger.info("Successfully created repository workspace=" + + workspace + " id=" + workspaceId + + " for service=" + serviceName + " for tenant=" + tenantBinding.getName()); } } @@ -211,11 +214,15 @@ public class TenantRepository { TenantBindingConfigReaderImpl.getTenantQualifiedServiceName( tenantBinding.getId(), serviceName); serviceWorkspaces.put(tenantService, workspaceId); - if (logger.isInfoEnabled()) { - logger.info("Created/retrieved repository workspace=" - + workspace + " id=" + workspaceId - + " for service=" + serviceName - + " for tenant=" + tenantBinding.getName()); + if (createdNewWorkspace) { + createdNewWorkspace = false; + } else { + if (logger.isInfoEnabled()) { + logger.info("Retrieved repository workspace=" + + workspace + " id=" + workspaceId + + " for service=" + serviceName + + " for tenant=" + tenantBinding.getName()); + } } } }//rof for service binding