|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.deepamehta.core.impl.ValueStorage
class ValueStorage
Helper for storing/fetching simple values and composite value models.
Field Summary | |
---|---|
private EmbeddedService |
dms
|
private static String |
LABEL_CHILD_SEPARATOR
|
private static String |
LABEL_TOPIC_SEPARATOR
|
private Logger |
logger
|
Constructor Summary | |
---|---|
ValueStorage(EmbeddedService dms)
|
Method Summary | |
---|---|
private void |
appendLabel(String label,
StringBuilder builder,
String separator)
|
(package private) void |
associateChildTopic(DeepaMehtaObjectModel parent,
long childTopicId,
AssociationDefinition assocDef,
ClientState clientState)
|
(package private) void |
associateChildTopic(DeepaMehtaObjectModel parent,
String childTopicUri,
AssociationDefinition assocDef,
ClientState clientState)
|
private void |
associateChildTopic(DeepaMehtaObjectModel parent,
TopicRoleModel child,
AssociationDefinition assocDef,
ClientState clientState)
|
(package private) Topic |
associateReferencedChildTopic(DeepaMehtaObjectModel parent,
TopicReferenceModel childTopicRef,
AssociationDefinition assocDef,
ClientState clientState)
Creates an association between the given parent object ("Parent" role) and the referenced topic ("Child" role). |
private String |
buildChildLabel(DeepaMehtaObjectModel parent,
String childTypeUri)
|
private String |
buildDefaultLabel(DeepaMehtaObjectModel model)
|
private String |
buildLabel(DeepaMehtaObjectModel model)
|
private String |
buildLabelFromConfig(DeepaMehtaObjectModel model,
List<String> labelConfig)
Builds the specified object model's label according to a label configuration. |
private RelatedTopicModel |
fetchChildTopic(long parentId,
AssociationDefinition assocDef)
Fetches and returns a child topic or null if no such topic extists. |
(package private) void |
fetchChildTopics(DeepaMehtaObjectModel parent,
AssociationDefinition assocDef)
Recursively fetches the child topic models of the given parent object model and updates it in-place. |
private ResultList<RelatedTopicModel> |
fetchChildTopics(long parentId,
AssociationDefinition assocDef)
|
(package private) void |
fetchCompositeValue(DeepaMehtaObjectModel parent)
Recursively fetches the composite value (child topic models) of the given parent object model and updates it in-place. |
private SimpleValue |
getIndexValue(DeepaMehtaObjectModel model)
Calculates the simple value that is to be indexed for this object. |
(package private) Type |
getType(DeepaMehtaObjectModel model)
Convenience method to get the (attached) type of a DeepaMehta object model. |
private void |
putInCompositeValue(DeepaMehtaObjectModel parent,
Topic childTopic,
AssociationDefinition assocDef)
For single-valued childs |
(package private) void |
refreshLabel(DeepaMehtaObjectModel model)
Prerequisite: this is a composite object. |
private void |
replaceReference(TopicModel topicRef,
Topic topic)
Replaces a topic reference with the resolved topic. |
(package private) void |
setSimpleValue(DeepaMehtaObjectModel model,
SimpleValue value)
|
private void |
storeAggregationMany(List<TopicModel> models,
DeepaMehtaObjectModel parent,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
private void |
storeAggregationOne(TopicModel model,
DeepaMehtaObjectModel parent,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
private void |
storeChildTopics(TopicModel childTopic,
List<TopicModel> childTopics,
DeepaMehtaObjectModel parent,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
private void |
storeCompositeValue(DeepaMehtaObjectModel parent,
ClientState clientState,
Directives directives)
Called to store the initial value of a newly created topic/association. |
private void |
storeCompositionMany(List<TopicModel> models,
DeepaMehtaObjectModel parent,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
private void |
storeCompositionOne(TopicModel model,
DeepaMehtaObjectModel parent,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
private void |
storeSimpleValue(DeepaMehtaObjectModel model)
Stores and indexes the simple value of the specified topic or association model. |
(package private) void |
storeValue(DeepaMehtaObjectModel model,
ClientState clientState,
Directives directives)
Stores and indexes the specified model's value, either a simple value or a composite value (child topics). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String LABEL_CHILD_SEPARATOR
private static final String LABEL_TOPIC_SEPARATOR
private EmbeddedService dms
private Logger logger
Constructor Detail |
---|
ValueStorage(EmbeddedService dms)
Method Detail |
---|
void fetchCompositeValue(DeepaMehtaObjectModel parent)
void fetchChildTopics(DeepaMehtaObjectModel parent, AssociationDefinition assocDef)
Works for both, "one" and "many" association definitions.
assocDef
- The child topic models according to this association definition are fetched.void storeValue(DeepaMehtaObjectModel model, ClientState clientState, Directives directives)
Called to store the initial value of a newly created topic/association.
void refreshLabel(DeepaMehtaObjectModel model)
void setSimpleValue(DeepaMehtaObjectModel model, SimpleValue value)
Topic associateReferencedChildTopic(DeepaMehtaObjectModel parent, TopicReferenceModel childTopicRef, AssociationDefinition assocDef, ClientState clientState)
void associateChildTopic(DeepaMehtaObjectModel parent, long childTopicId, AssociationDefinition assocDef, ClientState clientState)
void associateChildTopic(DeepaMehtaObjectModel parent, String childTopicUri, AssociationDefinition assocDef, ClientState clientState)
Type getType(DeepaMehtaObjectModel model)
private void storeSimpleValue(DeepaMehtaObjectModel model)
private void storeCompositeValue(DeepaMehtaObjectModel parent, ClientState clientState, Directives directives)
Note: the given model can contain childs not defined in the type definition. Only the childs defined in the type definition are stored.
private void storeChildTopics(TopicModel childTopic, List<TopicModel> childTopics, DeepaMehtaObjectModel parent, AssociationDefinition assocDef, ClientState clientState, Directives directives)
private void storeCompositionOne(TopicModel model, DeepaMehtaObjectModel parent, AssociationDefinition assocDef, ClientState clientState, Directives directives)
private void storeCompositionMany(List<TopicModel> models, DeepaMehtaObjectModel parent, AssociationDefinition assocDef, ClientState clientState, Directives directives)
private void storeAggregationOne(TopicModel model, DeepaMehtaObjectModel parent, AssociationDefinition assocDef, ClientState clientState, Directives directives)
private void storeAggregationMany(List<TopicModel> models, DeepaMehtaObjectModel parent, AssociationDefinition assocDef, ClientState clientState, Directives directives)
private void putInCompositeValue(DeepaMehtaObjectModel parent, Topic childTopic, AssociationDefinition assocDef)
private void replaceReference(TopicModel topicRef, Topic topic)
private String buildLabel(DeepaMehtaObjectModel model)
private String buildLabelFromConfig(DeepaMehtaObjectModel model, List<String> labelConfig)
private String buildDefaultLabel(DeepaMehtaObjectModel model)
private String buildChildLabel(DeepaMehtaObjectModel parent, String childTypeUri)
private void appendLabel(String label, StringBuilder builder, String separator)
private RelatedTopicModel fetchChildTopic(long parentId, AssociationDefinition assocDef)
null
if no such topic extists.
private ResultList<RelatedTopicModel> fetchChildTopics(long parentId, AssociationDefinition assocDef)
private void associateChildTopic(DeepaMehtaObjectModel parent, TopicRoleModel child, AssociationDefinition assocDef, ClientState clientState)
private SimpleValue getIndexValue(DeepaMehtaObjectModel model)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |