public class SessionCachingMetadataDomainRepository extends Object implements org.pentaho.metadata.repository.IMetadataDomainRepository, IPentahoMetadataDomainRepositoryExporter, ILogoutListener, IAclAwarePentahoMetadataDomainRepositoryImporter, IModelAnnotationsAwareMetadataDomainRepositoryImporter
IMetadataDomainRepository
.Modifier and Type | Class and Description |
---|---|
protected static interface |
SessionCachingMetadataDomainRepository.CacheIteratorCallback
Simple callback interface to facilitate iterating over cache keys
|
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
|
Modifier and Type | Field and Description |
---|---|
static String |
CACHE_REGION
Public so others know where we're caching our objects
|
protected SessionCachingMetadataDomainRepository.CacheIteratorCallback |
REMOVE_ALL_CALLBACK
Removes all keys it encounters from the known cache region
|
ACCESS_TYPE_ADMIN, ACCESS_TYPE_DELETE, ACCESS_TYPE_READ, ACCESS_TYPE_SCHEMA_ADMIN, ACCESS_TYPE_UPDATE, ACCESS_TYPE_WRITE
ANNOTATIONS_FILE_ID_POSTFIX, PROPERTY_NAME_ANNOTATIONS
Constructor and Description |
---|
SessionCachingMetadataDomainRepository(org.pentaho.metadata.repository.IMetadataDomainRepository delegate)
Wraps the provided domain repository to provide session-based caching of domains.
|
Modifier and Type | Method and Description |
---|---|
void |
addLocalizationFile(String domainId,
String locale,
InputStream inputStream,
boolean overwrite) |
protected void |
clearDomainIdsFromCache()
Remove domain ID cache for all sessions
|
protected void |
clearDomainIdsFromCache(IPentahoSession session)
Remove domain ID cache for a given session
|
void |
flushDomains() |
protected void |
flushDomains(IPentahoSession session) |
protected void |
forAllKeys(SessionCachingMetadataDomainRepository.CacheIteratorCallback callback)
Calls the callback for every key in the cache region
|
protected void |
forAllKeysInSession(IPentahoSession session,
SessionCachingMetadataDomainRepository.CacheIteratorCallback callback)
Calls the callback for every key in the cache region whose session id matches the provided session's id.
|
protected String |
generateDomainIdCacheKeyForSession(IPentahoSession session) |
String |
generateRowLevelSecurityConstraint(org.pentaho.metadata.model.LogicalModel model) |
RepositoryFileAcl |
getAclFor(String domainId) |
org.pentaho.metadata.model.Domain |
getDomain(String id) |
Map<String,InputStream> |
getDomainFilesData(String domainId) |
Set<String> |
getDomainIds() |
boolean |
hasAccess(int accessType,
org.pentaho.metadata.model.concept.IConcept aclHolder) |
boolean |
hasAccessFor(String domainId) |
String |
loadAnnotationsXml(String domainId) |
void |
onLogout(IPentahoSession session) |
void |
reloadDomains() |
void |
removeDomain(String domainId) |
void |
removeModel(String domainId,
String modelId) |
void |
setAclFor(String domainId,
RepositoryFileAcl acl) |
void |
storeAnnotationsXml(String domainId,
String annotationsXml) |
void |
storeDomain(org.pentaho.metadata.model.Domain domain,
boolean overwrite) |
void |
storeDomain(InputStream inputStream,
String domainId,
boolean overwrite) |
void |
storeDomain(InputStream inputStream,
String domainId,
boolean overwrite,
RepositoryFileAcl acl) |
public static String CACHE_REGION
protected final SessionCachingMetadataDomainRepository.CacheIteratorCallback REMOVE_ALL_CALLBACK
public SessionCachingMetadataDomainRepository(org.pentaho.metadata.repository.IMetadataDomainRepository delegate)
protected void forAllKeys(SessionCachingMetadataDomainRepository.CacheIteratorCallback callback)
callback
- CacheCallback
protected void forAllKeysInSession(IPentahoSession session, SessionCachingMetadataDomainRepository.CacheIteratorCallback callback)
session
- Session to use for matching keyscallback
- CacheCallback
public org.pentaho.metadata.model.Domain getDomain(String id)
getDomain
in interface org.pentaho.metadata.repository.IMetadataDomainRepository
public void reloadDomains()
reloadDomains
in interface org.pentaho.metadata.repository.IMetadataDomainRepository
public void flushDomains()
flushDomains
in interface org.pentaho.metadata.repository.IMetadataDomainRepository
protected void flushDomains(IPentahoSession session)
protected void clearDomainIdsFromCache()
protected void clearDomainIdsFromCache(IPentahoSession session)
session
- protected String generateDomainIdCacheKeyForSession(IPentahoSession session)
public void removeDomain(String domainId)
removeDomain
in interface org.pentaho.metadata.repository.IMetadataDomainRepository
removeDomain
in interface IPentahoMetadataDomainRepositoryImporter
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
storeDomain
in interface org.pentaho.metadata.repository.IMetadataDomainRepository
org.pentaho.metadata.repository.DomainIdNullException
org.pentaho.metadata.repository.DomainAlreadyExistsException
org.pentaho.metadata.repository.DomainStorageException
public void removeModel(String domainId, String modelId) throws org.pentaho.metadata.repository.DomainIdNullException, org.pentaho.metadata.repository.DomainStorageException
removeModel
in interface org.pentaho.metadata.repository.IMetadataDomainRepository
org.pentaho.metadata.repository.DomainIdNullException
org.pentaho.metadata.repository.DomainStorageException
public Set<String> getDomainIds()
getDomainIds
in interface org.pentaho.metadata.repository.IMetadataDomainRepository
public String generateRowLevelSecurityConstraint(org.pentaho.metadata.model.LogicalModel model)
generateRowLevelSecurityConstraint
in interface org.pentaho.metadata.repository.IMetadataDomainRepository
public boolean hasAccess(int accessType, org.pentaho.metadata.model.concept.IConcept aclHolder)
hasAccess
in interface org.pentaho.metadata.repository.IMetadataDomainRepository
public void onLogout(IPentahoSession session)
onLogout
in interface ILogoutListener
public Map<String,InputStream> getDomainFilesData(String domainId)
getDomainFilesData
in interface IPentahoMetadataDomainRepositoryExporter
public void storeDomain(InputStream inputStream, String domainId, boolean overwrite, RepositoryFileAcl acl) throws org.pentaho.metadata.repository.DomainIdNullException, org.pentaho.metadata.repository.DomainAlreadyExistsException, org.pentaho.metadata.repository.DomainStorageException
storeDomain
in interface IAclAwarePentahoMetadataDomainRepositoryImporter
org.pentaho.metadata.repository.DomainIdNullException
org.pentaho.metadata.repository.DomainAlreadyExistsException
org.pentaho.metadata.repository.DomainStorageException
public void setAclFor(String domainId, RepositoryFileAcl acl)
setAclFor
in interface IAclAwarePentahoMetadataDomainRepositoryImporter
public RepositoryFileAcl getAclFor(String domainId)
getAclFor
in interface IAclAwarePentahoMetadataDomainRepositoryImporter
public boolean hasAccessFor(String domainId)
hasAccessFor
in interface IAclAwarePentahoMetadataDomainRepositoryImporter
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
storeDomain
in interface IPentahoMetadataDomainRepositoryImporter
org.pentaho.metadata.repository.DomainIdNullException
org.pentaho.metadata.repository.DomainAlreadyExistsException
org.pentaho.metadata.repository.DomainStorageException
public void addLocalizationFile(String domainId, String locale, InputStream inputStream, boolean overwrite) throws org.pentaho.metadata.repository.DomainStorageException
addLocalizationFile
in interface IPentahoMetadataDomainRepositoryImporter
org.pentaho.metadata.repository.DomainStorageException
public String loadAnnotationsXml(String domainId)
loadAnnotationsXml
in interface IModelAnnotationsAwareMetadataDomainRepositoryImporter
public void storeAnnotationsXml(String domainId, String annotationsXml)
storeAnnotationsXml
in interface IModelAnnotationsAwareMetadataDomainRepositoryImporter
Copyright © 2017 Hitachi Vantara. All rights reserved.