public class CachingPolicy extends AbstractMappedDataPolicy<CachingConfig> implements io.apiman.gateway.engine.policy.IDataPolicy
| Constructor and Description |
|---|
CachingPolicy()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doApply(io.apiman.gateway.engine.beans.ServiceRequest request,
io.apiman.gateway.engine.policy.IPolicyContext context,
CachingConfig config,
io.apiman.gateway.engine.policy.IPolicyChain<io.apiman.gateway.engine.beans.ServiceRequest> chain)
If the request is cached an
IConnectorInterceptor is set in order to prevent the back-end connection to be established. |
protected void |
doApply(io.apiman.gateway.engine.beans.ServiceResponse response,
io.apiman.gateway.engine.policy.IPolicyContext context,
CachingConfig config,
io.apiman.gateway.engine.policy.IPolicyChain<io.apiman.gateway.engine.beans.ServiceResponse> chain)
Apply the policy to the response.
|
protected Class<CachingConfig> |
getConfigurationClass() |
protected io.apiman.gateway.engine.io.IReadWriteStream<io.apiman.gateway.engine.beans.ServiceRequest> |
requestDataHandler(io.apiman.gateway.engine.beans.ServiceRequest request,
io.apiman.gateway.engine.policy.IPolicyContext context,
CachingConfig policyConfiguration)
Subclasses must implement this.
|
protected io.apiman.gateway.engine.io.IReadWriteStream<io.apiman.gateway.engine.beans.ServiceResponse> |
responseDataHandler(io.apiman.gateway.engine.beans.ServiceResponse response,
io.apiman.gateway.engine.policy.IPolicyContext context,
CachingConfig policyConfiguration)
Subclasses must implement this.
|
getRequestDataHandler, getResponseDataHandlerapply, apply, parseConfigurationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected Class<CachingConfig> getConfigurationClass()
getConfigurationClass in class AbstractMappedPolicy<CachingConfig>io.apiman.gateway.engine.policy.AbstractPolicy#getConfigurationClass()protected void doApply(io.apiman.gateway.engine.beans.ServiceRequest request,
io.apiman.gateway.engine.policy.IPolicyContext context,
CachingConfig config,
io.apiman.gateway.engine.policy.IPolicyChain<io.apiman.gateway.engine.beans.ServiceRequest> chain)
IConnectorInterceptor is set in order to prevent the back-end connection to be established.
Otherwise an empty CachedResponse will be added to the context, this will be used to cache the response once it has been
received from the back-end serviceprotected void doApply(io.apiman.gateway.engine.beans.ServiceResponse response,
io.apiman.gateway.engine.policy.IPolicyContext context,
CachingConfig config,
io.apiman.gateway.engine.policy.IPolicyChain<io.apiman.gateway.engine.beans.ServiceResponse> chain)
AbstractMappedPolicydoApply in class AbstractMappedPolicy<CachingConfig>AbstractMappedPolicy.doApply(ServiceResponse, IPolicyContext, Object, IPolicyChain)protected io.apiman.gateway.engine.io.IReadWriteStream<io.apiman.gateway.engine.beans.ServiceRequest> requestDataHandler(io.apiman.gateway.engine.beans.ServiceRequest request,
io.apiman.gateway.engine.policy.IPolicyContext context,
CachingConfig policyConfiguration)
AbstractMappedDataPolicyprotected io.apiman.gateway.engine.io.IReadWriteStream<io.apiman.gateway.engine.beans.ServiceResponse> responseDataHandler(io.apiman.gateway.engine.beans.ServiceResponse response,
io.apiman.gateway.engine.policy.IPolicyContext context,
CachingConfig policyConfiguration)
AbstractMappedDataPolicyCopyright © 2015 JBoss, a division of Red Hat. All rights reserved.