org.pentaho.platform.plugin.services.metadata
Class SessionCachingMetadataDomainRepository

java.lang.Object
  extended by org.pentaho.platform.plugin.services.metadata.SessionCachingMetadataDomainRepository
All Implemented Interfaces:
org.pentaho.metadata.repository.IMetadataDomainRepository, ILogoutListener

public class SessionCachingMetadataDomainRepository
extends Object
implements org.pentaho.metadata.repository.IMetadataDomainRepository, ILogoutListener

This is the platform implementation which provides session-based caching for an existing IMetadataDomainRepository.

Author:
Jordan Ganoff (jganoff@pentaho.com)

Nested Class Summary
static class SessionCachingMetadataDomainRepository.CacheKey
          this as a public class so that if necessary someone can get access to a session key and clear the cache in their own way via javascript rule / etc
 
Field Summary
static String CACHE_REGION
          Public so others know where we're caching our objects
 
Fields inherited from interface org.pentaho.metadata.repository.IMetadataDomainRepository
ACCESS_TYPE_ADMIN, ACCESS_TYPE_DELETE, ACCESS_TYPE_READ, ACCESS_TYPE_SCHEMA_ADMIN, ACCESS_TYPE_UPDATE, ACCESS_TYPE_WRITE
 
Constructor Summary
SessionCachingMetadataDomainRepository(org.pentaho.metadata.repository.IMetadataDomainRepository delegate)
          Wraps the provided domain repository to provide session-based caching of domains.
 
Method Summary
 void flushDomains()
           
 String generateRowLevelSecurityConstraint(org.pentaho.metadata.model.LogicalModel model)
           
 org.pentaho.metadata.model.Domain getDomain(String id)
           
 Set<String> getDomainIds()
           
 boolean hasAccess(int accessType, org.pentaho.metadata.model.concept.IConcept aclHolder)
           
 void onLogout(IPentahoSession session)
           
 void reloadDomains()
           
 void removeDomain(String domainId)
           
 void removeModel(String domainId, String modelId)
           
 void storeDomain(org.pentaho.metadata.model.Domain domain, boolean overwrite)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_REGION

public static String CACHE_REGION
Public so others know where we're caching our objects

Constructor Detail

SessionCachingMetadataDomainRepository

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

Method Detail

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

removeDomain

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

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

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(IPentahoSession session)
Specified by:
onLogout in interface ILogoutListener
Parameters:
session - Performs any logout actions based on this session.