feat(3scale-registry): Add several new configurations options, including defaults.
MODIFY
gateway/engine/vertx-polling/src/main/java/io/apiman/gateway/engine/vertx/polling/ThreeScaleURILoadingRegistry.java
gateway/engine/vertx-polling/src/main/java/io/apiman/gateway/engine/vertx/polling/ThreeScaleURILoadingRegistry.java
@@ -30,8 +30,9 @@ import io.apiman.gateway.engine.vertx.polling.fetchers.AccessTokenResourceFetche
import io.apiman.gateway.engine.vertx.polling.fetchers.FileResourceFetcher;
import io.apiman.gateway.engine.vertx.polling.fetchers.HttpResourceFetcher;
import io.apiman.gateway.engine.vertx.polling.fetchers.threescale.beans.Auth3ScaleBean;
-import io.apiman.gateway.engine.vertx.polling.fetchers.threescale.beans.Content;
+import io.apiman.gateway.engine.vertx.polling.fetchers.threescale.beans.BackendConfiguration;
import io.apiman.gateway.engine.vertx.polling.fetchers.threescale.beans.ProxyConfigRoot;
+import io.apiman.gateway.engine.vertx.polling.fetchers.threescale.beans.RateLimitingStrategy;
import io.apiman.gateway.engine.vertx.polling.fetchers.threescale.beans.Service;
import io.apiman.gateway.engine.vertx.polling.fetchers.threescale.beans.ServicesRoot;
import io.apiman.gateway.platforms.vertx3.common.verticles.Json;
@@ -63,16 +64,18 @@ import java.util.stream.Collectors;
* <ul>
* <li>accessToken: 3scale access token</li>
* <li>apiEndpoint: 3scale API endpoint</li>
- * <li>environment: which environment (e.g. production, staging)</li>
+ * <li>environment: which environment (e.g. production, staging). <em>Default: production</em></li>
* <li>policyConfigUri: apiman policy config to load as JSON from file
* ({@link FileResourceFetcher}) or HTTP/S ({@link HttpResourceFetcher}). See the corresponding
* fetcher for additional options.</li>
* <li>orgName: 3scale does not presently support multi-tenanted namespacing within a single
* gateway, so a default namespace is used internally (reflected in metrics, etc). <em>Does
- * not</em> impact the path used to call the gateway <em>Default: apiman</em></li>
+ * not</em> impact the path used to call the gateway <em>Default: {@value #DEFAULT_ORGNAME}</em></li>
* <li>version: 3scale does not presently support versioning, so a default version is used
* internally (reflected in metrics, etc). <em>Does not</em> impact the path used to call the
- * gateway <em>Default: 1.0</em></li>
+ * gateway <em>Default: {@value #DEFAULT_VERSION}</em></li>
+ * <li>strategy: Various strategies for auth and reporting: See {@link RateLimitingStrategy}</li>
+ * <li>backendEndpoint: 3scale backend endpoint. <em>Default: {@value #DEFAULT_BACKEND}</em></li>
* </ul>
*
* <p>
@@ -88,6 +91,7 @@ import java.util.stream.Collectors;
public class ThreeScaleURILoadingRegistry extends InMemoryRegistry implements AsyncInitialize {
public static final String DEFAULT_ORGNAME = "apiman";
public static final String DEFAULT_VERSION = "1.0";
+ public static final String DEFAULT_BACKEND = "https://su1.3scale.net:443";
private static volatile OneShotURILoader instance;
private Vertx vertx;
@@ -164,30 +168,34 @@ public class ThreeScaleURILoadingRegistry extends InMemoryRegistry implements As
private static final class OneShotURILoader {
private Vertx vertx;
- private URI apiUri;
private URI policyConfigUri;
private Map<String, String> config;
+ private IAsyncHandler<Void> reloadHandler;
private List<IAsyncResultHandler<Void>> failureHandlers = new ArrayList<>();
private Deque<ThreeScaleURILoadingRegistry> awaiting = new ArrayDeque<>();
private List<ThreeScaleURILoadingRegistry> allRegistries = new ArrayList<>();
+ private List<Api> policyConfigApis = Collections.emptyList();
private boolean dataProcessed = false;
private List<Auth3ScaleBean> configs = new ArrayList<>();
private List<Client> clients = new ArrayList<>();
private List<Api> apis = new ArrayList<>();
private Logger log = LoggerFactory.getLogger(OneShotURILoader.class);
- private IAsyncHandler<Void> reloadHandler;
- private List<Api> policyConfigApis = Collections.emptyList();
- private String environment;
- private String defaultOrgName;
- private String defaultVersion;
+ private final String defaultOrgName;
+ private final String defaultVersion;
+ private final RateLimitingStrategy strategy;
+ private final URI apiUri;
+ private final String environment;
+ private final String backendEndpoint;
public OneShotURILoader(Vertx vertx, Map<String, String> config) {
this.config = config;
this.vertx = vertx;
this.defaultOrgName = config.getOrDefault("defaultOrgName", DEFAULT_ORGNAME);
this.defaultVersion = config.getOrDefault("defaultVersion", DEFAULT_VERSION);
+ this.strategy = RateLimitingStrategy.valueOfOrDefault(config.get("strategy"), RateLimitingStrategy.STANDARD);
this.apiUri = URI.create(requireOpt("apiEndpoint", "apiEndpoint is required in configuration"));
this.environment = config.getOrDefault("environment", "production");
+ this.backendEndpoint = config.getOrDefault("backendEndpoint", DEFAULT_BACKEND);
if (config.containsKey("policyConfigUri")) {
this.policyConfigUri = URI.create(config.get("policyConfigUri")); // Can be null.
@@ -274,7 +282,9 @@ public class ThreeScaleURILoadingRegistry extends InMemoryRegistry implements As
Auth3ScaleBean bean = new Auth3ScaleBean()
.setThreescaleConfig(pc)
.setDefaultOrg(defaultOrgName)
- .setDefaultVersion(defaultVersion);
+ .setDefaultVersion(defaultVersion)
+ .setRateLimitingStrategy(strategy)
+ .setBackendEndpoint(backendEndpoint);
configs.add(bean);
}
future.complete();
@@ -311,7 +321,7 @@ public class ThreeScaleURILoadingRegistry extends InMemoryRegistry implements As
// Naive version initially.
for (Auth3ScaleBean bean : configs) {
// Reflects the remote data structure.
- Content config = bean.getThreescaleConfig().getProxyConfig().getContent();
+ BackendConfiguration config = bean.getThreescaleConfig().getProxyConfig().getBackendConfig();
Api api = new Api();
api.setApiId(config.getSystemName());
api.setOrganizationId(defaultOrgName);

MODIFY
gateway/engine/vertx-polling/src/main/java/io/apiman/gateway/engine/vertx/polling/fetchers/threescale/beans/Auth3ScaleBean.java
gateway/engine/vertx-polling/src/main/java/io/apiman/gateway/engine/vertx/polling/fetchers/threescale/beans/Auth3ScaleBean.java
@@ -19,8 +19,6 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
- * Does nothing (yet).
- *
* @author Marc Savy {@literal <msavy@redhat.com>}
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@@ -29,6 +27,8 @@ public class Auth3ScaleBean {
private ProxyConfigRoot threescaleConfig;
private String defaultOrg;
private String defaultVersion;
+ private RateLimitingStrategy rateLimitingStrategy = RateLimitingStrategy.STANDARD;
+ private String backendEndpoint;
public ProxyConfigRoot getThreescaleConfig() {
return threescaleConfig;
@@ -56,4 +56,22 @@ public class Auth3ScaleBean {
this.defaultVersion = defaultVersion;
return this;
}
+
+ public RateLimitingStrategy getRateLimitingStrategy() {
+ return rateLimitingStrategy;
+ }
+
+ public Auth3ScaleBean setRateLimitingStrategy(RateLimitingStrategy rateLimitingStrategy) {
+ this.rateLimitingStrategy = rateLimitingStrategy;
+ return this;
+ }
+
+ public String getBackendEndpoint() {
+ return backendEndpoint;
+ }
+
+ public Auth3ScaleBean setBackendEndpoint(String backendEndpoint) {
+ this.backendEndpoint = backendEndpoint;
+ return this;
+ }
}

RENAME
gateway/engine/vertx-polling/src/main/java/io/apiman/gateway/engine/vertx/polling/fetchers/threescale/beans/Content.java
gateway/engine/vertx-polling/src/main/java/io/apiman/gateway/engine/vertx/polling/fetchers/threescale/beans/BackendConfiguration.java
@@ -67,10 +67,9 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
"backend_authentication_value",
"proxy"
})
-public class Content implements Serializable
+public class BackendConfiguration implements Serializable
{
- private RateLimitingStrategy rateLimitingStrategy = RateLimitingStrategy.STANDARD;
@JsonProperty("id")
private long id;
@JsonProperty("account_id")
@@ -175,7 +174,7 @@ public class Content implements Serializable
this.id = id;
}
- public Content withId(long id) {
+ public BackendConfiguration withId(long id) {
this.id = id;
return this;
}
@@ -190,7 +189,7 @@ public class Content implements Serializable
this.accountId = accountId;
}
- public Content withAccountId(long accountId) {
+ public BackendConfiguration withAccountId(long accountId) {
this.accountId = accountId;
return this;
}
@@ -205,7 +204,7 @@ public class Content implements Serializable
this.name = name;
}
- public Content withName(String name) {
+ public BackendConfiguration withName(String name) {
this.name = name;
return this;
}
@@ -220,7 +219,7 @@ public class Content implements Serializable
this.onelineDescription = onelineDescription;
}
- public Content withOnelineDescription(String onelineDescription) {
+ public BackendConfiguration withOnelineDescription(String onelineDescription) {
this.onelineDescription = onelineDescription;
return this;
}
@@ -235,7 +234,7 @@ public class Content implements Serializable
this.description = description;
}
- public Content withDescription(String description) {
+ public BackendConfiguration withDescription(String description) {
this.description = description;
return this;
}
@@ -250,7 +249,7 @@ public class Content implements Serializable
this.txtApi = txtApi;
}
- public Content withTxtApi(String txtApi) {
+ public BackendConfiguration withTxtApi(String txtApi) {
this.txtApi = txtApi;
return this;
}
@@ -265,7 +264,7 @@ public class Content implements Serializable
this.txtSupport = txtSupport;
}
- public Content withTxtSupport(String txtSupport) {
+ public BackendConfiguration withTxtSupport(String txtSupport) {
this.txtSupport = txtSupport;
return this;
}
@@ -280,7 +279,7 @@ public class Content implements Serializable
this.txtFeatures = txtFeatures;
}
- public Content withTxtFeatures(String txtFeatures) {
+ public BackendConfiguration withTxtFeatures(String txtFeatures) {
this.txtFeatures = txtFeatures;
return this;
}
@@ -295,7 +294,7 @@ public class Content implements Serializable
this.createdAt = createdAt;
}
- public Content withCreatedAt(String createdAt) {
+ public BackendConfiguration withCreatedAt(String createdAt) {
this.createdAt = createdAt;
return this;
}
@@ -310,7 +309,7 @@ public class Content implements Serializable
this.updatedAt = updatedAt;
}
- public Content withUpdatedAt(String updatedAt) {
+ public BackendConfiguration withUpdatedAt(String updatedAt) {
this.updatedAt = updatedAt;
return this;
}
@@ -325,7 +324,7 @@ public class Content implements Serializable
this.logoFileName = logoFileName;
}
- public Content withLogoFileName(String logoFileName) {
+ public BackendConfiguration withLogoFileName(String logoFileName) {
this.logoFileName = logoFileName;
return this;
}
@@ -340,7 +339,7 @@ public class Content implements Serializable
this.logoContentType = logoContentType;
}
- public Content withLogoContentType(String logoContentType) {
+ public BackendConfiguration withLogoContentType(String logoContentType) {
this.logoContentType = logoContentType;
return this;
}
@@ -355,7 +354,7 @@ public class Content implements Serializable
this.logoFileSize = logoFileSize;
}
- public Content withLogoFileSize(Object logoFileSize) {
+ public BackendConfiguration withLogoFileSize(Object logoFileSize) {
this.logoFileSize = logoFileSize;
return this;
}
@@ -370,7 +369,7 @@ public class Content implements Serializable
this.state = state;
}
- public Content withState(String state) {
+ public BackendConfiguration withState(String state) {
this.state = state;
return this;
}
@@ -385,7 +384,7 @@ public class Content implements Serializable
this.intentionsRequired = intentionsRequired;
}
- public Content withIntentionsRequired(boolean intentionsRequired) {
+ public BackendConfiguration withIntentionsRequired(boolean intentionsRequired) {
this.intentionsRequired = intentionsRequired;
return this;
}
@@ -400,7 +399,7 @@ public class Content implements Serializable
this.draftName = draftName;
}
- public Content withDraftName(String draftName) {
+ public BackendConfiguration withDraftName(String draftName) {
this.draftName = draftName;
return this;
}
@@ -415,7 +414,7 @@ public class Content implements Serializable
this.infobar = infobar;
}
- public Content withInfobar(Object infobar) {
+ public BackendConfiguration withInfobar(Object infobar) {
this.infobar = infobar;
return this;
}
@@ -430,7 +429,7 @@ public class Content implements Serializable
this.terms = terms;
}
- public Content withTerms(Object terms) {
+ public BackendConfiguration withTerms(Object terms) {
this.terms = terms;
return this;
}
@@ -445,7 +444,7 @@ public class Content implements Serializable
this.displayProviderKeys = displayProviderKeys;
}
- public Content withDisplayProviderKeys(boolean displayProviderKeys) {
+ public BackendConfiguration withDisplayProviderKeys(boolean displayProviderKeys) {
this.displayProviderKeys = displayProviderKeys;
return this;
}
@@ -460,7 +459,7 @@ public class Content implements Serializable
this.techSupportEmail = techSupportEmail;
}
- public Content withTechSupportEmail(String techSupportEmail) {
+ public BackendConfiguration withTechSupportEmail(String techSupportEmail) {
this.techSupportEmail = techSupportEmail;
return this;
}
@@ -475,7 +474,7 @@ public class Content implements Serializable
this.adminSupportEmail = adminSupportEmail;
}
- public Content withAdminSupportEmail(String adminSupportEmail) {
+ public BackendConfiguration withAdminSupportEmail(String adminSupportEmail) {
this.adminSupportEmail = adminSupportEmail;
return this;
}
@@ -490,7 +489,7 @@ public class Content implements Serializable
this.creditCardSupportEmail = creditCardSupportEmail;
}
- public Content withCreditCardSupportEmail(String creditCardSupportEmail) {
+ public BackendConfiguration withCreditCardSupportEmail(String creditCardSupportEmail) {
this.creditCardSupportEmail = creditCardSupportEmail;
return this;
}
@@ -505,7 +504,7 @@ public class Content implements Serializable
this.buyersManageApps = buyersManageApps;
}
- public Content withBuyersManageApps(boolean buyersManageApps) {
+ public BackendConfiguration withBuyersManageApps(boolean buyersManageApps) {
this.buyersManageApps = buyersManageApps;
return this;
}
@@ -520,7 +519,7 @@ public class Content implements Serializable
this.buyersManageKeys = buyersManageKeys;
}
- public Content withBuyersManageKeys(boolean buyersManageKeys) {
+ public BackendConfiguration withBuyersManageKeys(boolean buyersManageKeys) {
this.buyersManageKeys = buyersManageKeys;
return this;
}
@@ -535,7 +534,7 @@ public class Content implements Serializable
this.customKeysEnabled = customKeysEnabled;
}
- public Content withCustomKeysEnabled(boolean customKeysEnabled) {
+ public BackendConfiguration withCustomKeysEnabled(boolean customKeysEnabled) {
this.customKeysEnabled = customKeysEnabled;
return this;
}
@@ -550,7 +549,7 @@ public class Content implements Serializable
this.buyerPlanChangePermission = buyerPlanChangePermission;
}
- public Content withBuyerPlanChangePermission(String buyerPlanChangePermission) {
+ public BackendConfiguration withBuyerPlanChangePermission(String buyerPlanChangePermission) {
this.buyerPlanChangePermission = buyerPlanChangePermission;
return this;
}
@@ -565,7 +564,7 @@ public class Content implements Serializable
this.buyerCanSelectPlan = buyerCanSelectPlan;
}
- public Content withBuyerCanSelectPlan(boolean buyerCanSelectPlan) {
+ public BackendConfiguration withBuyerCanSelectPlan(boolean buyerCanSelectPlan) {
this.buyerCanSelectPlan = buyerCanSelectPlan;
return this;
}
@@ -580,7 +579,7 @@ public class Content implements Serializable
this.notificationSettings = notificationSettings;
}
- public Content withNotificationSettings(Object notificationSettings) {
+ public BackendConfiguration withNotificationSettings(Object notificationSettings) {
this.notificationSettings = notificationSettings;
return this;
}
@@ -595,7 +594,7 @@ public class Content implements Serializable
this.defaultApplicationPlanId = defaultApplicationPlanId;
}
- public Content withDefaultApplicationPlanId(long defaultApplicationPlanId) {
+ public BackendConfiguration withDefaultApplicationPlanId(long defaultApplicationPlanId) {
this.defaultApplicationPlanId = defaultApplicationPlanId;
return this;
}
@@ -610,7 +609,7 @@ public class Content implements Serializable
this.defaultServicePlanId = defaultServicePlanId;
}
- public Content withDefaultServicePlanId(long defaultServicePlanId) {
+ public BackendConfiguration withDefaultServicePlanId(long defaultServicePlanId) {
this.defaultServicePlanId = defaultServicePlanId;
return this;
}
@@ -625,7 +624,7 @@ public class Content implements Serializable
this.buyerCanSeeLogRequests = buyerCanSeeLogRequests;
}
- public Content withBuyerCanSeeLogRequests(boolean buyerCanSeeLogRequests) {
+ public BackendConfiguration withBuyerCanSeeLogRequests(boolean buyerCanSeeLogRequests) {
this.buyerCanSeeLogRequests = buyerCanSeeLogRequests;
return this;
}
@@ -640,7 +639,7 @@ public class Content implements Serializable
this.defaultEndUserPlanId = defaultEndUserPlanId;
}
- public Content withDefaultEndUserPlanId(String defaultEndUserPlanId) {
+ public BackendConfiguration withDefaultEndUserPlanId(String defaultEndUserPlanId) {
this.defaultEndUserPlanId = defaultEndUserPlanId;
return this;
}
@@ -655,7 +654,7 @@ public class Content implements Serializable
this.endUserRegistrationRequired = endUserRegistrationRequired;
}
- public Content withEndUserRegistrationRequired(boolean endUserRegistrationRequired) {
+ public BackendConfiguration withEndUserRegistrationRequired(boolean endUserRegistrationRequired) {
this.endUserRegistrationRequired = endUserRegistrationRequired;
return this;
}
@@ -670,7 +669,7 @@ public class Content implements Serializable
this.tenantId = tenantId;
}
- public Content withTenantId(long tenantId) {
+ public BackendConfiguration withTenantId(long tenantId) {
this.tenantId = tenantId;
return this;
}
@@ -685,7 +684,7 @@ public class Content implements Serializable
this.systemName = systemName;
}
- public Content withSystemName(String systemName) {
+ public BackendConfiguration withSystemName(String systemName) {
this.systemName = systemName;
return this;
}
@@ -700,7 +699,7 @@ public class Content implements Serializable
this.backendVersion = backendVersion;
}
- public Content withBackendVersion(String backendVersion) {
+ public BackendConfiguration withBackendVersion(String backendVersion) {
this.backendVersion = backendVersion;
return this;
}
@@ -715,7 +714,7 @@ public class Content implements Serializable
this.mandatoryAppKey = mandatoryAppKey;
}
- public Content withMandatoryAppKey(boolean mandatoryAppKey) {
+ public BackendConfiguration withMandatoryAppKey(boolean mandatoryAppKey) {
this.mandatoryAppKey = mandatoryAppKey;
return this;
}
@@ -730,7 +729,7 @@ public class Content implements Serializable
this.buyerKeyRegenerateEnabled = buyerKeyRegenerateEnabled;
}
- public Content withBuyerKeyRegenerateEnabled(boolean buyerKeyRegenerateEnabled) {
+ public BackendConfiguration withBuyerKeyRegenerateEnabled(boolean buyerKeyRegenerateEnabled) {
this.buyerKeyRegenerateEnabled = buyerKeyRegenerateEnabled;
return this;
}
@@ -745,7 +744,7 @@ public class Content implements Serializable
this.supportEmail = supportEmail;
}
- public Content withSupportEmail(String supportEmail) {
+ public BackendConfiguration withSupportEmail(String supportEmail) {
this.supportEmail = supportEmail;
return this;
}
@@ -760,7 +759,7 @@ public class Content implements Serializable
this.referrerFiltersRequired = referrerFiltersRequired;
}
- public Content withReferrerFiltersRequired(boolean referrerFiltersRequired) {
+ public BackendConfiguration withReferrerFiltersRequired(boolean referrerFiltersRequired) {
this.referrerFiltersRequired = referrerFiltersRequired;
return this;
}
@@ -775,7 +774,7 @@ public class Content implements Serializable
this.deploymentOption = deploymentOption;
}
- public Content withDeploymentOption(String deploymentOption) {
+ public BackendConfiguration withDeploymentOption(String deploymentOption) {
this.deploymentOption = deploymentOption;
return this;
}
@@ -790,7 +789,7 @@ public class Content implements Serializable
this.proxiable = proxiable;
}
- public Content withProxiable(boolean proxiable) {
+ public BackendConfiguration withProxiable(boolean proxiable) {
this.proxiable = proxiable;
return this;
}
@@ -805,7 +804,7 @@ public class Content implements Serializable
this.backendAuthenticationType = backendAuthenticationType;
}
- public Content withBackendAuthenticationType(String backendAuthenticationType) {
+ public BackendConfiguration withBackendAuthenticationType(String backendAuthenticationType) {
this.backendAuthenticationType = backendAuthenticationType;
return this;
}
@@ -820,7 +819,7 @@ public class Content implements Serializable
this.backendAuthenticationValue = backendAuthenticationValue;
}
- public Content withBackendAuthenticationValue(String backendAuthenticationValue) {
+ public BackendConfiguration withBackendAuthenticationValue(String backendAuthenticationValue) {
this.backendAuthenticationValue = backendAuthenticationValue;
return this;
}
@@ -835,7 +834,7 @@ public class Content implements Serializable
this.proxy = proxy;
}
- public Content withProxy(Proxy proxy) {
+ public BackendConfiguration withProxy(Proxy proxy) {
this.proxy = proxy;
return this;
}
@@ -855,7 +854,7 @@ public class Content implements Serializable
this.additionalProperties.put(name, value);
}
- public Content withAdditionalProperty(String name, Object value) {
+ public BackendConfiguration withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@@ -893,10 +892,10 @@ public class Content implements Serializable
if (other == this) {
return true;
}
- if ((other instanceof Content) == false) {
+ if ((other instanceof BackendConfiguration) == false) {
return false;
}
- Content rhs = ((Content) other);
+ BackendConfiguration rhs = ((BackendConfiguration) other);
return new EqualsBuilder().append(id, rhs.id).append(accountId, rhs.accountId).append(name, rhs.name)
.append(onelineDescription, rhs.onelineDescription).append(description, rhs.description).append(txtApi, rhs.txtApi)
.append(txtSupport, rhs.txtSupport).append(txtFeatures, rhs.txtFeatures).append(createdAt, rhs.createdAt)
@@ -919,12 +918,4 @@ public class Content implements Serializable
.append(additionalProperties, rhs.additionalProperties).isEquals();
}
- public RateLimitingStrategy getRateLimitingStrategy() {
- return rateLimitingStrategy;
- }
-
- public void setRateLimitingStrategy(RateLimitingStrategy rateLimitingStrategy) {
- this.rateLimitingStrategy = rateLimitingStrategy;
- }
-
}

MODIFY
gateway/engine/vertx-polling/src/main/java/io/apiman/gateway/engine/vertx/polling/fetchers/threescale/beans/ProxyConfig.java
gateway/engine/vertx-polling/src/main/java/io/apiman/gateway/engine/vertx/polling/fetchers/threescale/beans/ProxyConfig.java
@@ -33,7 +33,7 @@ public class ProxyConfig implements Serializable
@JsonProperty("environment")
private String environment;
@JsonProperty("content")
- private Content content;
+ private BackendConfiguration content;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
private final static long serialVersionUID = 4009643270463245312L;
@@ -69,16 +69,16 @@ public class ProxyConfig implements Serializable
}
@JsonProperty("content")
- public Content getContent() {
+ public BackendConfiguration getBackendConfig() {
return content;
}
@JsonProperty("content")
- public void setContent(Content content) {
+ public void setBackendConfig(BackendConfiguration content) {
this.content = content;
}
- public ProxyConfig withContent(Content content) {
+ public ProxyConfig withBackendConfig(BackendConfiguration content) {
this.content = content;
return this;
}

MODIFY
gateway/engine/vertx-polling/src/main/java/io/apiman/gateway/engine/vertx/polling/fetchers/threescale/beans/RateLimitingStrategy.java
gateway/engine/vertx-polling/src/main/java/io/apiman/gateway/engine/vertx/polling/fetchers/threescale/beans/RateLimitingStrategy.java
package io.apiman.gateway.engine.vertx.polling.fetchers.threescale.beans;
public enum RateLimitingStrategy {
- STANDARD(false), BATCHED(true), XC(true);
+ STANDARD, // Standard naive RL scheme. First call is sync and creates cache entry; subsequent requests are async until invalidated.
+ BATCHED_HYBRID, // First call is sync and creates cache entry; subsequent requests are batched until TTL or size limit met. Batch is flushed and async authrep done.
+ BATCHED_NO_3SCALE_RATE_LIMITING, // Just do batching, no 3scale RL (caveat emptor!)
+ XC_EMULATION; // Emulated XC
- private boolean batched;
-
- RateLimitingStrategy(boolean batched) {
- this.batched = batched;
+ public static RateLimitingStrategy valueOfOrDefault(String name, RateLimitingStrategy defaultValue) {
+ if (name == null) {
+ return defaultValue;
}
-
- public boolean isBatched() {
- return batched;
+ return RateLimitingStrategy.valueOf(name.trim().toUpperCase());
}
}

MODIFY
gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/connector/HttpConnector.java
gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/connector/HttpConnector.java
@@ -40,7 +40,6 @@ import io.vertx.core.MultiMap;
import io.vertx.core.Vertx;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.HttpClient;
-import io.vertx.core.http.HttpClientOptions;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpClientResponse;
import io.vertx.core.http.HttpMethod;
@@ -313,6 +312,7 @@ class HttpConnector implements IApiConnectionResponse, IApiConnection {
private class ExceptionHandler implements Handler<Throwable> {
@Override
public void handle(Throwable error) {
+ error.printStackTrace();
// TODO better exception distinguishing.
resultHandler.handle(AsyncResultImpl
.<IApiConnectionResponse> create(error));

feat(3scale-registry): Add several new configurations options, including defaults.