Skip to content
  •  
  •  
  •  

This file was deleted.

25 changes: 0 additions & 25 deletions core/src/main/java/com/predic8/membrane/core/HttpRouter.java

This file was deleted.

26 changes: 0 additions & 26 deletions core/src/main/java/com/predic8/membrane/core/RoutingException.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
limitations under the License. */
package com.predic8.membrane.core.azure.api;

import com.predic8.membrane.core.azure.AzureDns;
import com.predic8.membrane.core.azure.AzureIdentity;
import com.predic8.membrane.core.azure.AzureTableStorage;
import com.predic8.membrane.core.azure.api.auth.AuthenticationApi;
import com.predic8.membrane.core.azure.api.dns.DnsRecordApi;
import com.predic8.membrane.core.azure.api.tablestorage.TableStorageApi;
import com.predic8.membrane.core.transport.http.HttpClient;
import com.predic8.membrane.core.transport.http.HttpClientFactory;
import com.predic8.membrane.core.util.TimerManager;
import com.predic8.membrane.core.azure.*;
import com.predic8.membrane.core.azure.api.auth.*;
import com.predic8.membrane.core.azure.api.dns.*;
import com.predic8.membrane.core.azure.api.tablestorage.*;
import com.predic8.membrane.core.router.*;
import com.predic8.membrane.core.transport.http.*;
import com.predic8.membrane.core.util.*;
import org.jetbrains.annotations.*;

import javax.annotation.*;
import javax.annotation.Nullable;

