|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codeforamerica.open311.internals.caching.NoCache
public class NoCache
This class is a special implementation of the Cache interface which
is useful if you don't want to do caching.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.codeforamerica.open311.internals.caching.Cache |
|---|
Cache.CacheableOperation |
| Constructor Summary | |
|---|---|
NoCache()
|
|
| Method Summary | |
|---|---|
void |
deleteCache()
Deletes the cache. |
ServiceDefinition |
retrieveCachedServiceDefinition(String endpointUrl,
String serviceCode)
Looks for a cached service definition. |
ServiceDiscoveryInfo |
retrieveCachedServiceDiscoveryInfo(City city)
Looks for the service discovery of a given city in the local cache. |
List<Service> |
retrieveCachedServiceList(String endpointUrl)
Looks for a cached list of services. |
ServiceRequest |
retrieveCachedServiceRequest(String endpointUrl,
String serviceRequestId)
Looks for a cached GET service request response. |
List<ServiceRequest> |
retrieveCachedServiceRequests(String endpointUrl,
GETServiceRequestsFilter filter)
Looks for a cached GET service requests response. |
String |
retrieveCitiesInfo()
Looks for the endpoints-service discovery relationships. |
void |
saveCitiesInfo(String data)
Saves the endpoints-service discovery relationships. |
void |
saveListOfServices(String endpointUrl,
List<Service> services)
Saves a list of Service objects related to an endpoint. |
void |
saveServiceDefinition(String endpointUrl,
String serviceCode,
ServiceDefinition serviceDefinition)
Saves a service definition. |
void |
saveServiceDiscovery(City city,
ServiceDiscoveryInfo serviceDiscovery)
Saves a object related to a city. |
void |
saveServiceRequestList(String endpointUrl,
GETServiceRequestsFilter filter,
List<ServiceRequest> requests)
Saves a list of service requests. |
void |
saveSingleServiceRequest(String endpointUrl,
String serviceRequestId,
ServiceRequest request)
Saves a service request. |
void |
setCustomTimeToLive(Cache.CacheableOperation operation,
int timeToLiveInHours)
Set a custom time to live to a given operation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NoCache()
| Method Detail |
|---|
public void saveCitiesInfo(String data)
Cache
saveCitiesInfo in interface Cachedata - A JSON list.public String retrieveCitiesInfo()
Cache
retrieveCitiesInfo in interface Cachenull if it wasn't found.
public void saveServiceDiscovery(City city,
ServiceDiscoveryInfo serviceDiscovery)
Cacheobject related to a city.
saveServiceDiscovery in interface Cachecity - City related to the requested service discovery.serviceDiscovery - The obtained service discovery.public ServiceDiscoveryInfo retrieveCachedServiceDiscoveryInfo(City city)
Cache
retrieveCachedServiceDiscoveryInfo in interface Cachecity - City of interest.
null if
it isn't cached.
public void saveListOfServices(String endpointUrl,
List<Service> services)
CacheService objects related to an endpoint.
saveListOfServices in interface CacheendpointUrl - Url of the endpoint.services - Obtained services.public List<Service> retrieveCachedServiceList(String endpointUrl)
Cache
retrieveCachedServiceList in interface CacheendpointUrl - Url of the endpoint.
null if they aren't cached.
public void saveServiceDefinition(String endpointUrl,
String serviceCode,
ServiceDefinition serviceDefinition)
Cache
saveServiceDefinition in interface CacheendpointUrl - Url of the endpoint.serviceCode - Code of the service.serviceDefinition - Obtained definition from the server.
public ServiceDefinition retrieveCachedServiceDefinition(String endpointUrl,
String serviceCode)
Cache
retrieveCachedServiceDefinition in interface CacheendpointUrl - Url of the endpoint.serviceCode - Service code of the desired service.
null if it isn't cached.
public void saveServiceRequestList(String endpointUrl,
GETServiceRequestsFilter filter,
List<ServiceRequest> requests)
Cache
saveServiceRequestList in interface CacheendpointUrl - Url of the endpoint.filter - Filter sent to the endpoint.requests - Obtained list of requests.
public List<ServiceRequest> retrieveCachedServiceRequests(String endpointUrl,
GETServiceRequestsFilter filter)
Cache
retrieveCachedServiceRequests in interface CacheendpointUrl - Url of the endpoint.filter - The desired filter.
null if they aren't
cached.
public void saveSingleServiceRequest(String endpointUrl,
String serviceRequestId,
ServiceRequest request)
Cache
saveSingleServiceRequest in interface CacheendpointUrl - Url of the endpoint.serviceRequestId - Id of the requested service request.request - Obtained service request.
public ServiceRequest retrieveCachedServiceRequest(String endpointUrl,
String serviceRequestId)
Cache
retrieveCachedServiceRequest in interface CacheendpointUrl - Url of the endpoint.serviceRequestId - The service request's id.
null if it wasn't cached.public void deleteCache()
Cache
deleteCache in interface Cache
public void setCustomTimeToLive(Cache.CacheableOperation operation,
int timeToLiveInHours)
Cache
setCustomTimeToLive in interface Cacheoperation - Operation which time to live will be changed.timeToLiveInHours - New time to live (in hours).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||