public class CachingESRegistry extends ESRegistry
ESRegistry to provide single-node caching. This caching solution
will not work in a cluster. If looking for cluster support, either go with the core
ESRegistry or find/implement a caching registry that works in a cluster (e.g. leverage
jgroups?).| Constructor and Description |
|---|
CachingESRegistry(Map<String,String> config)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
cacheApplication(io.apiman.gateway.engine.beans.Application application) |
protected void |
cacheService(io.apiman.gateway.engine.beans.Service service)
Called to cache the service for fast lookup later.
|
protected void |
decacheApplication(io.apiman.gateway.engine.beans.Application application) |
protected void |
decacheService(io.apiman.gateway.engine.beans.Service service) |
void |
getContract(io.apiman.gateway.engine.beans.ServiceRequest request,
io.apiman.gateway.engine.async.IAsyncResultHandler<io.apiman.gateway.engine.beans.ServiceContract> handler) |
void |
getService(String organizationId,
String serviceId,
String serviceVersion,
io.apiman.gateway.engine.async.IAsyncResultHandler<io.apiman.gateway.engine.beans.Service> handler) |
protected void |
invalidateCache()
Called to invalidate the cache - clearing it so that subsequent calls to getService()
or getContract() will trigger a new fetch from the ES store.
|
protected void |
loadAndCacheApp(io.apiman.gateway.engine.beans.Application application) |
void |
publishService(io.apiman.gateway.engine.beans.Service service,
io.apiman.gateway.engine.async.IAsyncResultHandler<Void> handler) |
void |
registerApplication(io.apiman.gateway.engine.beans.Application application,
io.apiman.gateway.engine.async.IAsyncResultHandler<Void> handler) |
void |
retireService(io.apiman.gateway.engine.beans.Service service,
io.apiman.gateway.engine.async.IAsyncResultHandler<Void> handler) |
void |
unregisterApplication(io.apiman.gateway.engine.beans.Application application,
io.apiman.gateway.engine.async.IAsyncResultHandler<Void> handler) |
checkService, getIndexName, getService, unregisterServiceContractsgetClientprotected void invalidateCache()
public void publishService(io.apiman.gateway.engine.beans.Service service,
io.apiman.gateway.engine.async.IAsyncResultHandler<Void> handler)
publishService in interface io.apiman.gateway.engine.IRegistrypublishService in class ESRegistryESRegistry.publishService(io.apiman.gateway.engine.beans.Service, io.apiman.gateway.engine.async.IAsyncResultHandler)public void registerApplication(io.apiman.gateway.engine.beans.Application application,
io.apiman.gateway.engine.async.IAsyncResultHandler<Void> handler)
registerApplication in interface io.apiman.gateway.engine.IRegistryregisterApplication in class ESRegistryESRegistry.registerApplication(io.apiman.gateway.engine.beans.Application, io.apiman.gateway.engine.async.IAsyncResultHandler)public void retireService(io.apiman.gateway.engine.beans.Service service,
io.apiman.gateway.engine.async.IAsyncResultHandler<Void> handler)
retireService in interface io.apiman.gateway.engine.IRegistryretireService in class ESRegistryESRegistry.retireService(io.apiman.gateway.engine.beans.Service, io.apiman.gateway.engine.async.IAsyncResultHandler)public void unregisterApplication(io.apiman.gateway.engine.beans.Application application,
io.apiman.gateway.engine.async.IAsyncResultHandler<Void> handler)
unregisterApplication in interface io.apiman.gateway.engine.IRegistryunregisterApplication in class ESRegistryESRegistry.unregisterApplication(io.apiman.gateway.engine.beans.Application, io.apiman.gateway.engine.async.IAsyncResultHandler)public void getContract(io.apiman.gateway.engine.beans.ServiceRequest request,
io.apiman.gateway.engine.async.IAsyncResultHandler<io.apiman.gateway.engine.beans.ServiceContract> handler)
getContract in interface io.apiman.gateway.engine.IRegistrygetContract in class ESRegistryESRegistry.getContract(io.apiman.gateway.engine.beans.ServiceRequest, io.apiman.gateway.engine.async.IAsyncResultHandler)public void getService(String organizationId, String serviceId, String serviceVersion, io.apiman.gateway.engine.async.IAsyncResultHandler<io.apiman.gateway.engine.beans.Service> handler)
getService in interface io.apiman.gateway.engine.IRegistrygetService in class ESRegistryESRegistry.getService(java.lang.String, java.lang.String, java.lang.String, io.apiman.gateway.engine.async.IAsyncResultHandler)protected void cacheService(io.apiman.gateway.engine.beans.Service service)
service - protected void cacheApplication(io.apiman.gateway.engine.beans.Application application)
application - protected void loadAndCacheApp(io.apiman.gateway.engine.beans.Application application)
application - protected void decacheService(io.apiman.gateway.engine.beans.Service service)
service - protected void decacheApplication(io.apiman.gateway.engine.beans.Application application)
application - Copyright © 2015 JBoss, a division of Red Hat. All rights reserved.