org.codeforamerica.open311.internals.caching
Class RegularJavaCache

java.lang.Object
  extended by org.codeforamerica.open311.internals.caching.AbstractCache
      extended by org.codeforamerica.open311.internals.caching.RegularJavaCache
All Implemented Interfaces:
Cache

public class RegularJavaCache
extends AbstractCache

Basic implementation of the Cache interface. It uses a properties file to save the data. Singleton class.

Author:
Santiago MunĂ­n

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.codeforamerica.open311.internals.caching.Cache
Cache.CacheableOperation
 
Field Summary
 
Fields inherited from class org.codeforamerica.open311.internals.caching.AbstractCache
FILE
 
Method Summary
 void deleteCache()
          Deletes the cache.
static RegularJavaCache getInstance()
          Returns the unique instance of the class.
protected  String getProperty(String key)
          Retrieves a property.
protected  void saveProperty(String key, String value)
          Saves a property.
 
Methods inherited from class org.codeforamerica.open311.internals.caching.AbstractCache
retrieveCachedServiceDefinition, retrieveCachedServiceDiscoveryInfo, retrieveCachedServiceList, retrieveCachedServiceRequest, retrieveCachedServiceRequests, retrieveCitiesInfo, saveCitiesInfo, saveListOfServices, saveServiceDefinition, saveServiceDiscovery, saveServiceRequestList, saveSingleServiceRequest, setCustomTimeToLive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RegularJavaCache getInstance()
Returns the unique instance of the class.


saveProperty

protected void saveProperty(String key,
                            String value)
Description copied from class: AbstractCache
Saves a property. The given parameters must be valid strings with content (empty or null strings are not allowed).

Specified by:
saveProperty in class AbstractCache
Parameters:
key - Key of the property.
value - Value of the property.

getProperty

protected String getProperty(String key)
Description copied from class: AbstractCache
Retrieves a property.

Specified by:
getProperty in class AbstractCache
Parameters:
key - Key of the property (empty or null strings are not allowed).
Returns:
The property value of null if the key doesn't exist.

deleteCache

public void deleteCache()
Description copied from interface: Cache
Deletes the cache.



Copyright © 2013 Code for America. All Rights Reserved.