org.schemarepo
Class InMemorySchemaEntryCache

java.lang.Object
  extended by org.schemarepo.InMemorySchemaEntryCache
All Implemented Interfaces:
SchemaEntryCache

public class InMemorySchemaEntryCache
extends Object
implements SchemaEntryCache

An unbounded in memory SchemaEntryCache that never evicts any values;


Nested Class Summary
static class InMemorySchemaEntryCache.Factory
           
 
Constructor Summary
InMemorySchemaEntryCache()
           
 
Method Summary
 SchemaEntry add(SchemaEntry entry)
          Add the schema entry to this cache.
 SchemaEntry lookupById(String id)
          Look up a schema entry by its id.
 SchemaEntry lookupBySchema(String schema)
          Look up a schema entry by its full string form.
 Iterable<SchemaEntry> values()
          return all of the values in this cache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemorySchemaEntryCache

public InMemorySchemaEntryCache()
Method Detail

lookupBySchema

public SchemaEntry lookupBySchema(String schema)
Description copied from interface: SchemaEntryCache
Look up a schema entry by its full string form. Thread-safe.

Specified by:
lookupBySchema in interface SchemaEntryCache

lookupById

public SchemaEntry lookupById(String id)
Description copied from interface: SchemaEntryCache
Look up a schema entry by its id. Thread-safe.

Specified by:
lookupById in interface SchemaEntryCache

add

public SchemaEntry add(SchemaEntry entry)
Description copied from interface: SchemaEntryCache
Add the schema entry to this cache.

Specified by:
add in interface SchemaEntryCache
Parameters:
entry - schema entry to add. If the provided entry is null, returns null;
Returns:
the SchemaEntry that is in the cache after the call completes. If the entry already exists the pre-existing value is returned, otherwise the value returned is the entry provided. If the provided entry is null, returns null. Thread-safe.

values

public Iterable<SchemaEntry> values()
return all of the values in this cache



Copyright © 2015. All rights reserved.