class ValueIntegrator extends Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
ValueIntegrator.UnifiedValue<M extends DMXObjectModelImpl> |
Modifier and Type | Field and Description |
---|---|
private AssociationDefinitionModel |
assocDef |
private List<String> |
emptyValues |
private boolean |
isAssoc |
private boolean |
isFacetUpdate |
private boolean |
isType |
private Logger |
logger |
private ModelFactoryImpl |
mf |
private DMXObjectModelImpl |
newValues |
private PersistenceLayer |
pl |
private DMXObjectModelImpl |
targetObject |
private TypeModelImpl |
type |
Constructor and Description |
---|
ValueIntegrator(PersistenceLayer pl) |
Modifier and Type | Method and Description |
---|---|
private AssociationDefinitionModel |
assocDef(String assocDefUri) |
private Iterable<String> |
assocDefUris() |
private AssociationModelImpl |
createChildAssociation(DMXObjectModel parent,
DMXObjectModel child,
String assocDefUri) |
private AssociationModelImpl |
createChildAssociation(DMXObjectModel parent,
DMXObjectModel child,
String assocDefUri,
boolean deleted) |
private TopicModelImpl |
createCompositeTopic(Map<String,Object> childTopics) |
private TopicModelImpl |
createSimpleTopic()
Preconditions:
- this.newValues is a topic model.
|
private void |
eliminateParentCandidates(List<RelatedTopicModelImpl> candidates,
DMXObjectModel childTopic,
String assocDefUri) |
private RelatedTopicModelImpl |
findTopic(List<RelatedTopicModelImpl> topics,
long topicId) |
private DMXObjectModelImpl |
identifyParent(Map<String,Object> childTopics) |
private Map<String,Object> |
identityChildTopics(Map<String,Object> childTopics,
List<String> identityAssocDefUris) |
private void |
idTransfer(DMXObjectModelImpl value) |
(package private) <M extends DMXObjectModelImpl> |
integrate(M newValues,
M targetObject,
AssociationDefinitionModel assocDef)
Integrates new values into the DB and returns the unified value.
|
private Object |
integrateChildValue(Object childValue,
String assocDefUri)
Integrates a child value into the DB and returns the unified value.
|
private DMXObjectModelImpl |
integrateComposite()
Integrates a composite value into the DB and returns the unified composite value.
|
private DMXObjectModelImpl |
integrateSimple()
Integrates a simple value into the DB and returns the unified simple value.
|
private boolean |
isEmptyValue(String assocDefUri) |
private boolean |
isOne(String assocDefUri) |
private boolean |
isValueType() |
private List<RelatedTopicModelImpl> |
parentCandidates(Map<String,Object> childTopics)
Preconditions:
- this.newValues is composite
- assocDef's parent type is this.type
- childTopic's type is assocDef's child type
- childTopics map is not empty
|
private void |
removeTopic(List<RelatedTopicModelImpl> topics,
long topicId) |
private DMXObjectModelImpl |
storeAssocSimpleValue()
Preconditions:
- this.newValues is an assoc model.
|
private DMXObjectModelImpl |
unifyChildTopics(Map<String,Object> childTopics,
Iterable<String> assocDefUris)
Preconditions:
- this.newValues is composite
- assocDef's parent type is this.type
- childTopic's type is assocDef's child type
- childTopics map is not empty
|
private DMXObjectModelImpl |
unifyComposite(Map<String,Object> childTopics)
Preconditions:
- this.newValues is composite
- assocDef's parent type is this.type
- childTopic's type is assocDef's child type
|
private ValueIntegrator.UnifiedValue |
unifyRef() |
private TopicModelImpl |
unifySimple()
Preconditions:
- this.newValues is simple
- this.newValues is not empty
|
private DMXObjectModelImpl |
updateAssignments(DMXObjectModelImpl parent,
Map<String,Object> unifiedChilds)
Updates a parent's child assignments in-place.
|
private void |
updateAssignmentsMany(DMXObjectModelImpl parent,
List<ValueIntegrator.UnifiedValue> unifiedChilds,
String assocDefUri) |
private void |
updateAssignmentsOne(DMXObjectModelImpl parent,
TopicModel unifiedChild,
String assocDefUri) |
private void |
updateRelatingAssociation(AssociationModelImpl assoc,
String assocDefUri,
RelatedTopicModelImpl newValues) |
private DMXObjectModelImpl newValues
private DMXObjectModelImpl targetObject
private AssociationDefinitionModel assocDef
private TypeModelImpl type
private boolean isAssoc
private boolean isType
private boolean isFacetUpdate
private List<String> emptyValues
private PersistenceLayer pl
private ModelFactoryImpl mf
ValueIntegrator(PersistenceLayer pl)
<M extends DMXObjectModelImpl> ValueIntegrator.UnifiedValue<M> integrate(M newValues, M targetObject, AssociationDefinitionModel assocDef)
private ValueIntegrator.UnifiedValue unifyRef()
private void idTransfer(DMXObjectModelImpl value)
private DMXObjectModelImpl integrateSimple()
private DMXObjectModelImpl storeAssocSimpleValue()
private TopicModelImpl unifySimple()
private DMXObjectModelImpl integrateComposite()
private Iterable<String> assocDefUris()
private Object integrateChildValue(Object childValue, String assocDefUri)
childValue
- RelatedTopicModelImpl or Listprivate DMXObjectModelImpl unifyComposite(Map<String,Object> childTopics)
childTopics
- value: UnifiedValue or Listprivate DMXObjectModelImpl identifyParent(Map<String,Object> childTopics)
childTopics
- value: UnifiedValue or Listprivate Map<String,Object> identityChildTopics(Map<String,Object> childTopics, List<String> identityAssocDefUris)
childTopics
- value: UnifiedValue or Listprivate DMXObjectModelImpl updateAssignments(DMXObjectModelImpl parent, Map<String,Object> unifiedChilds)
unifiedChilds
- value: UnifiedValue or Listprivate void updateAssignmentsOne(DMXObjectModelImpl parent, TopicModel unifiedChild, String assocDefUri)
unifiedChild
- may be nullprivate void updateAssignmentsMany(DMXObjectModelImpl parent, List<ValueIntegrator.UnifiedValue> unifiedChilds, String assocDefUri)
unifiedChilds
- never null; a UnifiedValue's "value" field may be nullprivate void updateRelatingAssociation(AssociationModelImpl assoc, String assocDefUri, RelatedTopicModelImpl newValues)
private DMXObjectModelImpl unifyChildTopics(Map<String,Object> childTopics, Iterable<String> assocDefUris)
childTopics
- value: UnifiedValue or Listprivate List<RelatedTopicModelImpl> parentCandidates(Map<String,Object> childTopics)
childTopics
- value: UnifiedValue or Listprivate void eliminateParentCandidates(List<RelatedTopicModelImpl> candidates, DMXObjectModel childTopic, String assocDefUri)
childTopic
- may be nullprivate TopicModelImpl createSimpleTopic()
private TopicModelImpl createCompositeTopic(Map<String,Object> childTopics)
childTopics
- value: UnifiedValue or Listprivate AssociationModelImpl createChildAssociation(DMXObjectModel parent, DMXObjectModel child, String assocDefUri)
private AssociationModelImpl createChildAssociation(DMXObjectModel parent, DMXObjectModel child, String assocDefUri, boolean deleted)
private RelatedTopicModelImpl findTopic(List<RelatedTopicModelImpl> topics, long topicId)
private void removeTopic(List<RelatedTopicModelImpl> topics, long topicId)
private AssociationDefinitionModel assocDef(String assocDefUri)
private boolean isValueType()
private boolean isEmptyValue(String assocDefUri)
Copyright © 2018. All Rights Reserved.