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_WRITEANNOTATIONS_FILE_ID_POSTFIX, PROPERTY_NAME_ANNOTATIONS| Modifier | Constructor and Description |
|---|---|
|
PentahoMetadataDomainRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository)
Creates an instance of this class providing the
IUnifiedRepository repository backend. |
protected |
PentahoMetadataDomainRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository,
org.pentaho.platform.repository2.unified.RepositoryUtils repositoryUtils,
org.pentaho.metadata.util.XmiParser xmiParser,
org.pentaho.metadata.util.LocalizationUtil localizationUtil)
Helper constructor used for setting other objects in this class
|
| 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) |
protected org.pentaho.platform.api.repository2.unified.RepositoryFile |
createUniqueFile(String domainId,
String locale,
org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData data)
Creates a new repository file (with the supplied data) and applies the proper metadata to this file.
|
protected String |
endsWithXmi(String value) |
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) |
protected org.pentaho.platform.api.repository2.unified.IAclNodeHelper |
getAclHelper() |
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) |
protected String |
getDomainIdFromXmi(StringBuilder sb) |
Set<String> |
getDomainIds()
return a list of all the domain ids in the repository.
|
protected org.pentaho.metadata.util.LocalizationUtil |
getLocalizationUtil() |
protected org.apache.commons.logging.Log |
getLogger() |
protected org.pentaho.platform.api.repository2.unified.RepositoryFile |
getMetadataDir() |
protected org.pentaho.platform.api.repository2.unified.RepositoryFile |
getMetadataRepositoryFile(String domainId)
Accesses the metadata mapping (with 1 retry) to find the metadata file for the specified domainId
|
protected org.pentaho.platform.api.repository2.unified.IUnifiedRepository |
getRepository() |
protected org.pentaho.platform.repository2.unified.RepositoryUtils |
getRepositoryUtils() |
protected org.pentaho.metadata.util.XmiParser |
getXmiParser() |
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) |
protected boolean |
isDomainIdXmiEqualsOrNotPresent(String domainId,
String domainIdXmi) |
String |
loadAnnotationsXml(String domainId) |
protected void |
loadLocaleStrings(String domainId,
org.pentaho.metadata.model.Domain domain) |
protected Properties |
loadProperties(org.pentaho.platform.api.repository2.unified.RepositoryFile bundle) |
protected String |
noXmi(String value) |
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.
|
protected String |
replaceDomainId(StringBuilder sb,
String domainId) |
protected String |
resolveAnnotationsFilePath(org.pentaho.platform.api.repository2.unified.RepositoryFile domainFile) |
void |
setAclFor(String domainId,
org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl) |
protected void |
setLocalizationUtil(org.pentaho.metadata.util.LocalizationUtil localizationUtil) |
protected void |
setRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository) |
protected void |
setRepositoryUtils(org.pentaho.platform.repository2.unified.RepositoryUtils repositoryUtils) |
protected void |
setXmiParser(org.pentaho.metadata.util.XmiParser xmiParser) |
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) |
protected String |
toString(org.pentaho.platform.api.repository2.unified.RepositoryFile file) |
public PentahoMetadataDomainRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository)
IUnifiedRepository repository backend.repository - the IUnifiedRepository in which data will be stored / retrievedprotected PentahoMetadataDomainRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository,
org.pentaho.platform.repository2.unified.RepositoryUtils repositoryUtils,
org.pentaho.metadata.util.XmiParser xmiParser,
org.pentaho.metadata.util.LocalizationUtil localizationUtil)
repository - the IUnifiedRepository in which data will be stored / retrievedrepositoryUtils - utility class for working inside the repository (NOTE: null is acceptable and
will create a default instance)xmiParser - the parser class for serializing / de-serializing Domain objects (NOTE: null
is acceptable and will create a default instance)localizationUtil - the object used to add locale bundles into a Pentaho Metadata Domain object (NOTE:
null is acceptable and will create a default instance)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.IMetadataDomainRepositorydomain - 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 == falseorg.pentaho.metadata.repository.DomainStorageException - if there is a problem storing the domainprotected String replaceDomainId(StringBuilder sb, String domainId)
protected String getDomainIdFromXmi(StringBuilder sb)
protected boolean isDomainIdXmiEqualsOrNotPresent(String domainId, String domainIdXmi)
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 IPentahoMetadataDomainRepositoryImporterinputStream - domainId - overwrite - org.pentaho.metadata.repository.DomainIdNullExceptionorg.pentaho.metadata.repository.DomainAlreadyExistsExceptionorg.pentaho.metadata.repository.DomainStorageExceptionpublic 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 IAclAwarePentahoMetadataDomainRepositoryImporterorg.pentaho.metadata.repository.DomainIdNullExceptionorg.pentaho.metadata.repository.DomainAlreadyExistsExceptionorg.pentaho.metadata.repository.DomainStorageExceptionprotected org.pentaho.platform.api.repository2.unified.IAclNodeHelper getAclHelper()
public void setAclFor(String domainId, org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl)
setAclFor in interface IAclAwarePentahoMetadataDomainRepositoryImporterpublic org.pentaho.platform.api.repository2.unified.RepositoryFileAcl getAclFor(String domainId)
getAclFor in interface IAclAwarePentahoMetadataDomainRepositoryImporterpublic boolean hasAccessFor(String domainId)
hasAccessFor in interface IAclAwarePentahoMetadataDomainRepositoryImporterpublic Map<String,InputStream> getDomainFilesData(String domainId)
getDomainFilesData in interface IPentahoMetadataDomainRepositoryExporterpublic org.pentaho.metadata.model.Domain getDomain(String domainId)
getDomain in interface org.pentaho.metadata.repository.IMetadataDomainRepositorydomainId - domain to get from the repositorypublic Set<String> getDomainIds()
getDomainIds in interface org.pentaho.metadata.repository.IMetadataDomainRepositorypublic void removeDomain(String domainId)
removeDomain in interface org.pentaho.metadata.repository.IMetadataDomainRepositoryremoveDomain in interface IPentahoMetadataDomainRepositoryImporterdomainId - 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.IMetadataDomainRepositorydomainId - modelId - org.pentaho.metadata.repository.DomainIdNullExceptionorg.pentaho.metadata.repository.DomainStorageExceptionpublic void reloadDomains()
reloadDomains in interface org.pentaho.metadata.repository.IMetadataDomainRepositorypublic void flushDomains()
flushDomains in interface org.pentaho.metadata.repository.IMetadataDomainRepositorypublic String generateRowLevelSecurityConstraint(org.pentaho.metadata.model.LogicalModel model)
generateRowLevelSecurityConstraint in interface org.pentaho.metadata.repository.IMetadataDomainRepositorypublic boolean hasAccess(int accessType,
org.pentaho.metadata.model.concept.IConcept aclHolder)
hasAccess in interface org.pentaho.metadata.repository.IMetadataDomainRepositorypublic 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.DomainStorageExceptionpublic void addLocalizationFile(String domainId, String locale, InputStream inputStream, boolean overwrite) throws org.pentaho.metadata.repository.DomainStorageException
addLocalizationFile in interface IPentahoMetadataDomainRepositoryImporterorg.pentaho.metadata.repository.DomainStorageExceptionprotected org.pentaho.platform.api.repository2.unified.RepositoryFile getMetadataDir()
protected void loadLocaleStrings(String domainId, org.pentaho.metadata.model.Domain domain)
protected Properties loadProperties(org.pentaho.platform.api.repository2.unified.RepositoryFile bundle)
protected org.pentaho.platform.api.repository2.unified.RepositoryFile createUniqueFile(String domainId, String locale, org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData data)
domainId - the Domain id associated with this filelocale - the locale associated with this file (or null for a domain file)data - the data to put in the fileprotected org.pentaho.platform.api.repository2.unified.IUnifiedRepository getRepository()
protected org.pentaho.metadata.util.XmiParser getXmiParser()
protected org.pentaho.platform.repository2.unified.RepositoryUtils getRepositoryUtils()
protected org.pentaho.metadata.util.LocalizationUtil getLocalizationUtil()
protected void setRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository)
protected void setXmiParser(org.pentaho.metadata.util.XmiParser xmiParser)
protected void setRepositoryUtils(org.pentaho.platform.repository2.unified.RepositoryUtils repositoryUtils)
protected void setLocalizationUtil(org.pentaho.metadata.util.LocalizationUtil localizationUtil)
protected String toString(org.pentaho.platform.api.repository2.unified.RepositoryFile file)
protected org.pentaho.platform.api.repository2.unified.RepositoryFile getMetadataRepositoryFile(String domainId)
public String loadAnnotationsXml(String domainId)
loadAnnotationsXml in interface IModelAnnotationsAwareMetadataDomainRepositoryImporterpublic void storeAnnotationsXml(String domainId, String annotationsXml)
storeAnnotationsXml in interface IModelAnnotationsAwareMetadataDomainRepositoryImporterpublic 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)
protected String resolveAnnotationsFilePath(org.pentaho.platform.api.repository2.unified.RepositoryFile domainFile)
protected org.apache.commons.logging.Log getLogger()
Copyright © 2020 Hitachi Vantara. All rights reserved.