public class PentahoMetadataDomainRepository extends Object implements org.pentaho.metadata.repository.IMetadataDomainRepository, IModelAnnotationsAwareMetadataDomainRepositoryImporter, IAclAwarePentahoMetadataDomainRepositoryImporter, IPentahoMetadataDomainRepositoryExporter
PentahoMetadataDomainRepositoryInfo
) as the storage location for the
Domain files and associated locale files. Since Domain IDs are the unique identifier for Pentaho Metadata
domains and may contain any character (including repository folder separator character(s) like '/', a UUID
will be created to store each file. The metadata for the file will be used to store the information (such as the
Domain ID). 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 |
---|
PentahoMetadataDomainRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository)
Creates an instance of this class providing the
IUnifiedRepository repository backend. |
Modifier and Type | Method and Description |
---|---|
void |
addLocalizationFile(String domainId,
String locale,
InputStream inputStream,
boolean overwrite) |
void |
addLocalizationFile(String domainId,
String locale,
Properties properties)
Adds a set of properties as a locale properties file for the specified Domain ID
|
void |
createOrUpdateAnnotationsXml(org.pentaho.platform.api.repository2.unified.RepositoryFile domainFile,
org.pentaho.platform.api.repository2.unified.RepositoryFile annotationsFile,
String annotationsXml) |
void |
flushDomains()
flush the domains from memory
|
String |
generateRowLevelSecurityConstraint(org.pentaho.metadata.model.LogicalModel model) |
org.pentaho.platform.api.repository2.unified.RepositoryFileAcl |
getAclFor(String domainId) |
org.pentaho.platform.api.repository2.unified.RepositoryFile |
getAnnotationsXmlFile(org.pentaho.platform.api.repository2.unified.RepositoryFile domainFile) |
org.pentaho.metadata.model.Domain |
getDomain(String domainId)
retrieve a domain from the repo.
|
Map<String,InputStream> |
getDomainFilesData(String domainId) |
Set<String> |
getDomainIds()
return a list of all the domain ids in the repository.
|
boolean |
hasAccess(int accessType,
org.pentaho.metadata.model.concept.IConcept aclHolder)
The aclHolder cannot be null unless the access type requested is ACCESS_TYPE_SCHEMA_ADMIN.
|
boolean |
hasAccessFor(String domainId) |
String |
loadAnnotationsXml(String domainId) |
void |
reloadDomains()
reload domains from disk
|
void |
removeDomain(String domainId)
remove a domain from disk and memory.
|
void |
removeModel(String domainId,
String modelId)
remove a model from a domain which is stored either on a disk or memory.
|
void |
setAclFor(String domainId,
org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl) |
void |
storeAnnotationsXml(String domainId,
String annotationsXml) |
void |
storeDomain(org.pentaho.metadata.model.Domain domain,
boolean overwrite)
Store a domain to the repository.
|
void |
storeDomain(InputStream inputStream,
String domainId,
boolean overwrite)
Stores a domain to the repository directly as an Input Stream
|
void |
storeDomain(InputStream inputStream,
String domainId,
boolean overwrite,
org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl) |
public PentahoMetadataDomainRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository)
IUnifiedRepository
repository backend.repository
- the IUnifiedRepository
in which data will be stored / retrievedpublic 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
domain
- domain object to storeoverwrite
- if true, overwrite existing domainorg.pentaho.metadata.repository.DomainIdNullException
- if domain id is null or emptyorg.pentaho.metadata.repository.DomainAlreadyExistsException
- if a domain with the same Domain ID already exists in the repository and
overwrite == false
org.pentaho.metadata.repository.DomainStorageException
- if there is a problem storing the domainpublic 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
inputStream
- domainId
- overwrite
- org.pentaho.metadata.repository.DomainIdNullException
org.pentaho.metadata.repository.DomainAlreadyExistsException
org.pentaho.metadata.repository.DomainStorageException
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
storeDomain
in interface IAclAwarePentahoMetadataDomainRepositoryImporter
org.pentaho.metadata.repository.DomainIdNullException
org.pentaho.metadata.repository.DomainAlreadyExistsException
org.pentaho.metadata.repository.DomainStorageException
public void setAclFor(String domainId, org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl)
setAclFor
in interface IAclAwarePentahoMetadataDomainRepositoryImporter
public org.pentaho.platform.api.repository2.unified.RepositoryFileAcl getAclFor(String domainId)
getAclFor
in interface IAclAwarePentahoMetadataDomainRepositoryImporter
public boolean hasAccessFor(String domainId)
hasAccessFor
in interface IAclAwarePentahoMetadataDomainRepositoryImporter
public Map<String,InputStream> getDomainFilesData(String domainId)
getDomainFilesData
in interface IPentahoMetadataDomainRepositoryExporter
public org.pentaho.metadata.model.Domain getDomain(String domainId)
getDomain
in interface org.pentaho.metadata.repository.IMetadataDomainRepository
domainId
- domain to get from the repositorypublic Set<String> getDomainIds()
getDomainIds
in interface org.pentaho.metadata.repository.IMetadataDomainRepository
public void removeDomain(String domainId)
removeDomain
in interface org.pentaho.metadata.repository.IMetadataDomainRepository
removeDomain
in interface IPentahoMetadataDomainRepositoryImporter
domainId
- 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
domainId
- modelId
- org.pentaho.metadata.repository.DomainIdNullException
org.pentaho.metadata.repository.DomainStorageException
public void reloadDomains()
reloadDomains
in interface org.pentaho.metadata.repository.IMetadataDomainRepository
public void flushDomains()
flushDomains
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 addLocalizationFile(String domainId, String locale, Properties properties) throws org.pentaho.metadata.repository.DomainStorageException
domainId
- the domain ID for which this properties file will be addedlocale
- the locale for which this properties file will be addedproperties
- the properties to be addedorg.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
public org.pentaho.platform.api.repository2.unified.RepositoryFile getAnnotationsXmlFile(org.pentaho.platform.api.repository2.unified.RepositoryFile domainFile)
public void createOrUpdateAnnotationsXml(org.pentaho.platform.api.repository2.unified.RepositoryFile domainFile, org.pentaho.platform.api.repository2.unified.RepositoryFile annotationsFile, String annotationsXml)