org.glassfish.paas.tenantmanager.impl
Class TenantManagerImpl

java.lang.Object
  extended by org.glassfish.paas.tenantmanager.impl.TenantManagerImpl
All Implemented Interfaces:
TenantManager, TenantManagerEx

@Service
public class TenantManagerImpl
extends Object
implements TenantManagerEx

Default implementation for TenantManagerEx.

Author:
Andriy Zhdanov

Constructor Summary
TenantManagerImpl()
           
 
Method Summary
 Tenant create(String name, String adminUserName)
          Creates new tenant.
 void delete(String name)
          Deletes tenant.
 Object excuteUpdate(org.jvnet.hk2.config.ConfigCode configCode, org.jvnet.hk2.config.ConfigBeanProxy... objects)
          Executes code on objects protected by a transaction.
<T extends org.jvnet.hk2.config.ConfigBeanProxy>
Object
executeUpdate(org.jvnet.hk2.config.SingleConfigCode<T> code, T param)
          Executes code on object protected by a transaction.
<T> T
get(Class<T> config)
          Get current tenant specific information.
 String getCurrentTenant()
          Get current tenant.
 TenantManagerConfig getTenantManagerConfig()
          Helper method for zero- tenant-manager -config.
 void setCurrentTenant(String name)
          Get current tenant.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TenantManagerImpl

public TenantManagerImpl()
Method Detail

get

public <T> T get(Class<T> config)
Get current tenant specific information. It is possible to get relevant top level configuration, like Tenant, Environments and Services.

Specified by:
get in interface TenantManager
Parameters:
config - Config class.
Returns:
Config.

executeUpdate

public <T extends org.jvnet.hk2.config.ConfigBeanProxy> Object executeUpdate(org.jvnet.hk2.config.SingleConfigCode<T> code,
                                                                             T param)
                     throws org.jvnet.hk2.config.TransactionFailure
Executes code on object protected by a transaction. It is wrapper to ConfigBeanSupport.apply and ensures restricted access to tenant information as whole.

Specified by:
executeUpdate in interface TenantManager
Returns:
Throws:
org.jvnet.hk2.config.TransactionFailure

excuteUpdate

public Object excuteUpdate(org.jvnet.hk2.config.ConfigCode configCode,
                           org.jvnet.hk2.config.ConfigBeanProxy... objects)
                    throws org.jvnet.hk2.config.TransactionFailure
Executes code on objects protected by a transaction. It is wrapper to ConfigBeanSupport.apply and ensures restricted access to tenant information as whole.

Specified by:
excuteUpdate in interface TenantManager
objects - configurations
Returns:
Throws:
org.jvnet.hk2.config.TransactionFailure

getCurrentTenant

public String getCurrentTenant()
Get current tenant.

Specified by:
getCurrentTenant in interface TenantManager

setCurrentTenant

public void setCurrentTenant(String name)
Get current tenant.

Specified by:
setCurrentTenant in interface TenantManager

create

public Tenant create(String name,
                     String adminUserName)
Creates new tenant.

Specified by:
create in interface TenantManagerEx
Parameters:
name - Tenant name.
adminUserName - default administrator name.
Returns:
new Tenant.

delete

public void delete(String name)
Deletes tenant.

Specified by:
delete in interface TenantManagerEx

getTenantManagerConfig

public TenantManagerConfig getTenantManagerConfig()
Helper method for zero- tenant-manager -config.

Specified by:
getTenantManagerConfig in interface TenantManagerEx
Returns:
TenantManagerConfig created or existing


Copyright © 2012. All Rights Reserved.