Package edu.uiuc.ncsa.security.storage
Class IndexedStreamStore<V extends Identifiable>
- java.lang.Object
- 
- edu.uiuc.ncsa.security.storage.IndexedStreamStore<V>
 
- 
- All Implemented Interfaces:
- Store<V>,- Map<Identifier,V>
 - Direct Known Subclasses:
- FileStore
 
 public abstract class IndexedStreamStore<V extends Identifiable> extends Object implements Store<V> A high-level class for storing things to streams. Implementations must produce the streams. These streams must be storable and retrievable by a key or identifier (being a store, this is required) and allow for retrieving streams based on other keys as well, which are simple hash strings of the identifier. A simple example would be a file system where each file has a name (a hash of the identifier) and then several other strings are used to create unique index entries. The index entries are named by hashes of the new key and their content is a simple string with the identifier in it.
 Note that this will try to convert the objects to XML using a supplied converter. Failing this, it will default to java object serialization.Created by Jeff Gaynor 
 on 4/25/12 at 10:54 AM
- 
- 
Field SummaryFields Modifier and Type Field Description protected MapConverter<V>converterprotected IdentifiableProvider<V>identifiableProviderprotected Initializableinitializer- 
Fields inherited from interface edu.uiuc.ncsa.security.core.StoreVERSION_TAG
 
- 
 - 
Constructor SummaryConstructors Constructor Description IndexedStreamStore()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Vcreate()Create a new object of the given type.protected voidcreateIndexEntry(String otherKey, String identifier, OutputStream outputStream)HashMap<Identifier,V>getCreatedItems()A hash map of items created by this store.protected StringhashString(String identifier)booleanisEmpty()protected VloadStream(InputStream fis)Vput(Identifier key, V value)protected voidput(V t)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.util.Mapclear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
 - 
Methods inherited from interface edu.uiuc.ncsa.security.core.StoregetAll, getMostRecent, getXMLConverter, register, remove, removeByID, save, search, search, search, search, size, update, update
 
- 
 
- 
- 
- 
Field Detail- 
converterprotected MapConverter<V extends Identifiable> converter 
 - 
identifiableProviderprotected IdentifiableProvider<V extends Identifiable> identifiableProvider 
 - 
initializerprotected Initializable initializer 
 
- 
 - 
Method Detail- 
getCreatedItemspublic HashMap<Identifier,V> getCreatedItems() A hash map of items created by this store. You should keep track of every item created and if an item already exists return that.- Returns:
- returns created items.
 
 - 
putprotected void put(V t) 
 - 
putpublic V put(Identifier key, V value) - Specified by:
- putin interface- Map<Identifier,V extends Identifiable>
 
 - 
loadStreamprotected V loadStream(InputStream fis) throws IOException - Throws:
- IOException
 
 - 
isEmptypublic boolean isEmpty() - Specified by:
- isEmptyin interface- Map<Identifier,V extends Identifiable>
 
 - 
createIndexEntryprotected void createIndexEntry(String otherKey, String identifier, OutputStream outputStream) throws IOException - Throws:
- IOException
 
 - 
createpublic V create() Description copied from interface:StoreCreate a new object of the given type. This is not in the store until it is registered. Attempts to update the object should throw an exception. Note that this allows for a separation of creation semantics. Some objects require specific initialization before saving- Specified by:
- createin interface- Store<V extends Identifiable>
- Returns:
 
 
- 
 
-