|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.topicmapslab.majortom.database.store.JdbcMergeUtils
public class JdbcMergeUtils
Utility class for merging process.
Constructor Summary | |
---|---|
JdbcMergeUtils()
|
Method Summary | |
---|---|
private static boolean |
checkTmdmAssociation(JdbcTopicMapStore store,
org.tmapi.core.Association association,
de.topicmapslab.majortom.model.core.ITopicMap topicMap,
org.tmapi.core.TopicMap other,
java.util.Map<TopicRef,de.topicmapslab.majortom.model.core.ITopic> references)
Method checks if the association is a TMDM association. |
static NameMergeCandidate |
detectMergeByNameCandidate(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.ITopic topic,
de.topicmapslab.majortom.model.core.ITopic nameType,
java.lang.String value,
java.util.Collection<de.topicmapslab.majortom.model.core.ITopic> themes)
Method checks if there is a topic with the same name |
static void |
doMerge(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.ITopic topic,
de.topicmapslab.majortom.model.core.ITopic other,
de.topicmapslab.majortom.model.revision.IRevision revision)
Method merge the given topics. |
static void |
doMergeReifiable(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.IReifiable reifiable,
de.topicmapslab.majortom.model.core.IReifiable other,
de.topicmapslab.majortom.model.revision.IRevision revision)
Merge the reification of both reified constructs |
static void |
doMergeTopicMaps(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.ITopicMap topicMap,
org.tmapi.core.TopicMap other)
Merge the one topic map into the other. |
static de.topicmapslab.majortom.model.core.IScope |
getCorrespondingScope(JdbcTopicMapStore store,
java.util.Set<org.tmapi.core.Topic> themes,
java.util.Map<TopicRef,de.topicmapslab.majortom.model.core.ITopic> references)
Returns the corresponding scope containing all themes of the origin |
static de.topicmapslab.majortom.model.core.IAssociation |
getDuplette(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.IAssociation association,
java.util.Set<de.topicmapslab.majortom.model.core.IAssociation> excluded)
Method returns a duplicated association of the given one |
static de.topicmapslab.majortom.model.core.IVariant |
getDuplette(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.IName name,
java.lang.String value,
de.topicmapslab.majortom.model.core.ILocator locator,
java.util.Collection<de.topicmapslab.majortom.model.core.ITopic> themes)
Method returns the duplicated variant of the given name with the scope, datatype and value |
static de.topicmapslab.majortom.model.core.IAssociation |
getDuplette(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.ITopic topic,
de.topicmapslab.majortom.model.core.ITopic other,
de.topicmapslab.majortom.model.core.IAssociation association)
Method return a duplicated association only differs in the given role players |
static de.topicmapslab.majortom.model.core.IName |
getDuplette(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.ITopic topic,
de.topicmapslab.majortom.model.core.ITopic type,
java.lang.String value,
java.util.Collection<de.topicmapslab.majortom.model.core.ITopic> themes)
Method returns the duplicated name of the given topic with the given type, scope and value |
static de.topicmapslab.majortom.model.core.IOccurrence |
getDuplette(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.ITopic topic,
de.topicmapslab.majortom.model.core.ITopic type,
java.lang.String value,
de.topicmapslab.majortom.model.core.ILocator locator,
java.util.Collection<de.topicmapslab.majortom.model.core.ITopic> themes)
Method returns the duplicated occurrence of the given topic with the given type, scope, datatype and value |
static de.topicmapslab.majortom.model.core.ITopic |
getDuplette(JdbcTopicMapStore store,
org.tmapi.core.Topic topic,
java.util.Map<TopicRef,de.topicmapslab.majortom.model.core.ITopic> references)
Method try to find a topic with the same identity |
static java.util.Set<de.topicmapslab.majortom.model.core.IAssociation> |
getDuplettes(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.IAssociation association)
Method returns a set of duplicated association of the given one |
static java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole> |
getDuplettes(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.IAssociation association,
de.topicmapslab.majortom.model.core.IAssociationRole role)
Returns a set the duplicated role of the given association with the same type and player than the given one. |
static java.util.Set<de.topicmapslab.majortom.model.core.IVariant> |
getDuplettes(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.IName name,
java.lang.String value,
de.topicmapslab.majortom.model.core.ILocator locator,
java.util.Collection<de.topicmapslab.majortom.model.core.ITopic> themes)
Method returns the duplicated variant of the given name with the scope, datatype and value |
private static void |
mergeTopicMaps(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.ITopicMap topicMap,
org.tmapi.core.TopicMap other,
boolean isCopyingOperation)
Merge the one topic map into the other |
static void |
removeDuplicates(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.ITopicMap topicMap)
Method removes all duplicates from the given topic map. |
static void |
replaceAsTheme(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.ITopic topic,
de.topicmapslab.majortom.model.core.ITopic other)
Method replace the one topic by the other topic as theme |
static void |
replaceAsTypeOrSupertype(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.ITopic topic,
de.topicmapslab.majortom.model.core.ITopic other)
Method replace each type or supertype relation of the one topic by the other topic |
static void |
replaceIdentity(JdbcTopicMapStore store,
de.topicmapslab.majortom.model.core.ITopic topic,
de.topicmapslab.majortom.model.core.ITopic other)
Method mode the whole identity of the one topic to the other topic |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JdbcMergeUtils()
Method Detail |
---|
public static NameMergeCandidate detectMergeByNameCandidate(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.ITopic topic, de.topicmapslab.majortom.model.core.ITopic nameType, java.lang.String value, java.util.Collection<de.topicmapslab.majortom.model.core.ITopic> themes)
store
- the in-memory storetopic
- the topic, the name should added tonameType
- the type of the namevalue
- the name valuethemes
- a set of themes
null
public static de.topicmapslab.majortom.model.core.ITopic getDuplette(JdbcTopicMapStore store, org.tmapi.core.Topic topic, java.util.Map<TopicRef,de.topicmapslab.majortom.model.core.ITopic> references) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the topic map storetopic
- the topic with the identitiesreferences
- the references of the topic map
null
de.topicmapslab.majortom.model.exception.TopicMapStoreException
public static de.topicmapslab.majortom.model.core.IName getDuplette(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.ITopic topic, de.topicmapslab.majortom.model.core.ITopic type, java.lang.String value, java.util.Collection<de.topicmapslab.majortom.model.core.ITopic> themes) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storetopic
- the topictype
- the typevalue
- the valuethemes
- the themes of scope
null
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation failspublic static de.topicmapslab.majortom.model.core.IVariant getDuplette(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.IName name, java.lang.String value, de.topicmapslab.majortom.model.core.ILocator locator, java.util.Collection<de.topicmapslab.majortom.model.core.ITopic> themes) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storetopic
- the topicvalue
- the valuelocator
- the locator of datatypethemes
- the themes of scope
null
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation failspublic static de.topicmapslab.majortom.model.core.IOccurrence getDuplette(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.ITopic topic, de.topicmapslab.majortom.model.core.ITopic type, java.lang.String value, de.topicmapslab.majortom.model.core.ILocator locator, java.util.Collection<de.topicmapslab.majortom.model.core.ITopic> themes) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storetopic
- the topictype
- the typevalue
- the valuelocator
- the locator of datatypethemes
- the themes of scope
null
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation failspublic static de.topicmapslab.majortom.model.core.IAssociation getDuplette(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.ITopic topic, de.topicmapslab.majortom.model.core.ITopic other, de.topicmapslab.majortom.model.core.IAssociation association) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storetopic
- the one playerother
- the other playerassociation
- the other association containing all information
null
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation failspublic static de.topicmapslab.majortom.model.core.IAssociation getDuplette(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.IAssociation association, java.util.Set<de.topicmapslab.majortom.model.core.IAssociation> excluded) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storeassociation
- the association to checkexcluded
- a set of excluded associations
null
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation failspublic static void doMerge(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.ITopic topic, de.topicmapslab.majortom.model.core.ITopic other, de.topicmapslab.majortom.model.revision.IRevision revision) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storetopic
- the one topicother
- the other topicrevision
- the revision to store changes
de.topicmapslab.majortom.model.exception.TopicMapStoreException
public static void replaceIdentity(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.ITopic topic, de.topicmapslab.majortom.model.core.ITopic other) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storetopic
- the topic as targetother
- the topic as source
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation failspublic static void replaceAsTypeOrSupertype(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.ITopic topic, de.topicmapslab.majortom.model.core.ITopic other) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storetopic
- the topic as targetother
- the topic as source
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation failspublic static void replaceAsTheme(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.ITopic topic, de.topicmapslab.majortom.model.core.ITopic other) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storetopic
- the topic as targetother
- the topic as source
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation failspublic static void doMergeReifiable(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.IReifiable reifiable, de.topicmapslab.majortom.model.core.IReifiable other, de.topicmapslab.majortom.model.revision.IRevision revision) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storereifiable
- the one reified constructother
- the other reified constructrevision
- the revision to store
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation failsprivate static void mergeTopicMaps(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.ITopicMap topicMap, org.tmapi.core.TopicMap other, boolean isCopyingOperation) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storetopicMap
- the topic map as targetother
- the topic map as source
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation failspublic static void doMergeTopicMaps(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.ITopicMap topicMap, org.tmapi.core.TopicMap other) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storetopicMap
- the topic map as targetother
- the topic map as source
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation failspublic static de.topicmapslab.majortom.model.core.IScope getCorrespondingScope(JdbcTopicMapStore store, java.util.Set<org.tmapi.core.Topic> themes, java.util.Map<TopicRef,de.topicmapslab.majortom.model.core.ITopic> references)
store
- the storethemes
- the set of themesreferences
- the references of the topic map
private static boolean checkTmdmAssociation(JdbcTopicMapStore store, org.tmapi.core.Association association, de.topicmapslab.majortom.model.core.ITopicMap topicMap, org.tmapi.core.TopicMap other, java.util.Map<TopicRef,de.topicmapslab.majortom.model.core.ITopic> references) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storeassociation
- the associationtopicMap
- the topic mapother
- the other topic map
true
if the association is an TMDM association, false
otherwise.
de.topicmapslab.majortom.model.exception.TopicMapStoreException
public static void removeDuplicates(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.ITopicMap topicMap) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the topic map storetopicMap
- the topic map itself
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation failspublic static java.util.Set<de.topicmapslab.majortom.model.core.IAssociationRole> getDuplettes(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.IAssociation association, de.topicmapslab.majortom.model.core.IAssociationRole role)
store
- the storeassociation
- the associationrole
- the role
public static java.util.Set<de.topicmapslab.majortom.model.core.IAssociation> getDuplettes(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.IAssociation association) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storeassociation
- the association to check
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation failspublic static java.util.Set<de.topicmapslab.majortom.model.core.IVariant> getDuplettes(JdbcTopicMapStore store, de.topicmapslab.majortom.model.core.IName name, java.lang.String value, de.topicmapslab.majortom.model.core.ILocator locator, java.util.Collection<de.topicmapslab.majortom.model.core.ITopic> themes) throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
store
- the storetopic
- the topicvalue
- the valuelocator
- the locator of datatypethemes
- the themes of scope
null
de.topicmapslab.majortom.model.exception.TopicMapStoreException
- thrown if operation fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |