org.pentaho.platform.api.repository2.unified
Interface IBackingRepositoryLifecycleManager

All Known Implementing Classes:
AbstractBackingRepositoryLifecycleManager, DefaultBackingRepositoryLifecycleManager, DelegatingBackingRepositoryLifecycleManager, PdiBackingRepositoryLifecycleManager

public interface IBackingRepositoryLifecycleManager

Allows external code to do initialization work on the backing repository at certain lifecycle milestones. An example of a backing repository is JCR. Note that there is no code dependency between this interface and IUnifiedRepository. This interface is for code that initializes any backing repository.

Methods in this class must be called by an external caller (see example below). A caller can get a reference to the IBackingRepositoryLifecycleManager usingPentahoSystem. Methods should be able to be called more than once with the same arguments with no adverse effects.

Example: When a servlet-based application starts up, a ServletContextListener calls startup(). When a user logs in, newTenant(String) and #onNewUser(String) are called. Finally, the ServletContextListener calls shutdown().

This class is necessary since some implementations cannot observe logins. Example: JCR cannot observe logins--only node and property events.


Method Summary
 void newTenant()
          To be called before any users belonging to the current tenant interact with the backing repository.
 void newTenant(String tenantId)
          To be called before any users belonging to a particular tenant interact with the backing repository.
 void newUser()
          To be called before current user interacts with the backing repository.
 void newUser(String tenantId, String username)
          To be called before user indicated by username interacts with the backing repository.
 void shutdown()
          To be called on repository shutdown.
 void startup()
          To be called before any (non-admin) users interact with the backing repository.
 

Method Detail

startup

void startup()
To be called before any (non-admin) users interact with the backing repository.


shutdown

void shutdown()
To be called on repository shutdown.


newTenant

void newTenant(String tenantId)
To be called before any users belonging to a particular tenant interact with the backing repository.

Parameters:
tenantId - new tenant id

newTenant

void newTenant()
To be called before any users belonging to the current tenant interact with the backing repository.


newUser

void newUser(String tenantId,
             String username)
To be called before user indicated by username interacts with the backing repository.

Parameters:
tenantId - tenant to which the user belongs
username - new username

newUser

void newUser()
To be called before current user interacts with the backing repository.