Package org.alfresco.repo.dictionary
Interface DictionaryDAO
- All Known Implementing Classes:
DictionaryDAOImpl
public interface DictionaryDAO
Dictionary Data Access
- Author:
- David Caruana, sglover
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroy the Dictionary.Return diffs between input model and model in the Dictionary.getAnonymousType
(QName type, Collection<QName> aspects) Construct an anonymous type that combines a primary type definition and and one or more aspectsGets the specified aspectgetAspects
(boolean includeInherited) getAspects
(QName model) getAssociation
(QName name) Gets the specified associationgetAssociations
(boolean includeInherited) getAssociations
(QName model) Gets the specified classgetConstraint
(QName name) Gets the specified property constraintgetConstraints
(QName model) getConstraints
(QName model, boolean referenceableDefsOnly) getDataType
(Class javaClass) Gets the data type for the specified Java ClassgetDataType
(QName name) Gets the specified data typegetDataTypes
(QName model) get DictionaryListener registered by calls to registerListenergetDictionaryRegistry
(String tenantDomain) getModels
(boolean includeInherited) getNamespaces
(QName modelName) getProperties
(QName model) getProperties
(QName modelName, QName dataType) Get all properties for the model and that are of the given data type.getPropertiesOfDataType
(QName dataType) Get all properties for all models of the given data type.getProperty
(QName name) Gets the specified propertygetSubAspects
(QName superAspect, boolean follow) getSubTypes
(QName superType, boolean follow) Gets the specified typegetTypes
(boolean includeInherited) void
init()
Initialise a reload of the dictionary for the current tenant.boolean
boolean
isModelInherited
(QName name) Adds a model to the dictionary.Adds a model to the dictionary.void
register
(DictionaryListener dictionaryListener) Deprecated.void
registerListener
(DictionaryListener dictionaryListener) Register listener with the Dictionaryvoid
removeModel
(QName model) Removes a model from the dictionary.void
reset()
Reset the Dictionary for the current tenant.void
setResourceClassLoader
(ClassLoader resourceClassLoader)
-
Method Details
-
getDictionaryListeners
List<DictionaryListener> getDictionaryListeners()get DictionaryListener registered by calls to registerListener- Returns:
- read only list of dictionary listeners
- See Also:
-
getDictionaryRegistry
-
isContextRefreshed
boolean isContextRefreshed() -
getModels
Collection<QName> getModels()- Returns:
- the models known by the dictionary
-
getModels
-
getTypes
-
getAssociations
-
getAspects
-
getModel
- Parameters:
name
- the model to retrieve- Returns:
- the named model definition
-
getDataTypes
- Parameters:
model
- the model to retrieve property types for- Returns:
- the property types of the model
-
getTypes
- Parameters:
model
- the model to retrieve types for- Returns:
- the types of the model
-
getSubTypes
- Parameters:
superType
- QNamefollow
- true => follow up the super-class hierarchy, false => immediate sub types only
-
getAspects
- Parameters:
model
- the model to retrieve aspects for- Returns:
- the aspects of the model
-
getAssociations
- Parameters:
model
- the model to retrieve associations for- Returns:
- the associations of the model
-
getSubAspects
- Parameters:
superAspect
- QNamefollow
- true => follow up the super-class hierarchy, false => immediate sub aspects only
-
getProperties
- Parameters:
model
- the model for which to get properties for- Returns:
- the properties of the model
-
getAnonymousType
Construct an anonymous type that combines a primary type definition and and one or more aspects- Parameters:
type
- the primary typeaspects
- the aspects to combine- Returns:
- the anonymous type definition
-
putModel
Adds a model to the dictionary. The model is compiled and validated.- Parameters:
model
- the model to add- Returns:
- QName name of model
-
putModelIgnoringConstraints
Adds a model to the dictionary. The model is compiled and validated. Constraints are not loaded. This method should only be used to load models where the enforcement of constraints is never required. For example, SOLR read only use of the index where contraints are not required and thier definitions may not be available.- Parameters:
model
- the model to add- Returns:
- QName name of model
-
removeModel
Removes a model from the dictionary. The types and aspect in the model will no longer be available.- Parameters:
model
- the qname of the model to remove
-
getProperties
Get all properties for the model and that are of the given data type. If dataType is null then the all properties will be returned.- Parameters:
modelName
- the name of the modeldataType
- null to get all properties- Returns:
- the properties associated with the model
-
getPropertiesOfDataType
Get all properties for all models of the given data type.- Parameters:
dataType
- QName
-
getNamespaces
- Parameters:
modelName
- the model to retrieve namespaces for- Returns:
- the namespaces of the model
-
getConstraints
- Parameters:
model
- the model to retrieve constraint defs (including property constaint refs)- Returns:
- the constraints of the model
-
getConstraints
- Parameters:
model
- the model to retrieve constraint defs (optionally only referenceable constraints)- Returns:
- the constraints of the model
-
diffModel
Return diffs between input model and model in the Dictionary. If the input model does not exist in the Dictionary then no diffs will be returned.- Parameters:
model
- M2Model- Returns:
- model diffs (if any)
-
diffModelIgnoringConstraints
-
register
Deprecated.Register listener with the DictionaryThis method is deprecated, use
registerListener(DictionaryListener dictionaryListener)
instead.- Parameters:
dictionaryListener
-
-
registerListener
Register listener with the Dictionary- Parameters:
dictionaryListener
- DictionaryListener
-
reset
void reset()Reset the Dictionary for the current tenant. The current dictionary will be discarded and reloaded before the method returns i.e. upon return the dictionary will be current. -
init
void init()Initialise a reload of the dictionary for the current tenant. The current version of the dictionary will be accessible during this call, however it will only return once the dictionary has undergone a reload for the current tenant. -
destroy
void destroy()Destroy the Dictionary. After this call, there will be no dictionary available for the current tenant; reloading will be done lazily as required.WARNING: This method can cause 'stutter' on user threads as they wait for the dictionary to reload. It is safer to call
init()
, which will also rebuild the dictionary but will not destroy the old one, thereby allowing other threads to continue operating. -
isModelInherited
-
getResourceClassLoader
ClassLoader getResourceClassLoader()- Returns:
- ClassLoader
-
setResourceClassLoader
- Parameters:
resourceClassLoader
- ClassLoader
-
getDataType
Gets the specified data type- Parameters:
name
- name of the data type- Returns:
- data type definition
-
getDataType
Gets the data type for the specified Java Class- Parameters:
javaClass
- the java class- Returns:
- the data type definition (or null, if mapping is not available)
-
getType
Gets the specified type- Parameters:
name
- name of the type- Returns:
- type definition
-
getAspect
Gets the specified aspect- Parameters:
name
- name of the aspect- Returns:
- aspect definition
-
getClass
Gets the specified class- Parameters:
name
- name of the class- Returns:
- class definition
-
getProperty
Gets the specified property- Parameters:
name
- name of the property- Returns:
- property definition
-
getConstraint
Gets the specified property constraint- Parameters:
name
- the qualified name of the property constraint- Returns:
- ConstraintDefinition
-
getAssociation
Gets the specified association- Parameters:
name
- name of the association- Returns:
- association definition
-