public class PentahoMetadataDomainRepository extends Object implements org.pentaho.metadata.repository.IMetadataDomainRepository, IPentahoMetadataDomainRepositoryImporter, 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).
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 |
flushDomains()
flush the domains from memory
|
String |
generateRowLevelSecurityConstraint(org.pentaho.metadata.model.LogicalModel model) |
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.
|
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 |
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
|
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 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