Package org.alfresco.repo.tenant
Class MultiTAdminServiceImpl
- java.lang.Object
-
- org.alfresco.repo.tenant.MultiTAdminServiceImpl
-
- All Implemented Interfaces:
TenantAdminService,org.alfresco.repo.tenant.TenantUserService,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
public class MultiTAdminServiceImpl extends java.lang.Object implements TenantAdminService, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
MT Admin Service Implementation.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.springframework.context.ApplicationContextctxprotected org.alfresco.repo.dictionary.DictionaryComponentdictionaryComponentprotected static intMAX_LENprotected net.sf.acegisecurity.providers.encoding.PasswordEncoderpasswordEncoderstatic java.lang.StringPROTOCOL_STORE_ARCHIVEstatic java.lang.StringPROTOCOL_STORE_SYSTEMstatic java.lang.StringPROTOCOL_STORE_USERstatic java.lang.StringPROTOCOL_STORE_WORKSPACEprotected static java.lang.StringREGEX_CONTAINS_ALPHAprotected static java.lang.StringREGEX_VALID_DNS_LABELstatic java.lang.StringSTORE_BASE_ID_SPACESstatic java.lang.StringSTORE_BASE_ID_SYSTEMstatic java.lang.StringSTORE_BASE_ID_USERstatic java.lang.StringSTORE_BASE_ID_VERSION1static java.lang.StringSTORE_BASE_ID_VERSION2static java.lang.StringTENANT_ATTRIBUTE_DB_URLstatic java.lang.StringTENANT_ATTRIBUTE_ENABLEDstatic java.lang.StringTENANT_ATTRIBUTE_ROOT_CONTENT_STORE_DIRprotected TenantAdminDAOtenantAdminDAOprotected org.alfresco.repo.content.ContentStoretenantFileContentStorestatic java.lang.StringTENANTS_ATTRIBUTE_PATHprotected TransactionServicetransactionService
-
Constructor Summary
Constructors Constructor Description MultiTAdminServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterPropertiesSet()voidcreateTenant(java.lang.String tenantDomain, char[] tenantAdminRawPassword)voidcreateTenant(java.lang.String tenantDomain, char[] tenantAdminRawPassword, java.lang.String contentRoot)voidcreateTenant(java.lang.String tenantDomainIn, char[] tenantAdminRawPassword, java.lang.String contentRootPath, java.lang.String dbUrl)voiddeleteTenant(java.lang.String tenantDomain)voiddeployTenants(org.alfresco.repo.tenant.TenantDeployer deployer, org.apache.commons.logging.Log logger)voiddisableTenant(java.lang.String tenantDomain)voidenableTenant(java.lang.String tenantDomain)booleanexistsTenant(java.lang.String tenantDomain)voidexportTenant(java.lang.String tenantDomainIn, java.io.File directoryDestination)Export tenant - equivalent to the tenant admin running a 'complete repo' export from the Web Client Adminjava.util.List<org.alfresco.repo.tenant.Tenant>getAllTenants()Deprecated.java.lang.StringgetBaseNameUser(java.lang.String username)java.lang.StringgetCurrentUserDomain()java.lang.StringgetDomainUser(java.lang.String baseUsername, java.lang.String tenantDomain)org.alfresco.repo.tenant.TenantgetTenant(java.lang.String tenantDomain)protected java.lang.StringgetTenantDomain(java.lang.String tenantDomain)Do a null check and convert tenant domain to lowercasejava.util.List<org.alfresco.repo.tenant.Tenant>getTenants(boolean enabledOnly)Deprecated.java.lang.StringgetUserDomain(java.lang.String username)voidimportTenant(java.lang.String tenantDomainIn, java.io.File directorySource, java.lang.String contentRoot)Create tenant by restoring from a complete repository export.booleanisEnabled()booleanisEnabledTenant(java.lang.String tenantDomain)protected booleanisTenantDeployer(org.alfresco.repo.content.ContentStore contentStore)protected booleanisTenantRoutingContentStore(org.alfresco.repo.content.ContentStore contentStore)protected voidnotifyAfterEnableTenant(java.lang.String tenantDomain)Call allTenantDeployersas the system tenant.voidregister(org.alfresco.repo.tenant.TenantDeployer deployer)voidregister(WorkflowDeployer workflowDeployer)voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)voidsetAuthenticationContext(AuthenticationContext authenticationContext)voidsetBaseAdminUsername(java.lang.String baseAdminUsername)voidsetBehaviourFilter(BehaviourFilter behaviourFilter)voidsetContentRootContainerPath(java.lang.String contentRootContainerPath)voidsetDictionaryComponent(org.alfresco.repo.dictionary.DictionaryComponent dictionaryComponent)voidsetModuleService(ModuleService moduleService)voidsetNodeService(DbNodeServiceImpl dbNodeService)voidsetPasswordEncoder(net.sf.acegisecurity.providers.encoding.PasswordEncoder passwordEncoder)voidsetRepoAdminService(RepoAdminService repoAdminService)voidsetRepositoryExporterService(RepositoryExporterService repositoryExporterService)voidsetTenantAdminDAO(TenantAdminDAO tenantAdminDAO)voidsetTenantFileContentStore(org.alfresco.repo.content.ContentStore tenantFileContentStore)voidsetTenantRoutingDataSource(TenantRoutingDataSource trds)voidsetTenantService(MultiTServiceImpl tenantService)voidsetThumbnailRegistry(ThumbnailRegistry thumbnailRegistry)voidsetTransactionService(TransactionService transactionService)voidsetWorkflowDeployer(WorkflowDeployer workflowDeployer)Deprecated.see setWorkflowDeployersvoidsetWorkflowService(WorkflowService workflowService)voidstartTenants()voidstopTenants()protected org.alfresco.repo.tenant.TenantDeployertenantDeployer(org.alfresco.repo.content.ContentStore contentStore)protected TenantRoutingContentStoretenantRoutingContentStore(org.alfresco.repo.content.ContentStore contentStore)voidundeployTenants(org.alfresco.repo.tenant.TenantDeployer deployer, org.apache.commons.logging.Log logger)voidunregister(org.alfresco.repo.tenant.TenantDeployer deployer)protected voidvalidateTenantName(java.lang.String tenantDomain)
-
-
-
Field Detail
-
ctx
protected org.springframework.context.ApplicationContext ctx
-
transactionService
protected TransactionService transactionService
-
dictionaryComponent
protected org.alfresco.repo.dictionary.DictionaryComponent dictionaryComponent
-
tenantAdminDAO
protected TenantAdminDAO tenantAdminDAO
-
passwordEncoder
protected net.sf.acegisecurity.providers.encoding.PasswordEncoder passwordEncoder
-
tenantFileContentStore
protected org.alfresco.repo.content.ContentStore tenantFileContentStore
-
REGEX_VALID_DNS_LABEL
protected static final java.lang.String REGEX_VALID_DNS_LABEL
- See Also:
- Constant Field Values
-
REGEX_CONTAINS_ALPHA
protected static final java.lang.String REGEX_CONTAINS_ALPHA
- See Also:
- Constant Field Values
-
MAX_LEN
protected static final int MAX_LEN
- See Also:
- Constant Field Values
-
PROTOCOL_STORE_USER
public static final java.lang.String PROTOCOL_STORE_USER
- See Also:
- Constant Field Values
-
PROTOCOL_STORE_WORKSPACE
public static final java.lang.String PROTOCOL_STORE_WORKSPACE
- See Also:
- Constant Field Values
-
PROTOCOL_STORE_SYSTEM
public static final java.lang.String PROTOCOL_STORE_SYSTEM
- See Also:
- Constant Field Values
-
PROTOCOL_STORE_ARCHIVE
public static final java.lang.String PROTOCOL_STORE_ARCHIVE
- See Also:
- Constant Field Values
-
STORE_BASE_ID_USER
public static final java.lang.String STORE_BASE_ID_USER
- See Also:
- Constant Field Values
-
STORE_BASE_ID_SYSTEM
public static final java.lang.String STORE_BASE_ID_SYSTEM
- See Also:
- Constant Field Values
-
STORE_BASE_ID_VERSION1
public static final java.lang.String STORE_BASE_ID_VERSION1
- See Also:
- Constant Field Values
-
STORE_BASE_ID_VERSION2
public static final java.lang.String STORE_BASE_ID_VERSION2
- See Also:
- Constant Field Values
-
STORE_BASE_ID_SPACES
public static final java.lang.String STORE_BASE_ID_SPACES
- See Also:
- Constant Field Values
-
TENANTS_ATTRIBUTE_PATH
public static final java.lang.String TENANTS_ATTRIBUTE_PATH
- See Also:
- Constant Field Values
-
TENANT_ATTRIBUTE_ENABLED
public static final java.lang.String TENANT_ATTRIBUTE_ENABLED
- See Also:
- Constant Field Values
-
TENANT_ATTRIBUTE_ROOT_CONTENT_STORE_DIR
public static final java.lang.String TENANT_ATTRIBUTE_ROOT_CONTENT_STORE_DIR
- See Also:
- Constant Field Values
-
TENANT_ATTRIBUTE_DB_URL
public static final java.lang.String TENANT_ATTRIBUTE_DB_URL
- See Also:
- Constant Field Values
-
-
Method Detail
-
setNodeService
public void setNodeService(DbNodeServiceImpl dbNodeService)
-
setDictionaryComponent
public void setDictionaryComponent(org.alfresco.repo.dictionary.DictionaryComponent dictionaryComponent)
-
setRepoAdminService
public void setRepoAdminService(RepoAdminService repoAdminService)
-
setAuthenticationContext
public void setAuthenticationContext(AuthenticationContext authenticationContext)
-
setTransactionService
public void setTransactionService(TransactionService transactionService)
-
setTenantService
public void setTenantService(MultiTServiceImpl tenantService)
-
setBehaviourFilter
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
-
setTenantAdminDAO
public void setTenantAdminDAO(TenantAdminDAO tenantAdminDAO)
-
setPasswordEncoder
public void setPasswordEncoder(net.sf.acegisecurity.providers.encoding.PasswordEncoder passwordEncoder)
-
setTenantFileContentStore
public void setTenantFileContentStore(org.alfresco.repo.content.ContentStore tenantFileContentStore)
-
setWorkflowService
public void setWorkflowService(WorkflowService workflowService)
-
setRepositoryExporterService
public void setRepositoryExporterService(RepositoryExporterService repositoryExporterService)
-
setWorkflowDeployer
public void setWorkflowDeployer(WorkflowDeployer workflowDeployer)
Deprecated.see setWorkflowDeployers
-
setModuleService
public void setModuleService(ModuleService moduleService)
-
setThumbnailRegistry
public void setThumbnailRegistry(ThumbnailRegistry thumbnailRegistry)
-
setBaseAdminUsername
public void setBaseAdminUsername(java.lang.String baseAdminUsername)
-
setTenantRoutingDataSource
public void setTenantRoutingDataSource(TenantRoutingDataSource trds)
-
setContentRootContainerPath
public void setContentRootContainerPath(java.lang.String contentRootContainerPath)
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
startTenants
public void startTenants()
- Specified by:
startTenantsin interfaceTenantAdminService
-
stopTenants
public void stopTenants()
- Specified by:
stopTenantsin interfaceTenantAdminService
-
createTenant
public void createTenant(java.lang.String tenantDomain, char[] tenantAdminRawPassword)- Specified by:
createTenantin interfaceTenantAdminService
-
createTenant
public void createTenant(java.lang.String tenantDomain, char[] tenantAdminRawPassword, java.lang.String contentRoot)- Specified by:
createTenantin interfaceTenantAdminService
-
createTenant
public void createTenant(java.lang.String tenantDomainIn, char[] tenantAdminRawPassword, java.lang.String contentRootPath, java.lang.String dbUrl)- Specified by:
createTenantin interfaceTenantAdminService
-
exportTenant
public void exportTenant(java.lang.String tenantDomainIn, java.io.File directoryDestination)Export tenant - equivalent to the tenant admin running a 'complete repo' export from the Web Client Admin- Specified by:
exportTenantin interfaceTenantAdminService
-
importTenant
public void importTenant(java.lang.String tenantDomainIn, java.io.File directorySource, java.lang.String contentRoot)Create tenant by restoring from a complete repository export. This is equivalent to a bootstrap import using restore-context.xml.- Specified by:
importTenantin interfaceTenantAdminService
-
existsTenant
public boolean existsTenant(java.lang.String tenantDomain)
- Specified by:
existsTenantin interfaceTenantAdminService
-
enableTenant
public void enableTenant(java.lang.String tenantDomain)
- Specified by:
enableTenantin interfaceTenantAdminService
-
notifyAfterEnableTenant
protected void notifyAfterEnableTenant(java.lang.String tenantDomain)
Call allTenantDeployersas the system tenant.
-
disableTenant
public void disableTenant(java.lang.String tenantDomain)
- Specified by:
disableTenantin interfaceTenantAdminService
-
isEnabledTenant
public boolean isEnabledTenant(java.lang.String tenantDomain)
- Specified by:
isEnabledTenantin interfaceTenantAdminService
-
getTenant
public org.alfresco.repo.tenant.Tenant getTenant(java.lang.String tenantDomain)
- Specified by:
getTenantin interfaceTenantAdminService
-
deleteTenant
public void deleteTenant(java.lang.String tenantDomain)
- Specified by:
deleteTenantin interfaceTenantAdminService
-
getAllTenants
@Deprecated public java.util.List<org.alfresco.repo.tenant.Tenant> getAllTenants()
Deprecated.- Specified by:
getAllTenantsin interfaceTenantAdminService- Returns:
- a list of all tenants regardless of state
-
getTenants
@Deprecated public java.util.List<org.alfresco.repo.tenant.Tenant> getTenants(boolean enabledOnly)
Deprecated.Description copied from interface:TenantAdminServiceRetrieve all tenants- Specified by:
getTenantsin interfaceTenantAdminService- Parameters:
enabledOnly- true to retrieve only active tenants- Returns:
- tenants, either active or all
-
deployTenants
public void deployTenants(org.alfresco.repo.tenant.TenantDeployer deployer, org.apache.commons.logging.Log logger)- Specified by:
deployTenantsin interfaceTenantAdminService
-
undeployTenants
public void undeployTenants(org.alfresco.repo.tenant.TenantDeployer deployer, org.apache.commons.logging.Log logger)- Specified by:
undeployTenantsin interfaceTenantAdminService
-
register
public void register(org.alfresco.repo.tenant.TenantDeployer deployer)
- Specified by:
registerin interfaceTenantAdminService
-
unregister
public void unregister(org.alfresco.repo.tenant.TenantDeployer deployer)
- Specified by:
unregisterin interfaceTenantAdminService
-
register
public void register(WorkflowDeployer workflowDeployer)
- Specified by:
registerin interfaceTenantAdminService
-
tenantRoutingContentStore
protected TenantRoutingContentStore tenantRoutingContentStore(org.alfresco.repo.content.ContentStore contentStore)
-
isTenantRoutingContentStore
protected boolean isTenantRoutingContentStore(org.alfresco.repo.content.ContentStore contentStore)
-
tenantDeployer
protected org.alfresco.repo.tenant.TenantDeployer tenantDeployer(org.alfresco.repo.content.ContentStore contentStore)
-
isTenantDeployer
protected boolean isTenantDeployer(org.alfresco.repo.content.ContentStore contentStore)
-
validateTenantName
protected void validateTenantName(java.lang.String tenantDomain)
- See Also:
MAX_LEN,REGEX_CONTAINS_ALPHA,REGEX_VALID_DNS_LABEL
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin interfaceorg.alfresco.repo.tenant.TenantUserService
-
getCurrentUserDomain
public java.lang.String getCurrentUserDomain()
- Specified by:
getCurrentUserDomainin interfaceorg.alfresco.repo.tenant.TenantUserService
-
getUserDomain
public java.lang.String getUserDomain(java.lang.String username)
- Specified by:
getUserDomainin interfaceorg.alfresco.repo.tenant.TenantUserService
-
getBaseNameUser
public java.lang.String getBaseNameUser(java.lang.String username)
- Specified by:
getBaseNameUserin interfaceorg.alfresco.repo.tenant.TenantUserService
-
getDomainUser
public java.lang.String getDomainUser(java.lang.String baseUsername, java.lang.String tenantDomain)- Specified by:
getDomainUserin interfaceorg.alfresco.repo.tenant.TenantUserService
-
getTenantDomain
protected java.lang.String getTenantDomain(java.lang.String tenantDomain)
Do a null check and convert tenant domain to lowercase
-
-