|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Cache
Specifies all the operations needed to do data caching and avoid useless and slow network requests.
| Nested Class Summary | |
|---|---|
static class |
Cache.CacheableOperation
Set of operations which will be cached. |
| 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. |
| Method Detail |
|---|
void saveCitiesInfo(String data)
data - A JSON list.String retrieveCitiesInfo()
null if it wasn't found.
void saveServiceDiscovery(City city,
ServiceDiscoveryInfo serviceDiscovery)
object related to a city.
city - City related to the requested service discovery.serviceDiscovery - The obtained service discovery.ServiceDiscoveryInfo retrieveCachedServiceDiscoveryInfo(City city)
city - City of interest.
null if
it isn't cached.
void saveListOfServices(String endpointUrl,
List<Service> services)
Service objects related to an endpoint.
endpointUrl - Url of the endpoint.services - Obtained services.List<Service> retrieveCachedServiceList(String endpointUrl)
endpointUrl - Url of the endpoint.
null if they aren't cached.
void saveServiceDefinition(String endpointUrl,
String serviceCode,
ServiceDefinition serviceDefinition)
endpointUrl - Url of the endpoint.serviceCode - Code of the service.serviceDefinition - Obtained definition from the server.
ServiceDefinition retrieveCachedServiceDefinition(String endpointUrl,
String serviceCode)
endpointUrl - Url of the endpoint.serviceCode - Service code of the desired service.
null if it isn't cached.
void saveServiceRequestList(String endpointUrl,
GETServiceRequestsFilter filter,
List<ServiceRequest> requests)
endpointUrl - Url of the endpoint.filter - Filter sent to the endpoint.requests - Obtained list of requests.
List<ServiceRequest> retrieveCachedServiceRequests(String endpointUrl,
GETServiceRequestsFilter filter)
endpointUrl - Url of the endpoint.filter - The desired filter.
null if they aren't
cached.
void saveSingleServiceRequest(String endpointUrl,
String serviceRequestId,
ServiceRequest request)
endpointUrl - Url of the endpoint.serviceRequestId - Id of the requested service request.request - Obtained service request.
ServiceRequest retrieveCachedServiceRequest(String endpointUrl,
String serviceRequestId)
endpointUrl - Url of the endpoint.serviceRequestId - The service request's id.
null if it wasn't cached.void deleteCache()
void setCustomTimeToLive(Cache.CacheableOperation operation,
int timeToLiveInHours)
operation - 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 | |||||||||