Interface IBackingRepositoryLifecycleManager


  • 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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addMetadataToRepository​(String metadataProperty)  
      Boolean doesMetadataExists​(String metadataProperty)  
      void newTenant()
      To be called before any users belonging to the current tenant interact with the backing repository.
      void newTenant​(ITenant tenant)
      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​(ITenant tenant, 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​(ITenant tenant)
        To be called before any users belonging to a particular tenant interact with the backing repository.
        Parameters:
        new - Tenant
      • newTenant

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

        void newUser​(ITenant tenant,
                     String username)
        To be called before user indicated by username interacts with the backing repository.
        Parameters:
        tenant - to which the user belongs
        username - new username
      • newUser

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

        void addMetadataToRepository​(String metadataProperty)
      • doesMetadataExists

        Boolean doesMetadataExists​(String metadataProperty)