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 DictionaryDAO
public void setDefaultAnalyserResourceBundleName(String defaultAnalyserResourceBundleName)
@Deprecated public void register(DictionaryListener dictionaryListener)
This method is deprecated, use registerListener(DictionaryListener dictionaryListener)
instead.
register
in interface DictionaryDAO
dictionaryListener
- public void registerListener(DictionaryListener dictionaryListener)
registerListener
in interface DictionaryDAO
dictionaryListener
- DictionaryListenerpublic List<DictionaryListener> getDictionaryListeners()
DictionaryDAO
getDictionaryListeners
in interface DictionaryDAO
DictionaryListener
public void init()
DictionaryDAO
init
in interface DictionaryDAO
public 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 DictionaryDAO
public void reset()
DictionaryDAO
reset
in interface DictionaryDAO
public QName putModel(M2Model model)
DictionaryDAO
putModel
in interface DictionaryDAO
model
- the model to addpublic QName putModelIgnoringConstraints(M2Model model)
DictionaryDAO
putModelIgnoringConstraints
in interface DictionaryDAO
model
- the model to addpublic void removeModel(QName modelName)
DictionaryDAO
removeModel
in interface DictionaryDAO
modelName
- 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 DictionaryDAO
modelName
- 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 DictionaryDAO
superType
- 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 DictionaryDAO
superAspect
- 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 DictionaryDAO
modelName
- the model to retrieve associations forpublic Collection<QName> getModels(boolean includeInherited)
getModels
in interface DictionaryDAO
public Collection<QName> getModels()
getModels
in interface DictionaryDAO
public Collection<QName> getTypes(boolean includeInherited)
getTypes
in interface DictionaryDAO
public Collection<QName> getAssociations(boolean includeInherited)
getAssociations
in interface DictionaryDAO
public Collection<QName> getAspects(boolean includeInherited)
getAspects
in interface DictionaryDAO
public boolean isModelInherited(QName modelName)
isModelInherited
in interface DictionaryDAO
public ModelDefinition getModel(QName name)
getModel
in interface DictionaryDAO
name
- the model to retrievepublic Collection<TypeDefinition> getTypes(QName modelName)
getTypes
in interface DictionaryDAO
modelName
- the model to retrieve types forpublic Collection<AspectDefinition> getAspects(QName modelName)
getAspects
in interface DictionaryDAO
modelName
- the model to retrieve aspects forpublic TypeDefinition getAnonymousType(QName type, Collection<QName> aspects)
DictionaryDAO
getAnonymousType
in interface DictionaryDAO
type
- the primary typeaspects
- the aspects to combinepublic Collection<PropertyDefinition> getProperties(QName modelName)
getProperties
in interface DictionaryDAO
modelName
- the model for which to get properties forpublic Collection<PropertyDefinition> getProperties(QName modelName, QName dataType)
DictionaryDAO
getProperties
in interface DictionaryDAO
modelName
- the name of the modeldataType
- null to get all propertiespublic Collection<PropertyDefinition> getPropertiesOfDataType(QName dataType)
DictionaryDAO
getPropertiesOfDataType
in interface DictionaryDAO
dataType
- QNamepublic Collection<NamespaceDefinition> getNamespaces(QName modelName)
getNamespaces
in interface DictionaryDAO
modelName
- the model to retrieve namespaces forpublic Collection<ConstraintDefinition> getConstraints(QName modelName)
getConstraints
in interface DictionaryDAO
modelName
- the model to retrieve constraint defs (including property
constaint refs)public Collection<ConstraintDefinition> getConstraints(QName modelName, boolean referenceableDefsOnly)
getConstraints
in interface DictionaryDAO
modelName
- the model to retrieve constraint defs (optionally only
referenceable constraints)public DictionaryRegistry getDictionaryRegistry(String tenantDomain)
getDictionaryRegistry
in interface DictionaryDAO
public DictionaryRegistry initDictionaryRegistry(String tenantDomain)
tenantDomain
- Stringpublic List<M2ModelDiff> diffModel(M2Model model)
diffModel
in interface DictionaryDAO
model
- M2Modelpublic List<M2ModelDiff> diffModelIgnoringConstraints(M2Model model)
diffModelIgnoringConstraints
in interface DictionaryDAO
public List<M2ModelDiff> diffModel(M2Model model, boolean enableConstraintClassLoading)
model
- M2ModelenableConstraintClassLoading
- booleanpublic ClassLoader getResourceClassLoader()
getResourceClassLoader
in interface DictionaryDAO
public void setResourceClassLoader(ClassLoader resourceClassLoader)
setResourceClassLoader
in interface DictionaryDAO
resourceClassLoader
- ClassLoaderpublic String getNamespaceURI(String prefix)
NamespacePrefixResolver
getNamespaceURI
in interface NamespacePrefixResolver
prefix
- prefix to lookuppublic Collection<String> getPrefixes(String URI)
NamespacePrefixResolver
getPrefixes
in interface NamespacePrefixResolver
URI
- namespace URI to lookuppublic void addURI(String uri)
NamespaceDAO
addURI
in interface NamespaceDAO
uri
- the namespace uri to addpublic Collection<String> getPrefixes()
NamespacePrefixResolver
getPrefixes
in interface NamespacePrefixResolver
public Collection<String> getURIs()
NamespacePrefixResolver
getURIs
in interface NamespacePrefixResolver
public void removeURI(String uri)
NamespaceDAO
removeURI
in interface NamespaceDAO
uri
- the uri to removepublic void addPrefix(String prefix, String uri)
NamespaceDAO
addPrefix
in interface NamespaceDAO
prefix
- the prefixuri
- the uri to prefixpublic void removePrefix(String prefix)
NamespaceDAO
removePrefix
in interface NamespaceDAO
prefix
- the prefix to removepublic boolean isContextRefreshed()
isContextRefreshed
in interface DictionaryDAO
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
Copyright © 2005–2018 Alfresco Software. All rights reserved.