MT - simpify tenant deployer service (subsume tenant service)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8244 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2008-02-11 11:53:56 +00:00
parent 1f36c62b18
commit 14ef325e93
13 changed files with 101 additions and 80 deletions

View File

@@ -1012,12 +1012,7 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
tenantDeployers.remove(deployer);
}
}
public boolean isEnabled()
{
return tenantService.isEnabled();
}
public void resetCache(String tenantDomain)
{
if (existsTenant(tenantDomain))
@@ -1098,6 +1093,28 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
}
}
// tenant deployer services delegated to tenant service
public boolean isEnabled()
{
return tenantService.isEnabled();
}
public String getCurrentUserDomain()
{
return tenantService.getCurrentUserDomain();
}
public String getDomainUser(String baseUsername, String tenantDomain)
{
return tenantService.getDomainUser(baseUsername, tenantDomain);
}
public String getDomain(String name)
{
return tenantService.getDomain(name);
}
// local helpers
private String getSystemUser(String tenantDomain)

View File

@@ -59,4 +59,24 @@ public class SingleTDeployerServiceImpl implements TenantDeployerService
{
return new ArrayList<Tenant>(0); // empty list
}
public String getCurrentUserDomain()
{
return TenantService.DEFAULT_DOMAIN;
}
public String getDomainUser(String baseUsername, String tenantDomain)
{
return baseUsername;
}
public String getDomain(String name)
{
return TenantService.DEFAULT_DOMAIN;
}
public boolean isEnabled()
{
return false;
}
}

View File

@@ -0,0 +1,43 @@
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.repo.tenant;
/**
* Tenant Base Service interface.
* <p>
* Common for TenantService and TenantDeployerService
*
*/
public interface TenantBaseService
{
public String getCurrentUserDomain();
public String getDomainUser(String baseUsername, String tenantDomain);
public String getDomain(String name);
public boolean isEnabled();
}

View File

@@ -37,7 +37,7 @@ import org.apache.commons.logging.Log;
*
*/
public interface TenantDeployerService
public interface TenantDeployerService extends TenantBaseService
{
public void deployTenants(final TenantDeployer deployer, Log logger);

View File

@@ -39,7 +39,7 @@ import org.alfresco.service.namespace.QName;
* This interface provides methods to support either ST or MT implementations.
*
*/
public interface TenantService
public interface TenantService extends TenantBaseService
{
public static final String SEPARATOR = "@";
@@ -88,14 +88,6 @@ public interface TenantService
public boolean isTenantName(String name);
public String getUserDomain(String username);
public String getCurrentUserDomain();
public String getDomain(String name);
public String getDomainUser(String baseUsername, String tenantDomain);
public Tenant getTenant(String tenantDomain);
public boolean isEnabled();
}