de.topicmapslab.majortom.inmemory.transaction.internal
Class LazyIdentityStore

java.lang.Object
  extended by de.topicmapslab.majortom.inmemory.store.internal.IdentityStore
      extended by de.topicmapslab.majortom.inmemory.virtual.internal.VirtualIdentityStore<InMemoryTransactionTopicMapStore>
          extended by de.topicmapslab.majortom.inmemory.transaction.internal.LazyIdentityStore
All Implemented Interfaces:
IDataStore, IVirtualStore

public class LazyIdentityStore
extends VirtualIdentityStore<InMemoryTransactionTopicMapStore>

Author:
Sven Krosse

Field Summary
private  java.util.Set<de.topicmapslab.majortom.model.core.IScope> lazyScopes
           
private  java.util.Map<java.lang.String,de.topicmapslab.majortom.model.core.IConstruct> lazyStubs
           
 
Fields inherited from class de.topicmapslab.majortom.inmemory.store.internal.IdentityStore
capacity
 
Constructor Summary
LazyIdentityStore(InMemoryTransactionTopicMapStore store, int capacity)
          constructor
 
Method Summary
<X extends de.topicmapslab.majortom.model.core.IConstruct>
X
asVirtualConstruct(X c)
          Creates a virtual stub of the given construct
 de.topicmapslab.majortom.model.core.IScope asVirtualScope(de.topicmapslab.majortom.model.core.IScope scope)
          Creates a virtual stub of the given scope
 void close()
          Remove all items from the internal store.
 void setId(de.topicmapslab.majortom.model.core.IConstruct c, java.lang.String id)
          Register the id for the given construct
 
Methods inherited from class de.topicmapslab.majortom.inmemory.virtual.internal.VirtualIdentityStore
addItemIdentifer, addSubjectIdentifier, addSubjectLocator, byId, byItemIdentifier, bySubjectIdentifier, bySubjectLocator, getItemIdentifiers, getStore, getSubjectIdentifiers, getSubjectLocators, getTopics, isRemovedConstruct, isRemovedScope, isVirtual, isVirtual, removeConstruct, removeItemIdentifer, removeSubjectIdentifier, removeSubjectLocator, removeTopic, removeVirtualConstruct, setVirtual
 
Methods inherited from class de.topicmapslab.majortom.inmemory.store.internal.IdentityStore
containsConstruct, containsIdentifier, containsItemIdentifier, containsItemIdentifiers, containsSubjectIdentifier, containsSubjectIdentifiers, containsSubjectLocator, containsSubjectLocators, createLocator, getConstructItemIdentitiersMap, getIdentifiers, getIdsMap, getItemIdentifiers, getItemIdentifiersMap, getSubjectIdentifiers, getSubjectIdentitifersMap, getSubjectLocators, getSubjectLocatorsMap, getTopicsSet, getTopicSubjectIdentifiersMap, getTopicSubjectLocatorsMap, removeId, replace, replace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.topicmapslab.majortom.inmemory.store.model.IDataStore
replace
 

Field Detail

lazyStubs

private java.util.Map<java.lang.String,de.topicmapslab.majortom.model.core.IConstruct> lazyStubs

lazyScopes

private java.util.Set<de.topicmapslab.majortom.model.core.IScope> lazyScopes
Constructor Detail

LazyIdentityStore

public LazyIdentityStore(InMemoryTransactionTopicMapStore store,
                         int capacity)
constructor

Parameters:
store - the parent store
capacity - the capacity of internal sets
Method Detail

setId

public void setId(de.topicmapslab.majortom.model.core.IConstruct c,
                  java.lang.String id)
Register the id for the given construct

Overrides:
setId in class VirtualIdentityStore<InMemoryTransactionTopicMapStore>
Parameters:
c - the construct
id - the id

asVirtualConstruct

public <X extends de.topicmapslab.majortom.model.core.IConstruct> X asVirtualConstruct(X c)
                                                                            throws de.topicmapslab.majortom.model.exception.ConstructRemovedException
Creates a virtual stub of the given construct

Overrides:
asVirtualConstruct in class VirtualIdentityStore<InMemoryTransactionTopicMapStore>
Parameters:
c - the construct
Returns:
the virtual stub
Throws:
de.topicmapslab.majortom.model.exception.ConstructRemovedException - thrown if the id of the given construct is marked as removed

asVirtualScope

public de.topicmapslab.majortom.model.core.IScope asVirtualScope(de.topicmapslab.majortom.model.core.IScope scope)
                                                          throws de.topicmapslab.majortom.model.exception.ConstructRemovedException
Creates a virtual stub of the given scope

Overrides:
asVirtualScope in class VirtualIdentityStore<InMemoryTransactionTopicMapStore>
Parameters:
scope - the scope
Returns:
the virtual stub
Throws:
de.topicmapslab.majortom.model.exception.ConstructRemovedException - thrown if at least one contained theme is marked as removed

close

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

Specified by:
close in interface IDataStore
Overrides:
close in class VirtualIdentityStore<InMemoryTransactionTopicMapStore>