public class AzureApiClient implements AutoCloseable {
Expand All @@ -31,16 +31,12 @@ public class AzureApiClient implements AutoCloseable {
private final AuthenticationApi authApi;
private final TableStorageApi tableStorageApi;


public AzureApiClient(
@Nullable AzureIdentity identityConfig,
AzureTableStorage tableStorage,
HttpClientFactory httpClientFactory
) {
if (httpClientFactory == null) {
httpClientFactory = new HttpClientFactory(new TimerManager());
}
this.httpClient = httpClientFactory.createClient(tableStorage.getHttpClientConfiguration());
@NotNull Router router
) {
this.httpClient = router.getHttpClientFactory().createClient(tableStorage.getHttpClientConfiguration());

authApi = new AuthenticationApi(httpClient, identityConfig);
tableStorageApi = new TableStorageApi(this, tableStorage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
See the License for the specific language governing permissions and
limitations under the License. */

package com.predic8.membrane.core;
package com.predic8.membrane.core.cli;

/**
* Exception that signals that the startup failed and that Membrane should exit.
Expand Down
12 changes: 6 additions & 6 deletions core/src/main/java/com/predic8/membrane/core/cli/RouterCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
package com.predic8.membrane.core.cli;

import com.predic8.membrane.annot.beanregistry.*;
import com.predic8.membrane.core.*;
import com.predic8.membrane.core.config.spring.*;
import com.predic8.membrane.core.exceptions.*;
import com.predic8.membrane.core.openapi.serviceproxy.*;
import com.predic8.membrane.core.resolver.*;
import com.predic8.membrane.core.router.*;
import org.apache.commons.cli.*;
import org.jetbrains.annotations.*;
import org.slf4j.*;
Expand Down Expand Up @@ -135,7 +135,7 @@ public static String getExceptionMessageWithCauses(Throwable throwable) {
return null;
}

private static DefaultRouter initRouterByConfig(MembraneCommandLine commandLine) throws Exception {
private static Router initRouterByConfig(MembraneCommandLine commandLine) throws Exception {
String config = getRulesFile(commandLine);
if (config.endsWith(".xml")) {
var router = initRouterByXml(config);
Expand All @@ -149,17 +149,17 @@ private static DefaultRouter initRouterByConfig(MembraneCommandLine commandLine)
}

private static Router initRouterByOpenApiSpec(MembraneCommandLine commandLine) throws Exception {
Router router = new DummyTestRouter();
Router router = new DefaultRouter();
router.getRuleManager().addProxyAndOpenPortIfNew(getApiProxy(commandLine));
router.init();
return router;
}

private static DefaultRouter initRouterByYAML(MembraneCommandLine commandLine, String option) throws Exception {
private static Router initRouterByYAML(MembraneCommandLine commandLine, String option) throws Exception {
return initRouterByYAML(commandLine.getCommand().getOptionValue(option));
}

private static DefaultRouter initRouterByYAML(String location) throws Exception {
private static Router initRouterByYAML(String location) throws Exception {
var router = new DefaultRouter();
router.setBaseLocation(location);

Expand Down Expand Up @@ -213,7 +213,7 @@ private static String getLocation(MembraneCommandLine commandLine) throws IOExce
return new File(getUserDir(), location).getCanonicalPath();
}

private static DefaultRouter initRouterByXml(String config) throws Exception {
private static Router initRouterByXml(String config) throws Exception {
try {
return RouterXmlBootstrap.initByXML(config);
} catch (XmlBeanDefinitionStoreException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,6 @@ public String getOriginalHostHeaderHost() {
return originalHostHeader.replaceFirst(":.*", "");
}

public void block(Message msg) throws TerminateException {
try {
log.debug("Message thread waits");
msg.wait();
log.debug("Message thread received notify");
if (isForcedToStop())
throw new TerminateException("Force the exchange to stop.");
} catch (InterruptedException e1) {
Thread.currentThread().interrupt();
}
}

public String getOriginalHostHeaderPort() {
int pos = originalHostHeader.indexOf(':');
if (pos == -1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

import com.google.common.cache.*;
import com.predic8.membrane.annot.*;
import com.predic8.membrane.core.*;
import com.predic8.membrane.core.exchange.*;
import com.predic8.membrane.core.exchange.snapshots.*;
import com.predic8.membrane.core.http.*;
import com.predic8.membrane.core.interceptor.*;
import com.predic8.membrane.core.proxies.*;
import com.predic8.membrane.core.router.*;

import java.util.*;
import java.util.concurrent.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
import com.fasterxml.jackson.databind.*;
import com.google.common.collect.*;
import com.predic8.membrane.annot.*;
import com.predic8.membrane.core.*;
import com.predic8.membrane.core.exchange.*;
import com.predic8.membrane.core.exchange.snapshots.*;
import com.predic8.membrane.core.http.*;
import com.predic8.membrane.core.interceptor.administration.*;
import com.predic8.membrane.core.interceptor.rest.*;
import com.predic8.membrane.core.proxies.Proxy;
import com.predic8.membrane.core.proxies.*;
import com.predic8.membrane.core.router.*;
import com.predic8.membrane.core.transport.http.*;
import org.apache.commons.io.*;
import org.json.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

package com.predic8.membrane.core.exchangestore;

import com.predic8.membrane.core.*;
import com.predic8.membrane.core.exchange.*;
import com.predic8.membrane.core.interceptor.Interceptor.*;
import com.predic8.membrane.core.interceptor.rest.*;
import com.predic8.membrane.core.model.*;
import com.predic8.membrane.core.proxies.*;
import com.predic8.membrane.core.router.*;

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import com.mongodb.client.model.ReplaceOptions;
import com.predic8.membrane.annot.MCAttribute;
import com.predic8.membrane.annot.MCElement;
import com.predic8.membrane.core.*;
import com.predic8.membrane.core.exchange.AbstractExchange;
import com.predic8.membrane.core.exchange.snapshots.AbstractExchangeSnapshot;
import com.predic8.membrane.core.proxies.Proxy;
import com.predic8.membrane.core.proxies.RuleKey;
import com.predic8.membrane.core.router.*;
import org.bson.Document;
import org.bson.conversions.Bson;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.databind.*;
import com.google.common.collect.*;
import com.predic8.membrane.core.*;
import com.predic8.membrane.core.exchange.*;
import com.predic8.membrane.core.graphql.blocklist.FeatureBlocklist;
import com.predic8.membrane.core.graphql.model.*;
import com.predic8.membrane.core.http.*;
import com.predic8.membrane.core.router.*;
import jakarta.mail.internet.*;
import org.jetbrains.annotations.*;
import org.slf4j.*;
Expand Down Expand Up @@ -242,7 +242,7 @@ private static void checkExtension(Map data) {

private String getRawQuery(Exchange exc) {
try {
return router.getUriFactory().create(exc.getRequest().getUri()).getRawQuery();
return router.getConfiguration().getUriFactory().create(exc.getRequest().getUri()).getRawQuery();
} catch (URISyntaxException e) {
throw new GraphQLOverHttpValidationException(400, "Invalid request URI.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
package com.predic8.membrane.core.interceptor;

import com.predic8.membrane.annot.*;
import com.predic8.membrane.core.*;
import com.predic8.membrane.core.exchange.*;
import com.predic8.membrane.core.http.*;
import com.predic8.membrane.core.proxies.*;
import com.predic8.membrane.core.router.*;

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.node.*;
import com.predic8.membrane.annot.*;
import com.predic8.membrane.core.*;
import com.predic8.membrane.core.config.*;
import com.predic8.membrane.core.exchange.*;
import com.predic8.membrane.core.http.Response.*;
import com.predic8.membrane.core.openapi.serviceproxy.*;
import com.predic8.membrane.core.openapi.serviceproxy.APIProxy.*;
import com.predic8.membrane.core.proxies.*;
import com.predic8.membrane.core.router.*;
import org.jetbrains.annotations.*;
import org.slf4j.*;

Expand Down
Loading
Loading