Class Rewrite
java.lang.Object
com.predic8.membrane.core.openapi.serviceproxy.Rewrite
- Description
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHost()getPort()protected StringRewrites Host from Swagger 2.Xcom.fasterxml.jackson.databind.JsonNoderewrite(OpenAPIRecord rec, Exchange exc, URIFactory uriFactory) rewriteHost(String host) Rewrites the host if there was a value given.rewritePort(String port) Rewrites the port if there was a value given.rewriteProtocol(String protocol) Rewrites the protocol if there was a value given.protected StringrewriteUrl(Exchange exc, String url, URIFactory uriFactory) Rewrites URL from OpenAPI 3.XrewriteUrl(String url) voidsetBasePath(String basePath) voidvoidsetPort(int port) voidsetProtocol(String protocol)
-
Constructor Details
-
Rewrite
public Rewrite()
-
-
Method Details
-
rewrite
public com.fasterxml.jackson.databind.JsonNode rewrite(OpenAPIRecord rec, Exchange exc, URIFactory uriFactory) throws URISyntaxException - Throws:
URISyntaxException
-
rewriteUrl
protected String rewriteUrl(Exchange exc, String url, URIFactory uriFactory) throws URISyntaxException Rewrites URL from OpenAPI 3.X- Parameters:
exc- Exchangeurl- URL to rewriteuriFactory- URIFactory- Returns:
- Rewritten URL
- Throws:
URISyntaxException- syntax error ín URL
-
getRewrittenHostAndPortSwagger2
Rewrites Host from Swagger 2.X- Parameters:
exc- Exchange- Returns:
- Rewritten host with port
-
rewriteProtocol
Rewrites the protocol if there was a value given.- Parameters:
protocol- from the OpenAPI- Returns:
- rewritten value
-
rewriteHost
Rewrites the host if there was a value given.- Parameters:
host- from the OpenAPI- Returns:
- rewritten value
-
rewriteUrl
-
rewritePort
Rewrites the port if there was a value given.- Parameters:
port- from the OpenAPI- Returns:
- rewritten value
-
getPort
-
setPort
public void setPort(int port) -
getProtocol
-
setProtocol
-
getHost
-
setHost
-
setBasePath
-
getBasePath
-