Class URLRewritingPolicy
- java.lang.Object
-
- io.apiman.gateway.engine.policies.AbstractMappedPolicy<C>
-
- io.apiman.gateway.engine.policies.AbstractMappedDataPolicy<URLRewritingConfig>
-
- io.apiman.gateway.engine.policies.URLRewritingPolicy
-
- All Implemented Interfaces:
IDataPolicy,IPolicy
public class URLRewritingPolicy extends AbstractMappedDataPolicy<URLRewritingConfig>
A policy that implements URL rewriting in the body and headers of the response from a back-end API.- Author:
- eric.wittmann@redhat.com
-
-
Constructor Summary
Constructors Constructor Description URLRewritingPolicy()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoApply(ApiRequest request, IPolicyContext context, URLRewritingConfig config, IPolicyChain<ApiRequest> chain)Override this method to interact with or observe the request.protected voiddoApply(ApiResponse response, IPolicyContext context, URLRewritingConfig config, IPolicyChain<ApiResponse> chain)Apply the policy to the response.Class<URLRewritingConfig>getConfigurationClass()The class to use for JSON configuration deserializationprotected IReadWriteStream<ApiRequest>requestDataHandler(ApiRequest request, IPolicyContext context, URLRewritingConfig policyConfiguration)Subclasses must implement this.protected IReadWriteStream<ApiResponse>responseDataHandler(ApiResponse response, IPolicyContext context, URLRewritingConfig policyConfiguration)Subclasses must implement this.-
Methods inherited from class io.apiman.gateway.engine.policies.AbstractMappedDataPolicy
getRequestDataHandler, getResponseDataHandler
-
Methods inherited from class io.apiman.gateway.engine.policies.AbstractMappedPolicy
apply, apply, doProcessFailure, parseConfiguration, processFailure
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.apiman.gateway.engine.policy.IPolicy
apply, apply, parseConfiguration, processFailure
-
-
-
-
Method Detail
-
getConfigurationClass
public Class<URLRewritingConfig> getConfigurationClass()
Description copied from class:AbstractMappedPolicyThe class to use for JSON configuration deserialization- Specified by:
getConfigurationClassin classAbstractMappedPolicy<URLRewritingConfig>- Returns:
- the class
-
doApply
protected void doApply(ApiRequest request, IPolicyContext context, URLRewritingConfig config, IPolicyChain<ApiRequest> chain)
Description copied from class:AbstractMappedPolicyOverride this method to interact with or observe the request.- Overrides:
doApplyin classAbstractMappedPolicy<URLRewritingConfig>- Parameters:
request- the requestchain- the ordered policy chain- See Also:
AbstractMappedPolicy.apply(ApiResponse, IPolicyContext, Object, IPolicyChain)
-
doApply
protected void doApply(ApiResponse response, IPolicyContext context, URLRewritingConfig config, IPolicyChain<ApiResponse> chain)
Description copied from class:AbstractMappedPolicyApply the policy to the response.Override this method to interact with or observe the response.
- Overrides:
doApplyin classAbstractMappedPolicy<URLRewritingConfig>- Parameters:
response- the responsecontext- the policy contextconfig- the configuration (seeAbstractMappedPolicy.getConfigurationClass())chain- the ordered policy chain
-
requestDataHandler
protected IReadWriteStream<ApiRequest> requestDataHandler(ApiRequest request, IPolicyContext context, URLRewritingConfig policyConfiguration)
Description copied from class:AbstractMappedDataPolicySubclasses must implement this.
-
responseDataHandler
protected IReadWriteStream<ApiResponse> responseDataHandler(ApiResponse response, IPolicyContext context, URLRewritingConfig policyConfiguration)
Description copied from class:AbstractMappedDataPolicySubclasses must implement this.
-
-