public class DictionaryDAOImpl extends Object implements DictionaryDAO, NamespaceDAO, org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
| Constructor and Description |
|---|
DictionaryDAOImpl()
Construct
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPrefix(String prefix,
String uri)
Add a namespace prefix
|
void |
addURI(String uri)
Add a namespace URI
|
void |
destroy()
Destroy the Dictionary.
|
List<M2ModelDiff> |
diffModel(M2Model model)
Return diffs between input model and model in the Dictionary.
|
List<M2ModelDiff> |
diffModel(M2Model model,
boolean enableConstraintClassLoading)
Return diffs between input model and model in the Dictionary.
|
List<M2ModelDiff> |
diffModelIgnoringConstraints(M2Model model) |
TypeDefinition |
getAnonymousType(QName type,
Collection<QName> aspects)
Construct an anonymous type that combines a primary type definition and
and one or more aspects
|
AspectDefinition |
getAspect(QName aspectName)
Gets the specified aspect
|
Collection<QName> |
getAspects(boolean includeInherited) |
Collection<AspectDefinition> |
getAspects(QName modelName) |
AssociationDefinition |
getAssociation(QName assocName)
Gets the specified association
|
Collection<QName> |
getAssociations(boolean includeInherited) |
Collection<AssociationDefinition> |
getAssociations(QName modelName) |
ClassDefinition |
getClass(QName className)
Gets the specified class
|
CompiledModel |
getCompiledModel(QName modelName) |
ConstraintDefinition |
getConstraint(QName constraintQName)
Gets the specified property constraint
|
Collection<ConstraintDefinition> |
getConstraints(QName modelName) |
Collection<ConstraintDefinition> |
getConstraints(QName modelName,
boolean referenceableDefsOnly) |
DataTypeDefinition |
getDataType(Class javaClass)
Gets the data type for the specified Java Class
|
DataTypeDefinition |
getDataType(QName typeName)
Gets the specified data type
|
Collection<DataTypeDefinition> |
getDataTypes(QName modelName) |
String |
getDefaultAnalyserResourceBundleName() |
List<DictionaryListener> |
getDictionaryListeners()
get DictionaryListener registered by calls to registerListener
|
DictionaryRegistry |
getDictionaryRegistry(String tenantDomain) |
ModelDefinition |
getModel(QName name) |
Collection<QName> |
getModels() |
Collection<QName> |
getModels(boolean includeInherited) |
Collection<NamespaceDefinition> |
getNamespaces(QName modelName) |
String |
getNamespaceURI(String prefix)
Gets the namespace URI registered for the given prefix
|
Collection<String> |
getPrefixes()
Gets all registered Prefixes
|
Collection<String> |
getPrefixes(String URI)
Gets the registered prefixes for the given namespace URI
|
Collection<PropertyDefinition> |
getProperties(QName modelName) |
Collection<PropertyDefinition> |
getProperties(QName modelName,
QName dataType)
Get all properties for the model and that are of the given data type.
|
Collection<PropertyDefinition> |
getPropertiesOfDataType(QName dataType)
Get all properties for all models of the given data type.
|
PropertyDefinition |
getProperty(QName propertyName)
Gets the specified property
|
ClassLoader |
getResourceClassLoader() |
Collection<QName> |
getSubAspects(QName superAspect,
boolean follow) |
Collection<QName> |
getSubTypes(QName superType,
boolean follow) |
TypeDefinition |
getType(QName typeName)
Gets the specified type
|
Collection<QName> |
getTypes(boolean includeInherited) |
Collection<TypeDefinition> |
getTypes(QName modelName) |
Collection<String> |
getURIs()
Gets all registered Uris
|
void |
init()
Initialise a reload of the dictionary for the current tenant.
|
DictionaryRegistry |
initDictionaryRegistry(String tenantDomain)
For cache use only.
|
boolean |
isContextRefreshed() |
boolean |
isModelInherited(QName modelName) |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event) |
QName |
putModel(M2Model model)
Adds a model to the dictionary.
|
QName |
putModelIgnoringConstraints(M2Model model)
Adds a model to the dictionary.
|
void |
register(DictionaryListener dictionaryListener)
Deprecated.
|
void |
registerListener(DictionaryListener dictionaryListener)
Register with the Dictionary
|
void |
removeModel(QName modelName)
Removes a model from the dictionary.
|
void |
removePrefix(String prefix)
Remove a namspace prefix
|
void |
removeURI(String uri)
Remove the specified URI
|
void |
reset()
Reset the Dictionary for the current tenant.
|
void |
setDefaultAnalyserResourceBundleName(String defaultAnalyserResourceBundleName) |
void |
setDictionaryRegistryCache(CompiledModelsCache dictionaryRegistryCache) |
void |
setResourceClassLoader(ClassLoader resourceClassLoader) |
void |
setTenantService(TenantService tenantService) |
public void setTenantService(TenantService tenantService)
public void setDictionaryRegistryCache(CompiledModelsCache dictionaryRegistryCache)
public String getDefaultAnalyserResourceBundleName()
getDefaultAnalyserResourceBundleName in interface DictionaryDAOpublic void setDefaultAnalyserResourceBundleName(String defaultAnalyserResourceBundleName)
@Deprecated public void register(DictionaryListener dictionaryListener)
This method is deprecated, use registerListener(DictionaryListener dictionaryListener) instead.
register in interface DictionaryDAOdictionaryListener - public void registerListener(DictionaryListener dictionaryListener)
registerListener in interface DictionaryDAOdictionaryListener - DictionaryListenerpublic List<DictionaryListener> getDictionaryListeners()
DictionaryDAOgetDictionaryListeners in interface DictionaryDAODictionaryListenerpublic void init()
DictionaryDAOinit in interface DictionaryDAOpublic void destroy()
DictionaryDAO
WARNING: This method can cause 'stutter' on user threads as they wait for
the dictionary to reload. It is safer to call DictionaryDAO.init(), which will also rebuild the
dictionary but will not destroy the old one, thereby allowing other threads to continue
operating.
destroy in interface DictionaryDAOpublic void reset()
DictionaryDAOreset in interface DictionaryDAOpublic QName putModel(M2Model model)
DictionaryDAOputModel in interface DictionaryDAOmodel - the model to addpublic QName putModelIgnoringConstraints(M2Model model)
DictionaryDAOputModelIgnoringConstraints in interface DictionaryDAOmodel - the model to addpublic void removeModel(QName modelName)
DictionaryDAOremoveModel in interface DictionaryDAOmodelName - the qname of the model to removeDictionaryDAO.removeModel(org.alfresco.service.namespace.QName)public CompiledModel getCompiledModel(QName modelName)
modelName - the model namepublic DataTypeDefinition getDataType(QName typeName)
typeName - name of the data typepublic DataTypeDefinition getDataType(Class javaClass)
javaClass - the java classpublic Collection<DataTypeDefinition> getDataTypes(QName modelName)
getDataTypes in interface DictionaryDAOmodelName - the model to retrieve property types forpublic TypeDefinition getType(QName typeName)
typeName - name of the typepublic Collection<QName> getSubTypes(QName superType, boolean follow)
getSubTypes in interface DictionaryDAOsuperType - QNamefollow - true => follow up the super-class hierarchy, false =>
immediate sub types onlypublic AspectDefinition getAspect(QName aspectName)
aspectName - name of the aspectpublic Collection<QName> getSubAspects(QName superAspect, boolean follow)
getSubAspects in interface DictionaryDAOsuperAspect - QNamefollow - true => follow up the super-class hierarchy, false =>
immediate sub aspects onlypublic ClassDefinition getClass(QName className)
className - name of the classpublic PropertyDefinition getProperty(QName propertyName)
propertyName - name of the propertypublic ConstraintDefinition getConstraint(QName constraintQName)
constraintQName - the qualified name of the property constraintpublic AssociationDefinition getAssociation(QName assocName)
assocName - name of the associationpublic Collection<AssociationDefinition> getAssociations(QName modelName)
getAssociations in interface DictionaryDAOmodelName - the model to retrieve associations forpublic Collection<QName> getModels(boolean includeInherited)
getModels in interface DictionaryDAOpublic Collection<QName> getModels()
getModels in interface DictionaryDAOpublic Collection<QName> getTypes(boolean includeInherited)
getTypes in interface DictionaryDAOpublic Collection<QName> getAssociations(boolean includeInherited)
getAssociations in interface DictionaryDAOpublic Collection<QName> getAspects(boolean includeInherited)
getAspects in interface DictionaryDAOpublic boolean isModelInherited(QName modelName)
isModelInherited in interface DictionaryDAOpublic ModelDefinition getModel(QName name)
getModel in interface DictionaryDAOname - the model to retrievepublic Collection<TypeDefinition> getTypes(QName modelName)
getTypes in interface DictionaryDAOmodelName - the model to retrieve types forpublic Collection<AspectDefinition> getAspects(QName modelName)
getAspects in interface DictionaryDAOmodelName - the model to retrieve aspects forpublic TypeDefinition getAnonymousType(QName type, Collection<QName> aspects)
DictionaryDAOgetAnonymousType in interface DictionaryDAOtype - the primary typeaspects - the aspects to combinepublic Collection<PropertyDefinition> getProperties(QName modelName)
getProperties in interface DictionaryDAOmodelName - the model for which to get properties forpublic Collection<PropertyDefinition> getProperties(QName modelName, QName dataType)
DictionaryDAOgetProperties in interface DictionaryDAOmodelName - the name of the modeldataType - null to get all propertiespublic Collection<PropertyDefinition> getPropertiesOfDataType(QName dataType)
DictionaryDAOgetPropertiesOfDataType in interface DictionaryDAOdataType - QNamepublic Collection<NamespaceDefinition> getNamespaces(QName modelName)
getNamespaces in interface DictionaryDAOmodelName - the model to retrieve namespaces forpublic Collection<ConstraintDefinition> getConstraints(QName modelName)
getConstraints in interface DictionaryDAOmodelName - the model to retrieve constraint defs (including property
constaint refs)public Collection<ConstraintDefinition> getConstraints(QName modelName, boolean referenceableDefsOnly)
getConstraints in interface DictionaryDAOmodelName - the model to retrieve constraint defs (optionally only
referenceable constraints)public DictionaryRegistry getDictionaryRegistry(String tenantDomain)
getDictionaryRegistry in interface DictionaryDAOpublic DictionaryRegistry initDictionaryRegistry(String tenantDomain)
tenantDomain - Stringpublic List<M2ModelDiff> diffModel(M2Model model)
diffModel in interface DictionaryDAOmodel - M2Modelpublic List<M2ModelDiff> diffModelIgnoringConstraints(M2Model model)
diffModelIgnoringConstraints in interface DictionaryDAOpublic List<M2ModelDiff> diffModel(M2Model model, boolean enableConstraintClassLoading)
model - M2ModelenableConstraintClassLoading - booleanpublic ClassLoader getResourceClassLoader()
getResourceClassLoader in interface DictionaryDAOpublic void setResourceClassLoader(ClassLoader resourceClassLoader)
setResourceClassLoader in interface DictionaryDAOresourceClassLoader - ClassLoaderpublic String getNamespaceURI(String prefix)
NamespacePrefixResolvergetNamespaceURI in interface NamespacePrefixResolverprefix - prefix to lookuppublic Collection<String> getPrefixes(String URI)
NamespacePrefixResolvergetPrefixes in interface NamespacePrefixResolverURI - namespace URI to lookuppublic void addURI(String uri)
NamespaceDAOaddURI in interface NamespaceDAOuri - the namespace uri to addpublic Collection<String> getPrefixes()
NamespacePrefixResolvergetPrefixes in interface NamespacePrefixResolverpublic Collection<String> getURIs()
NamespacePrefixResolvergetURIs in interface NamespacePrefixResolverpublic void removeURI(String uri)
NamespaceDAOremoveURI in interface NamespaceDAOuri - the uri to removepublic void addPrefix(String prefix, String uri)
NamespaceDAOaddPrefix in interface NamespaceDAOprefix - the prefixuri - the uri to prefixpublic void removePrefix(String prefix)
NamespaceDAOremovePrefix in interface NamespaceDAOprefix - the prefix to removepublic boolean isContextRefreshed()
isContextRefreshed in interface DictionaryDAOpublic void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>Copyright © 2005–2019 Alfresco Software. All rights reserved.