de.topicmapslab.majortom.inmemory.virtual.internal
Class VirtualReificationStore<T extends VirtualTopicMapStore>

java.lang.Object
  extended by de.topicmapslab.majortom.inmemory.store.internal.ReificationStore
      extended by de.topicmapslab.majortom.inmemory.virtual.internal.VirtualReificationStore<T>
All Implemented Interfaces:
IDataStore, IVirtualStore
Direct Known Subclasses:
LazyReificationStore

public class VirtualReificationStore<T extends VirtualTopicMapStore>
extends ReificationStore
implements IVirtualStore

Author:
Sven Krosse

Field Summary
private  org.apache.commons.collections.BidiMap removedReifications
           
 
Constructor Summary
VirtualReificationStore(T store)
           
 
Method Summary
 void close()
          Remove all items from the internal store.
 de.topicmapslab.majortom.model.core.IReifiable getReified(de.topicmapslab.majortom.model.core.ITopic reifier)
          Returns the reified item of the given reifier
 de.topicmapslab.majortom.model.core.ITopic getReifier(de.topicmapslab.majortom.model.core.IReifiable reifiable)
          Returns the current stored reifier of the given reified item.
protected  T getStore()
          Return the internal stored store instance.
protected  VirtualIdentityStore<T> getVirtualIdentityStore()
          Internal method to access the virtual-identity store
 void removeReification(de.topicmapslab.majortom.model.core.IReifiable reifiable)
          Remove the reification from the internal store.
 de.topicmapslab.majortom.model.core.IReifiable removeReifier(de.topicmapslab.majortom.model.core.ITopic reifier)
          Remove the reifier from the internal store.
 void removeVirtualConstruct(de.topicmapslab.majortom.model.core.IConstruct construct, de.topicmapslab.majortom.model.core.IConstruct newConstruct)
          Removes the virtual construct from the internal memory layer.
 void replace(de.topicmapslab.majortom.model.core.ITopic topic, de.topicmapslab.majortom.model.core.ITopic replacement, de.topicmapslab.majortom.model.revision.IRevision revision)
          Replace each reference of the given topic by the given replacement.
 de.topicmapslab.majortom.model.core.ITopic setReifier(de.topicmapslab.majortom.model.core.IReifiable reifiable, de.topicmapslab.majortom.model.core.ITopic reifier)
          Create a new relation between the given reifier and the reified construct
private  de.topicmapslab.majortom.model.core.ITopic storeOldReification(de.topicmapslab.majortom.model.core.IReifiable reifiable)
          Internal method to store old reification
private  de.topicmapslab.majortom.model.core.IReifiable storeOldReification(de.topicmapslab.majortom.model.core.ITopic reifier)
          Internal method to store old reification
 
Methods inherited from class de.topicmapslab.majortom.inmemory.store.internal.ReificationStore
getReificationMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

removedReifications

private org.apache.commons.collections.BidiMap removedReifications
Constructor Detail

VirtualReificationStore

public VirtualReificationStore(T store)
Parameters:
store -
Method Detail

close

public void close()
Remove all items from the internal store.

Specified by:
close in interface IDataStore
Overrides:
close in class ReificationStore

getVirtualIdentityStore

protected VirtualIdentityStore<T> getVirtualIdentityStore()
Internal method to access the virtual-identity store

Returns:
the virtual identity store

getStore

protected T getStore()
Return the internal stored store instance.

Overrides:
getStore in class ReificationStore
Returns:
the store the store instance

getReifier

public de.topicmapslab.majortom.model.core.ITopic getReifier(de.topicmapslab.majortom.model.core.IReifiable reifiable)
Returns the current stored reifier of the given reified item.

Overrides:
getReifier in class ReificationStore
Parameters:
reifiable - the reified item
Returns:
the reifier or null

getReified

public de.topicmapslab.majortom.model.core.IReifiable getReified(de.topicmapslab.majortom.model.core.ITopic reifier)
Returns the reified item of the given reifier

Overrides:
getReified in class ReificationStore
Parameters:
reifier - the reifier
Returns:
the reified item or null

setReifier

public de.topicmapslab.majortom.model.core.ITopic setReifier(de.topicmapslab.majortom.model.core.IReifiable reifiable,
                                                             de.topicmapslab.majortom.model.core.ITopic reifier)
Create a new relation between the given reifier and the reified construct

Overrides:
setReifier in class ReificationStore
Parameters:
reifiable - the reified construct
reifier - the reifier
Returns:
the old reifier or null

removeReification

public void removeReification(de.topicmapslab.majortom.model.core.IReifiable reifiable)
Remove the reification from the internal store.

Overrides:
removeReification in class ReificationStore
Parameters:
reifiable - reified item

storeOldReification

private de.topicmapslab.majortom.model.core.ITopic storeOldReification(de.topicmapslab.majortom.model.core.IReifiable reifiable)
Internal method to store old reification

Parameters:
reifiable - the reifiable
Returns:
the old reifier

storeOldReification

private de.topicmapslab.majortom.model.core.IReifiable storeOldReification(de.topicmapslab.majortom.model.core.ITopic reifier)
Internal method to store old reification

Parameters:
reifier - the reifier
Returns:
the old reifiable

removeReifier

public de.topicmapslab.majortom.model.core.IReifiable removeReifier(de.topicmapslab.majortom.model.core.ITopic reifier)
Remove the reifier from the internal store.

Overrides:
removeReifier in class ReificationStore
Returns:
the reified item

replace

public void replace(de.topicmapslab.majortom.model.core.ITopic topic,
                    de.topicmapslab.majortom.model.core.ITopic replacement,
                    de.topicmapslab.majortom.model.revision.IRevision revision)
Replace each reference of the given topic by the given replacement.

Specified by:
replace in interface IDataStore
Overrides:
replace in class ReificationStore
Parameters:
topic - the topic
replacement - the replacement
revision - the revision

removeVirtualConstruct

public void removeVirtualConstruct(de.topicmapslab.majortom.model.core.IConstruct construct,
                                   de.topicmapslab.majortom.model.core.IConstruct newConstruct)
Removes the virtual construct from the internal memory layer. But does not delete the construct in underlying data store.

Specified by:
removeVirtualConstruct in interface IVirtualStore
Parameters:
construct - the construct to remove
newConstruct - the new construct