Class SessionCachingMetadataDomainRepository

java.lang.Object
org.pentaho.platform.plugin.services.metadata.SessionCachingMetadataDomainRepository
All Implemented Interfaces:
org.pentaho.metadata.repository.IMetadataDomainRepository, org.pentaho.platform.api.engine.ILogoutListener, IAclAwarePentahoMetadataDomainRepositoryImporter, IDataSourceAwareMetadataDomainRepository, IModelAnnotationsAwareMetadataDomainRepositoryImporter, IPentahoMetadataDomainRepositoryExporter, IPentahoMetadataDomainRepositoryImporter

public class SessionCachingMetadataDomainRepository extends Object implements org.pentaho.metadata.repository.IMetadataDomainRepository, IPentahoMetadataDomainRepositoryExporter, org.pentaho.platform.api.engine.ILogoutListener, IAclAwarePentahoMetadataDomainRepositoryImporter, IModelAnnotationsAwareMetadataDomainRepositoryImporter, IDataSourceAwareMetadataDomainRepository
This is the platform implementation which provides session-based caching for an existing IMetadataDomainRepository.
Author:
Jordan Ganoff (jganoff@pentaho.com)
  • Field Details

  • Constructor Details

    • SessionCachingMetadataDomainRepository

      public SessionCachingMetadataDomainRepository(org.pentaho.metadata.repository.IMetadataDomainRepository delegate)
      Wraps the provided domain repository to provide session-based caching of domains.
    • SessionCachingMetadataDomainRepository

      public SessionCachingMetadataDomainRepository(org.pentaho.metadata.repository.IMetadataDomainRepository delegate, org.pentaho.platform.api.engine.ICacheManager cacheManager, boolean domainIdsCacheEnabled, int numberOfThreads)
  • Method Details

    • forAllKeys

      Calls the callback for every key in the cache region
      Parameters:
      callback -
    • forAllKeysInSession

      protected void forAllKeysInSession(org.pentaho.platform.api.engine.IPentahoSession session, SessionCachingMetadataDomainRepository.CacheIteratorCallback callback)
      Calls the callback for every key in the cache region whose session id matches the provided session's id.
      Parameters:
      session - Session to use for matching keys
      callback -
    • getDomain

      public org.pentaho.metadata.model.Domain getDomain(String id)
      Specified by:
      getDomain in interface org.pentaho.metadata.repository.IMetadataDomainRepository
    • reloadDomains

      public void reloadDomains()
      Specified by:
      reloadDomains in interface org.pentaho.metadata.repository.IMetadataDomainRepository
    • flushDomains

      public void flushDomains()
      Specified by:
      flushDomains in interface org.pentaho.metadata.repository.IMetadataDomainRepository
    • flushDomains

      protected void flushDomains(org.pentaho.platform.api.engine.IPentahoSession session)
    • clearDomainIdsFromCache

      protected void clearDomainIdsFromCache()
      Remove domain ID cache for all sessions
    • clearDomainIdsFromCache

      protected void clearDomainIdsFromCache(org.pentaho.platform.api.engine.IPentahoSession session)
      Remove domain ID cache for a given session
      Parameters:
      session -
    • generateDomainIdCacheKeyForSession

      protected String generateDomainIdCacheKeyForSession(org.pentaho.platform.api.engine.IPentahoSession session)
      Create caching key String using session. DOMAIN_CACHE_KEY_PREDICATE and IPentahoSession.getId() are used in key creation.
      Parameters:
      session -
      Returns:
    • generateDomainIdCacheKeyForSession

      protected String generateDomainIdCacheKeyForSession(org.pentaho.platform.api.engine.IPentahoSession session, String type)
      Create caching key String using session and type. DOMAIN_CACHE_KEY_PREDICATE, IPentahoSession.getId() and type are used in key creation.
      Parameters:
      session -
      type -
      Returns:
    • removeDomain

      public void removeDomain(String domainId)
      Specified by:
      removeDomain in interface org.pentaho.metadata.repository.IMetadataDomainRepository
      Specified by:
      removeDomain in interface IPentahoMetadataDomainRepositoryImporter
    • storeDomain

      public void storeDomain(org.pentaho.metadata.model.Domain domain, boolean overwrite) throws org.pentaho.metadata.repository.DomainIdNullException, org.pentaho.metadata.repository.DomainAlreadyExistsException, org.pentaho.metadata.repository.DomainStorageException
      Specified by:
      storeDomain in interface org.pentaho.metadata.repository.IMetadataDomainRepository
      Throws:
      org.pentaho.metadata.repository.DomainIdNullException
      org.pentaho.metadata.repository.DomainAlreadyExistsException
      org.pentaho.metadata.repository.DomainStorageException
    • removeModel

      public void removeModel(String domainId, String modelId) throws org.pentaho.metadata.repository.DomainIdNullException, org.pentaho.metadata.repository.DomainStorageException
      Specified by:
      removeModel in interface org.pentaho.metadata.repository.IMetadataDomainRepository
      Throws:
      org.pentaho.metadata.repository.DomainIdNullException
      org.pentaho.metadata.repository.DomainStorageException
    • getDomainIds

      public Set<String> getDomainIds()
      Specified by:
      getDomainIds in interface org.pentaho.metadata.repository.IMetadataDomainRepository
    • getMetadataDomainIds

      public Set<String> getMetadataDomainIds()
      Description copied from interface: IDataSourceAwareMetadataDomainRepository
      Retrieve a list of all the domain ids in the repository of the data source type Metadata. See IMetadataDomainRepository.getDomainIds() for similar functionality.
      Specified by:
      getMetadataDomainIds in interface IDataSourceAwareMetadataDomainRepository
      Returns:
      the metadata domain Ids.
    • getDataSourceWizardDomainIds

      public Set<String> getDataSourceWizardDomainIds()
      Description copied from interface: IDataSourceAwareMetadataDomainRepository
      Retrieve a list of all the domain ids in the repository of the data source type DataSourceWizard. See IMetadataDomainRepository.getDomainIds() for similar functionality.
      Specified by:
      getDataSourceWizardDomainIds in interface IDataSourceAwareMetadataDomainRepository
      Returns:
      the data source wizard domain Ids.
    • generateRowLevelSecurityConstraint

      public String generateRowLevelSecurityConstraint(org.pentaho.metadata.model.LogicalModel model)
      Specified by:
      generateRowLevelSecurityConstraint in interface org.pentaho.metadata.repository.IMetadataDomainRepository
    • hasAccess

      public boolean hasAccess(int accessType, org.pentaho.metadata.model.concept.IConcept aclHolder)
      Specified by:
      hasAccess in interface org.pentaho.metadata.repository.IMetadataDomainRepository
    • onLogout

      public void onLogout(org.pentaho.platform.api.engine.IPentahoSession session)
      Specified by:
      onLogout in interface org.pentaho.platform.api.engine.ILogoutListener
    • getDomainFilesData

      public Map<String,InputStream> getDomainFilesData(String domainId)
      Specified by:
      getDomainFilesData in interface IPentahoMetadataDomainRepositoryExporter
    • storeDomain

      public void storeDomain(InputStream inputStream, String domainId, boolean overwrite, org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl) throws org.pentaho.metadata.repository.DomainIdNullException, org.pentaho.metadata.repository.DomainAlreadyExistsException, org.pentaho.metadata.repository.DomainStorageException
      Specified by:
      storeDomain in interface IAclAwarePentahoMetadataDomainRepositoryImporter
      Throws:
      org.pentaho.metadata.repository.DomainIdNullException
      org.pentaho.metadata.repository.DomainAlreadyExistsException
      org.pentaho.metadata.repository.DomainStorageException
    • setAclFor

      public void setAclFor(String domainId, org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl)
      Specified by:
      setAclFor in interface IAclAwarePentahoMetadataDomainRepositoryImporter
    • getAclFor

      public org.pentaho.platform.api.repository2.unified.RepositoryFileAcl getAclFor(String domainId)
      Specified by:
      getAclFor in interface IAclAwarePentahoMetadataDomainRepositoryImporter
    • hasAccessFor

      public boolean hasAccessFor(String domainId)
      Specified by:
      hasAccessFor in interface IAclAwarePentahoMetadataDomainRepositoryImporter
    • storeDomain

      public void storeDomain(InputStream inputStream, String domainId, boolean overwrite) throws org.pentaho.metadata.repository.DomainIdNullException, org.pentaho.metadata.repository.DomainAlreadyExistsException, org.pentaho.metadata.repository.DomainStorageException
      Specified by:
      storeDomain in interface IPentahoMetadataDomainRepositoryImporter
      Throws:
      org.pentaho.metadata.repository.DomainIdNullException
      org.pentaho.metadata.repository.DomainAlreadyExistsException
      org.pentaho.metadata.repository.DomainStorageException
    • addLocalizationFile

      public void addLocalizationFile(String domainId, String locale, InputStream inputStream, boolean overwrite) throws org.pentaho.metadata.repository.DomainStorageException
      Specified by:
      addLocalizationFile in interface IPentahoMetadataDomainRepositoryImporter
      Throws:
      org.pentaho.metadata.repository.DomainStorageException
    • loadAnnotationsXml

      public String loadAnnotationsXml(String domainId)
      Specified by:
      loadAnnotationsXml in interface IModelAnnotationsAwareMetadataDomainRepositoryImporter
    • storeAnnotationsXml

      public void storeAnnotationsXml(String domainId, String annotationsXml)
      Specified by:
      storeAnnotationsXml in interface IModelAnnotationsAwareMetadataDomainRepositoryImporter