Package org.apache.sling.tenant.spi

# Interface TenantManagerHook

@ConsumerType public interface TenantManagerHook
This is a service interface to customize tenant setup and administration. Tools can hook into the tenant creation, changing a tenant and removing thereof by implementing this interface.

Since:
  1.1

## Method Summary

Modifier and Type
Method
Description
`Map<String,Object>`
`change(Tenant tenant)`
Method called to update the given tenant.
`void`
`remove(Tenant tenant)`
Called to remove the setup for the given Tenant.
`Map<String,Object>`
`setup(Tenant tenant)`
Method called to create the given tenant.

## Method Details

### setup

Map<String,Object> setup(Tenant tenant)
Method called to create the given tenant. The method may return additional properties to be added to the Tenant's property list.

This method is not expected to throw an exception. Any exception thrown is logged but otherwise ignored.

Parameters:
  `tenant` - The `Tenant` to be configured by this call
Returns:
  Additional properties to be added to the tenant. These properties may later be accessed through the tenant's property accessor methods. `null` or an empty map may be returned to not add properties.

### change

Map<String,Object> change(Tenant tenant)
Method called to update the given tenant. The method may return additional properties to be added to the Tenant's property list.

This method is not expected to throw an exception. Any exception thrown is logged but otherwise ignored.

Parameters:
  `tenant` - The `Tenant` to be configured by this call
Returns:
  Additional properties to be added to the tenant. These properties may later be accessed through the tenant's property accessor methods. `null` or an empty map may be returned to not add properties.

### remove

void remove(Tenant tenant)
Called to remove the setup for the given Tenant. This reverts all changes done by the #setup method.

This method is not expected to throw an exception. Any exception thrown is logged but otherwise ignored.

Parameters:
  `tenant` - The `Tenant` about to be removed