refactor(gateway-engine): wire up quota policy for policy probes
MODIFY
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/QuotaPolicy.java
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/QuotaPolicy.java
*/
package io.apiman.gateway.engine.policies;
+import io.apiman.gateway.engine.beans.ApiRequest;
import io.apiman.gateway.engine.beans.PolicyFailure;
import io.apiman.gateway.engine.beans.PolicyFailureType;
-import io.apiman.gateway.engine.beans.ApiRequest;
import io.apiman.gateway.engine.components.IPolicyFailureFactoryComponent;
import io.apiman.gateway.engine.policies.config.RateLimitingConfig;
import io.apiman.gateway.engine.policies.i18n.Messages;
+import io.apiman.gateway.engine.policies.probe.RateLimitingProbeConfig;
+import io.apiman.gateway.engine.policy.IPolicyProbe;
/**
* Similar to the rate limiting policy, but less granular. Useful primarily
@@ -28,7 +30,8 @@ import io.apiman.gateway.engine.policies.i18n.Messages;
*
* @author eric.wittmann@redhat.com
*/
-public class QuotaPolicy extends RateLimitingPolicy {
+public class QuotaPolicy extends RateLimitingPolicy
+ implements IPolicyProbe<RateLimitingConfig, RateLimitingProbeConfig> {
private static final String DEFAULT_LIMIT_HEADER = "X-Quota-Limit"; //$NON-NLS-1$
private static final String DEFAULT_REMAINING_HEADER = "X-Quota-Remaining"; //$NON-NLS-1$

DELETE
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/probe/PlaceholderProbeConfig.java
-package io.apiman.gateway.engine.policies.probe;
-
-import io.apiman.gateway.engine.beans.IPolicyProbeRequest;
-
-/**
- * @author Marc Savy {@literal <marc@blackparrotlabs.io>}
- */
-public class PlaceholderProbeConfig implements IPolicyProbeRequest {
-
-}

DELETE
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/probe/PlaceholderProbeResponse.java
-package io.apiman.gateway.engine.policies.probe;
-
-import io.apiman.gateway.engine.beans.IPolicyProbeResponse;
-import io.apiman.gateway.engine.components.rate.RateLimitResponse;
-
-/**
- * @author Marc Savy {@literal <marc@blackparrotlabs.io>}
- */
-public class PlaceholderProbeResponse implements IPolicyProbeResponse {
-
- private RateLimitResponse rateLimitResponse;
-
- public PlaceholderProbeResponse() {
- }
-
- public PlaceholderProbeResponse setRateLimitResponse(RateLimitResponse rateLimitResponse) {
- this.rateLimitResponse = rateLimitResponse;
- return this;
- }
-
- public RateLimitResponse getRateLimitResponse() {
- return rateLimitResponse;
- }
-
- @Override
- public String getProbeType() {
- return PlaceholderProbeResponse.class.getName();
- }
-}

refactor(gateway-engine): wire up quota policy for policy probes