This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit dec4729715dc7e39489c03d447d128b2ab5183ad Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue Jun 16 16:41:45 2020 +0200 CAMEL-14622: Component options use @Metadata to markup the options. Fix resteasy to not expose options from http that it does not use/support. --- .../resteasy/ResteasyComponentConfigurer.java | 10 +- .../apache/camel/component/resteasy/resteasy.json | 26 +- .../src/main/docs/resteasy-component.adoc | 27 +- .../component/resteasy/ResteasyComponent.java | 43 +- .../camel/component/resteasy/ResteasyEndpoint.java | 12 +- .../component/resteasy/ResteasyHttpBinding.java | 1 - .../camel/component/resteasy/ResteasyProducer.java | 2 - .../dsl/ResteasyComponentBuilderFactory.java | 214 +-------- .../src/generated/resources/metadata.json | 1 + .../dsl/ResteasyEndpointBuilderFactory.java | 526 --------------------- 10 files changed, 57 insertions(+), 805 deletions(-) diff --git a/components/camel-resteasy/src/generated/java/org/apache/camel/component/resteasy/ResteasyComponentConfigurer.java b/components/camel-resteasy/src/generated/java/org/apache/camel/component/resteasy/ResteasyComponentConfigurer.java index c763a9f..87f63db 100644 --- a/components/camel-resteasy/src/generated/java/org/apache/camel/component/resteasy/ResteasyComponentConfigurer.java +++ b/components/camel-resteasy/src/generated/java/org/apache/camel/component/resteasy/ResteasyComponentConfigurer.java @@ -21,10 +21,10 @@ public class ResteasyComponentConfigurer extends HttpComponentConfigurer impleme switch (ignoreCase ? name.toLowerCase() : name) { case "bridgeerrorhandler": case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true; - case "httpregistry": - case "httpRegistry": target.setHttpRegistry(property(camelContext, org.apache.camel.http.common.HttpRegistry.class, value)); return true; case "proxyconsumersclasses": case "proxyConsumersClasses": target.setProxyConsumersClasses(property(camelContext, java.lang.String.class, value)); return true; + case "resteasyhttpbinding": + case "resteasyHttpBinding": target.setResteasyHttpBinding(property(camelContext, org.apache.camel.component.resteasy.ResteasyHttpBinding.class, value)); return true; default: return super.configure(camelContext, obj, name, value, ignoreCase); } } @@ -33,8 +33,8 @@ public class ResteasyComponentConfigurer extends HttpComponentConfigurer impleme public Map<String, Object> getAllOptions(Object target) { Map<String, Object> answer = super.getAllOptions(target); answer.put("bridgeErrorHandler", boolean.class); - answer.put("httpRegistry", org.apache.camel.http.common.HttpRegistry.class); answer.put("proxyConsumersClasses", java.lang.String.class); + answer.put("resteasyHttpBinding", org.apache.camel.component.resteasy.ResteasyHttpBinding.class); return answer; } @@ -44,10 +44,10 @@ public class ResteasyComponentConfigurer extends HttpComponentConfigurer impleme switch (ignoreCase ? name.toLowerCase() : name) { case "bridgeerrorhandler": case "bridgeErrorHandler": return target.isBridgeErrorHandler(); - case "httpregistry": - case "httpRegistry": return target.getHttpRegistry(); case "proxyconsumersclasses": case "proxyConsumersClasses": return target.getProxyConsumersClasses(); + case "resteasyhttpbinding": + case "resteasyHttpBinding": return target.getResteasyHttpBinding(); default: return super.getOptionValue(obj, name, ignoreCase); } } diff --git a/components/camel-resteasy/src/generated/resources/org/apache/camel/component/resteasy/resteasy.json b/components/camel-resteasy/src/generated/resources/org/apache/camel/component/resteasy/resteasy.json index bb2aba7..76145c6 100644 --- a/components/camel-resteasy/src/generated/resources/org/apache/camel/component/resteasy/resteasy.json +++ b/components/camel-resteasy/src/generated/resources/org/apache/camel/component/resteasy/resteasy.json @@ -5,6 +5,7 @@ "title": "Resteasy", "description": "Expose REST endpoints and access external REST servers.", "deprecated": false, + "deprecationNote": "", "firstVersion": "3.4.0", "label": "rest", "javaType": "org.apache.camel.component.resteasy.ResteasyComponent", @@ -22,28 +23,16 @@ "verifiers": "parameters,connectivity" }, "componentProperties": { - "httpRegistry": { "kind": "property", "displayName": "Http Registry", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.http.common.HttpRegistry", "deprecated": false, "secret": false, "description": "Sets httpRegistry which can be externalized to be used by camel" }, - "proxyConsumersClasses": { "kind": "property", "displayName": "Proxy Consumers Classes", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Sets the proxy class for consumer enpoints" }, "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by [...] - "cookieStore": { "kind": "property", "displayName": "Cookie Store", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.http.client.CookieStore", "deprecated": false, "secret": false, "description": "To use a custom org.apache.http.client.CookieStore. By default the org.apache.http.impl.client.BasicCookieStore is used which is an in-memory only cookie store. Notice if bridgeEndpoint=true then the cookie store is forced to be a noop c [...] + "proxyConsumersClasses": { "kind": "property", "displayName": "Proxy Consumers Classes", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Proxy classes for consumer endpoints. Multiple classes can be separated by comma." }, "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the r [...] "allowJavaSerializedObject": { "kind": "property", "displayName": "Allow Java Serialized Object", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether to allow java serialization when a request uses context-type=application\/x-java-serialized-object. This is by default turned off. If you enable this then be aware that Java will deserialize the incomin [...] "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" }, - "clientConnectionManager": { "kind": "property", "displayName": "Client Connection Manager", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.conn.HttpClientConnectionManager", "deprecated": false, "secret": false, "description": "To use a custom and shared HttpClientConnectionManager to manage connections. If this has been configured then this is always used for all endpoints created by this component." }, - "connectionsPerRoute": { "kind": "property", "displayName": "Connections Per Route", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "20", "description": "The maximum number of connections per route." }, - "connectionTimeToLive": { "kind": "property", "displayName": "Connection Time To Live", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "secret": false, "description": "The time for connection to live, the time unit is millisecond, the default value is always keep alive." }, - "httpBinding": { "kind": "property", "displayName": "Http Binding", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.http.common.HttpBinding", "deprecated": false, "secret": false, "description": "To use a custom HttpBinding to control the mapping between Camel message and HttpClient." }, - "httpClientConfigurer": { "kind": "property", "displayName": "Http Client Configurer", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.http.HttpClientConfigurer", "deprecated": false, "secret": false, "description": "To use the custom HttpClientConfigurer to perform configuration of the HttpClient that will be used." }, - "httpConfiguration": { "kind": "property", "displayName": "Http Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.http.common.HttpConfiguration", "deprecated": false, "secret": false, "description": "To use the shared HttpConfiguration as base configuration." }, - "httpContext": { "kind": "property", "displayName": "Http Context", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.protocol.HttpContext", "deprecated": false, "secret": false, "description": "To use a custom org.apache.http.protocol.HttpContext when executing requests." }, - "maxTotalConnections": { "kind": "property", "displayName": "Max Total Connections", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "200", "description": "The maximum number of connections." }, + "resteasyHttpBinding": { "kind": "property", "displayName": "Resteasy Http Binding", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.resteasy.ResteasyHttpBinding", "deprecated": false, "secret": false, "description": "To use a custom ResteasyHttpBinding" }, "headerFilterStrategy": { "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." }, "sslContextParameters": { "kind": "property", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "description": "To configure security using SSLContextParameters. Important: Only one instance of org.apache.camel.support.jsse.SSLContextParameters is supported per HttpComponent. If you need to use 2 or more differen [...] "useGlobalSslContextParameters": { "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Enable usage of global SSL context parameters." }, - "x509HostnameVerifier": { "kind": "property", "displayName": "X509 Hostname Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "javax.net.ssl.HostnameVerifier", "deprecated": false, "secret": false, "description": "To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier." }, - "connectionRequestTimeout": { "kind": "property", "displayName": "Connection Request Timeout", "group": "timeout", "label": "timeout", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "-1", "description": "The timeout in milliseconds used when requesting a connection from the connection manager. A timeout value of zero is interpreted as an infinite timeout. A timeout value of zero is interpreted as an infinite timeout. A n [...] - "connectTimeout": { "kind": "property", "displayName": "Connect Timeout", "group": "timeout", "label": "timeout", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "-1", "description": "Determines the timeout in milliseconds until a connection is established. A timeout value of zero is interpreted as an infinite timeout. A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefi [...] - "socketTimeout": { "kind": "property", "displayName": "Socket Timeout", "group": "timeout", "label": "timeout", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "-1", "description": "Defines the socket timeout in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets). A timeout value of zero is interpreted as an infinite timeout. A nega [...] + "x509HostnameVerifier": { "kind": "property", "displayName": "X509 Hostname Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "javax.net.ssl.HostnameVerifier", "deprecated": false, "secret": false, "description": "To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier." } }, "properties": { "httpUri": { "kind": "path", "displayName": "Http Uri", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.net.URI", "deprecated": false, "deprecationNote": "", "secret": false, "description": "The url of the HTTP endpoint to call." }, @@ -53,7 +42,6 @@ "resteasyMethod": { "kind": "parameter", "displayName": "Resteasy Method", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "GET", "description": "Sets the resteasy method to process the request" }, "servletName": { "kind": "parameter", "displayName": "Servlet Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Sets the servlet name" }, "transferException": { "kind": "parameter", "displayName": "Transfer Exception", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "If enabled and an Exchange failed processing on the consumer side, and if the caused Exception was send back serialized in the response as a application\/x-java-serialized-object content type. On the producer side the exception will be d [...] - "httpBinding": { "kind": "parameter", "displayName": "Http Binding", "group": "common (advanced)", "label": "common,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.http.common.HttpBinding", "deprecated": false, "secret": false, "description": "To use a custom HttpBinding to control the mapping between Camel message and HttpClient." }, "async": { "kind": "parameter", "displayName": "Async", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Configure the consumer to work in async mode" }, "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled b [...] "httpMethodRestrict": { "kind": "parameter", "displayName": "Http Method Restrict", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Used to only allow consuming if the HttpMethod matches, such as GET\/POST\/PUT etc. Multiple methods can be specified separated by comma." }, @@ -76,23 +64,17 @@ "preserveHostHeader": { "kind": "parameter", "displayName": "Preserve Host Header", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "If the option is true, HttpProducer will set the Host header to the value contained in the current exchange Host header, useful in reverse proxy applications where you want the Host header received by the downstream server t [...] "throwExceptionOnFailure": { "kind": "parameter", "displayName": "Throw Exception On Failure", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Option to disable throwing the HttpOperationFailedException in case of failed responses from the remote server. This allows you to get all responses regardless of the HTTP status code." }, "cookieHandler": { "kind": "parameter", "displayName": "Cookie Handler", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.http.base.cookie.CookieHandler", "deprecated": false, "secret": false, "description": "Configure a cookie handler to maintain a HTTP session" }, - "cookieStore": { "kind": "parameter", "displayName": "Cookie Store", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "object", "javaType": "org.apache.http.client.CookieStore", "deprecated": false, "secret": false, "description": "To use a custom CookieStore. By default the BasicCookieStore is used which is an in-memory only cookie store. Notice if bridgeEndpoint=true then the cookie store is forced to be a noop cookie store as cookie shouldn' [...] "deleteWithBody": { "kind": "parameter", "displayName": "Delete With Body", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the HTTP DELETE should include the message body or not. By default HTTP DELETE do not include any HTTP body. However in some rare cases users may need to be able to include the message body." }, "getWithBody": { "kind": "parameter", "displayName": "Get With Body", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the HTTP GET should include the message body or not. By default HTTP GET do not include any HTTP body. However in some rare cases users may need to be able to include the message body." }, "okStatusCodeRange": { "kind": "parameter", "displayName": "Ok Status Code Range", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "200-299", "description": "The status codes which are considered a success response. The values are inclusive. Multiple ranges can be defined, separated by comma, e.g. 200-204,209,301-304. Each range must be a single num [...] "basicPropertyBinding": { "kind": "parameter", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" }, "clientBuilder": { "kind": "parameter", "displayName": "Client Builder", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.impl.client.HttpClientBuilder", "deprecated": false, "secret": false, "description": "Provide access to the http client request parameters used on new RequestConfig instances used by producers or consumers of this endpoint." }, - "clientConnectionManager": { "kind": "parameter", "displayName": "Client Connection Manager", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.conn.HttpClientConnectionManager", "deprecated": false, "secret": false, "description": "To use a custom HttpClientConnectionManager to manage connections" }, - "connectionsPerRoute": { "kind": "parameter", "displayName": "Connections Per Route", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "20", "description": "The maximum number of connections per route." }, "headerFilterStrategy": { "kind": "parameter", "displayName": "Header Filter Strategy", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "secret": false, "description": "To use a custom HeaderFilterStrategy to filter header to and from Camel message." }, "httpClient": { "kind": "parameter", "displayName": "Http Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.client.HttpClient", "deprecated": false, "secret": false, "description": "Sets a custom HttpClient to be used by the producer" }, - "httpClientConfigurer": { "kind": "parameter", "displayName": "Http Client Configurer", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.http.HttpClientConfigurer", "deprecated": false, "secret": false, "description": "Register a custom configuration strategy for new HttpClient instances created by producers or consumers such as to configure authentication mechanisms etc." }, "httpClientOptions": { "kind": "parameter", "displayName": "Http Client Options", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "httpClient.", "multiValue": true, "deprecated": false, "secret": false, "description": "To configure the HttpClient using the key\/values from the Map." }, - "httpContext": { "kind": "parameter", "displayName": "Http Context", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.protocol.HttpContext", "deprecated": false, "secret": false, "description": "To use a custom HttpContext instance" }, "mapHttpMessageBody": { "kind": "parameter", "displayName": "Map Http Message Body", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "If this option is true then IN exchange Body of the exchange will be mapped to HTTP body. Setting this to false will avoid the HTTP mapping." }, "mapHttpMessageFormUrlEncodedBody": { "kind": "parameter", "displayName": "Map Http Message Form Url Encoded Body", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "If this option is true then IN exchange Form Encoded body of the exchange will be mapped to HTTP. Setting this to false will avoid the HTTP Form Encoded body mapping." }, "mapHttpMessageHeaders": { "kind": "parameter", "displayName": "Map Http Message Headers", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "If this option is true then IN exchange Headers of the exchange will be mapped to HTTP headers. Setting this to false will avoid the HTTP Headers mapping." }, - "maxTotalConnections": { "kind": "parameter", "displayName": "Max Total Connections", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "200", "description": "The maximum number of connections." }, "setHttpResponseDuringProcessing": { "kind": "parameter", "displayName": "Set Http Response During Processing", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "secret": false, "description": "Sets the flag to use the endpoint where you can either populate camel exchange from servlet response or use request itself which may be thought as if it is a proxy." }, "skipServletProcessing": { "kind": "parameter", "displayName": "Skip Servlet Processing", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "secret": false, "description": "Sets the flag to use skip servlet processing and let camel take over processing" }, "synchronous": { "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported)." }, diff --git a/components/camel-resteasy/src/main/docs/resteasy-component.adoc b/components/camel-resteasy/src/main/docs/resteasy-component.adoc index d4b8b25..1210061 100644 --- a/components/camel-resteasy/src/main/docs/resteasy-component.adoc +++ b/components/camel-resteasy/src/main/docs/resteasy-component.adoc @@ -41,35 +41,23 @@ You can append query options to the URI in the following format: === Options // component options: START -The Resteasy component supports 22 options, which are listed below. +The Resteasy component supports 10 options, which are listed below. [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type -| *httpRegistry* (common) | Sets httpRegistry which can be externalized to be used by camel | | HttpRegistry -| *proxyConsumersClasses* (common) | Sets the proxy class for consumer enpoints | | String | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean -| *cookieStore* (producer) | To use a custom org.apache.http.client.CookieStore. By default the org.apache.http.impl.client.BasicCookieStore is used which is an in-memory only cookie store. Notice if bridgeEndpoint=true then the cookie store is forced to be a noop cookie store as cookie shouldn't be stored as we are just bridging (eg acting as a proxy). | | CookieStore +| *proxyConsumersClasses* (consumer) | Proxy classes for consumer endpoints. Multiple classes can be separated by comma. | | String | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] | *allowJavaSerializedObject* (advanced) | Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object. This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk. | false | boolean | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean -| *clientConnectionManager* (advanced) | To use a custom and shared HttpClientConnectionManager to manage connections. If this has been configured then this is always used for all endpoints created by this component. | | HttpClientConnectionManager -| *connectionsPerRoute* (advanced) | The maximum number of connections per route. | 20 | int -| *connectionTimeToLive* (advanced) | The time for connection to live, the time unit is millisecond, the default value is always keep alive. | | long -| *httpBinding* (advanced) | To use a custom HttpBinding to control the mapping between Camel message and HttpClient. | | HttpBinding -| *httpClientConfigurer* (advanced) | To use the custom HttpClientConfigurer to perform configuration of the HttpClient that will be used. | | HttpClientConfigurer -| *httpConfiguration* (advanced) | To use the shared HttpConfiguration as base configuration. | | HttpConfiguration -| *httpContext* (advanced) | To use a custom org.apache.http.protocol.HttpContext when executing requests. | | HttpContext -| *maxTotalConnections* (advanced) | The maximum number of connections. | 200 | int +| *resteasyHttpBinding* (advanced) | To use a custom ResteasyHttpBinding | | ResteasyHttpBinding | *headerFilterStrategy* (filter) | To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message. | | HeaderFilterStrategy | *sslContextParameters* (security) | To configure security using SSLContextParameters. Important: Only one instance of org.apache.camel.support.jsse.SSLContextParameters is supported per HttpComponent. If you need to use 2 or more different instances, you need to define a new HttpComponent per instance you need. | | SSLContextParameters | *useGlobalSslContextParameters* (security) | Enable usage of global SSL context parameters. | false | boolean | *x509HostnameVerifier* (security) | To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier. | | HostnameVerifier -| *connectionRequestTimeout* (timeout) | The timeout in milliseconds used when requesting a connection from the connection manager. A timeout value of zero is interpreted as an infinite timeout. A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default). | -1 | int -| *connectTimeout* (timeout) | Determines the timeout in milliseconds until a connection is established. A timeout value of zero is interpreted as an infinite timeout. A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default). | -1 | int -| *socketTimeout* (timeout) | Defines the socket timeout in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets). A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default). | -1 | int |=== // component options: END @@ -93,7 +81,7 @@ with the following path and query parameters: |=== -=== Query Parameters (73 parameters): +=== Query Parameters (66 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -105,7 +93,6 @@ with the following path and query parameters: | *resteasyMethod* (common) | Sets the resteasy method to process the request | GET | String | *servletName* (common) | Sets the servlet name | | String | *transferException* (common) | If enabled and an Exchange failed processing on the consumer side, and if the caused Exception was send back serialized in the response as a application/x-java-serialized-object content type. On the producer side the exception will be deserialized and thrown as is, instead of the HttpOperationFailedException. The caused exception is required to be serialized. This is by default turned off. If you enable this then be aware that Java will deserialize the in [...] -| *httpBinding* (common) | To use a custom HttpBinding to control the mapping between Camel message and HttpClient. | | HttpBinding | *async* (consumer) | Configure the consumer to work in async mode | false | boolean | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean | *httpMethodRestrict* (consumer) | Used to only allow consuming if the HttpMethod matches, such as GET/POST/PUT etc. Multiple methods can be specified separated by comma. | | String @@ -128,23 +115,17 @@ with the following path and query parameters: | *preserveHostHeader* (producer) | If the option is true, HttpProducer will set the Host header to the value contained in the current exchange Host header, useful in reverse proxy applications where you want the Host header received by the downstream server to reflect the URL called by the upstream client, this allows applications which use the Host header to generate accurate URL's for a proxied service | false | boolean | *throwExceptionOnFailure* (producer) | Option to disable throwing the HttpOperationFailedException in case of failed responses from the remote server. This allows you to get all responses regardless of the HTTP status code. | true | boolean | *cookieHandler* (producer) | Configure a cookie handler to maintain a HTTP session | | CookieHandler -| *cookieStore* (producer) | To use a custom CookieStore. By default the BasicCookieStore is used which is an in-memory only cookie store. Notice if bridgeEndpoint=true then the cookie store is forced to be a noop cookie store as cookie shouldn't be stored as we are just bridging (eg acting as a proxy). If a cookieHandler is set then the cookie store is also forced to be a noop cookie store as cookie handling is then performed by the cookieHandler. | | CookieStore | *deleteWithBody* (producer) | Whether the HTTP DELETE should include the message body or not. By default HTTP DELETE do not include any HTTP body. However in some rare cases users may need to be able to include the message body. | false | boolean | *getWithBody* (producer) | Whether the HTTP GET should include the message body or not. By default HTTP GET do not include any HTTP body. However in some rare cases users may need to be able to include the message body. | false | boolean | *okStatusCodeRange* (producer) | The status codes which are considered a success response. The values are inclusive. Multiple ranges can be defined, separated by comma, e.g. 200-204,209,301-304. Each range must be a single number or from-to with the dash included. | 200-299 | String | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean | *clientBuilder* (advanced) | Provide access to the http client request parameters used on new RequestConfig instances used by producers or consumers of this endpoint. | | HttpClientBuilder -| *clientConnectionManager* (advanced) | To use a custom HttpClientConnectionManager to manage connections | | HttpClientConnectionManager -| *connectionsPerRoute* (advanced) | The maximum number of connections per route. | 20 | int | *headerFilterStrategy* (advanced) | To use a custom HeaderFilterStrategy to filter header to and from Camel message. | | HeaderFilterStrategy | *httpClient* (advanced) | Sets a custom HttpClient to be used by the producer | | HttpClient -| *httpClientConfigurer* (advanced) | Register a custom configuration strategy for new HttpClient instances created by producers or consumers such as to configure authentication mechanisms etc. | | HttpClientConfigurer | *httpClientOptions* (advanced) | To configure the HttpClient using the key/values from the Map. | | Map -| *httpContext* (advanced) | To use a custom HttpContext instance | | HttpContext | *mapHttpMessageBody* (advanced) | If this option is true then IN exchange Body of the exchange will be mapped to HTTP body. Setting this to false will avoid the HTTP mapping. | true | boolean | *mapHttpMessageFormUrlEncoded Body* (advanced) | If this option is true then IN exchange Form Encoded body of the exchange will be mapped to HTTP. Setting this to false will avoid the HTTP Form Encoded body mapping. | true | boolean | *mapHttpMessageHeaders* (advanced) | If this option is true then IN exchange Headers of the exchange will be mapped to HTTP headers. Setting this to false will avoid the HTTP Headers mapping. | true | boolean -| *maxTotalConnections* (advanced) | The maximum number of connections. | 200 | int | *setHttpResponseDuring Processing* (advanced) | Sets the flag to use the endpoint where you can either populate camel exchange from servlet response or use request itself which may be thought as if it is a proxy. | | Boolean | *skipServletProcessing* (advanced) | Sets the flag to use skip servlet processing and let camel take over processing | | Boolean | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean diff --git a/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyComponent.java b/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyComponent.java index c54712f..9ce45fc 100644 --- a/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyComponent.java +++ b/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyComponent.java @@ -31,6 +31,7 @@ import org.apache.camel.http.common.DefaultHttpRegistry; import org.apache.camel.http.common.HttpConsumer; import org.apache.camel.http.common.HttpRegistry; import org.apache.camel.spi.HeaderFilterStrategy; +import org.apache.camel.spi.Metadata; import org.apache.camel.spi.RestConfiguration; import org.apache.camel.spi.RestConsumerFactory; import org.apache.camel.spi.annotations.Component; @@ -39,19 +40,18 @@ import org.apache.camel.util.URISupport; import org.apache.camel.util.UnsafeUriCharactersEncoder; import org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher; -/** - * Defines a Resteasy component, which is extending HttpComponent - * - */ @Component("resteasy") +@Metadata(excludeProperties = "clientConnectionManager,connectionsPerRoute,connectionTimeToLive," + + "httpBinding,httpClientConfigurer,httpConfiguration,httpContext,httpRegistry,maxTotalConnections,connectionRequestTimeout," + + "connectTimeout,socketTimeout,cookieStore") public class ResteasyComponent extends HttpComponent implements RestConsumerFactory { + @Metadata(label = "advanced") private HttpRegistry httpRegistry; - - // parameter that can be set in ResteasyComponent - private String proxyConsumersClasses; - + @Metadata(label = "advanced") private ResteasyHttpBinding resteasyHttpBinding; + @Metadata(label = "consumer") + private String proxyConsumersClasses; public ResteasyComponent() { super(ResteasyEndpoint.class); @@ -64,10 +64,6 @@ public class ResteasyComponent extends HttpComponent implements RestConsumerFact @Override protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { - // create the configurer to use for this endpoint - // TODO second parameter might be false or true, based on security level - HttpClientConfigurer configurer = createHttpClientConfigurer(parameters, false); - // must extract well known parameters before we create the endpoint Boolean throwExceptionOnFailure = getAndRemoveParameter(parameters, "throwExceptionOnFailure", Boolean.class); Boolean transferException = getAndRemoveParameter(parameters, "transferException", Boolean.class); @@ -78,7 +74,7 @@ public class ResteasyComponent extends HttpComponent implements RestConsumerFact // restructure uri to be based on the parameters left as we don't want to include the Camel internal options URI httpUri = URISupport.createRemainingURI(new URI(UnsafeUriCharactersEncoder.encodeHttpURI(uri)), parameters); - ResteasyEndpoint endpoint = new ResteasyEndpoint(uri, this, httpUri, getClientConnectionManager(), configurer); + ResteasyEndpoint endpoint = new ResteasyEndpoint(uri, this, httpUri); // Needed for taking component options from URI and using only clean uri for resource. Later adding query parameters setProperties(endpoint, parameters); @@ -155,7 +151,7 @@ public class ResteasyComponent extends HttpComponent implements RestConsumerFact } /** - * Sets the proxy class for consumer enpoints + * Proxy classes for consumer endpoints. Multiple classes can be separated by comma. */ public void setProxyConsumersClasses(String proxyConsumersClasses) { this.proxyConsumersClasses = proxyConsumersClasses; @@ -166,12 +162,23 @@ public class ResteasyComponent extends HttpComponent implements RestConsumerFact } /** - * Sets httpRegistry which can be externalized to be used by camel + * To use a custom HttpRegistry. */ public void setHttpRegistry(HttpRegistry httpRegistry) { this.httpRegistry = httpRegistry; } + public ResteasyHttpBinding getResteasyHttpBinding() { + return resteasyHttpBinding; + } + + /** + * To use a custom ResteasyHttpBinding + */ + public void setResteasyHttpBinding(ResteasyHttpBinding resteasyHttpBinding) { + this.resteasyHttpBinding = resteasyHttpBinding; + } + @Override public Consumer createConsumer(CamelContext camelContext, Processor processor, String verb, String basePath, String uriTemplate, String consumes, String produces, RestConfiguration configuration, @@ -191,8 +198,6 @@ public class ResteasyComponent extends HttpComponent implements RestConsumerFact // if no explicit port/host configured, then use port from rest configuration RestConfiguration config = getCamelContext().getRestConfiguration(); - - Map<String, Object> map = new HashMap<String, Object>(); // build query string, and append any endpoint configuration properties if (config.getComponent() == null || config.getComponent().equals("resteasy")) { @@ -219,11 +224,9 @@ public class ResteasyComponent extends HttpComponent implements RestConsumerFact setProperties(endpoint, parameters); Consumer consumer = endpoint.createConsumer(processor); - if (config != null && config.getConsumerProperties() != null && !config.getConsumerProperties().isEmpty()) { + if (config.getConsumerProperties() != null && !config.getConsumerProperties().isEmpty()) { setProperties(consumer, config.getConsumerProperties()); } - - return consumer; } diff --git a/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyEndpoint.java b/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyEndpoint.java index 0984ede..9cf3307 100644 --- a/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyEndpoint.java +++ b/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyEndpoint.java @@ -27,6 +27,7 @@ import org.apache.camel.component.http.HttpClientConfigurer; import org.apache.camel.component.http.HttpEndpoint; import org.apache.camel.spi.HeaderFilterStrategy; import org.apache.camel.spi.HeaderFilterStrategyAware; +import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.http.conn.HttpClientConnectionManager; @@ -37,6 +38,9 @@ import org.apache.http.impl.client.HttpClientBuilder; */ @UriEndpoint(firstVersion = "3.4.0", scheme = "resteasy", extendsScheme = "http", title = "Resteasy", syntax = "resteasy:httpUri", category = {Category.REST}) +@Metadata(excludeProperties = "clientConnectionManager,connectionsPerRoute,connectionTimeToLive," + + "httpBinding,httpClientConfigurer,httpConfiguration,httpContext,httpRegistry,maxTotalConnections,connectionRequestTimeout," + + "connectTimeout,socketTimeout,cookieStore") public class ResteasyEndpoint extends HttpEndpoint implements HeaderFilterStrategyAware { private String protocol; @@ -67,11 +71,8 @@ public class ResteasyEndpoint extends HttpEndpoint implements HeaderFilterStrate @UriParam(label = "advanced") private HeaderFilterStrategy headerFilterStrategy = new ResteasyHeaderFilterStrategy(); - public ResteasyEndpoint(String endPointURI, ResteasyComponent component, URI httpUri, HttpClientConnectionManager httpConnectionManager, - HttpClientConfigurer clientConfigurer) throws URISyntaxException { - super(endPointURI, component, httpUri, - HttpClientBuilder.create(), - httpConnectionManager, clientConfigurer); + public ResteasyEndpoint(String endPointURI, ResteasyComponent component, URI httpUri) throws URISyntaxException { + super(endPointURI, component, httpUri, null, null, null); } @Override @@ -251,5 +252,4 @@ public class ResteasyEndpoint extends HttpEndpoint implements HeaderFilterStrate this.restEasyHttpBindingRef = restEasyHttpBinding; } - } diff --git a/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyHttpBinding.java b/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyHttpBinding.java index 0e84a61..a6d42db 100644 --- a/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyHttpBinding.java +++ b/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyHttpBinding.java @@ -25,7 +25,6 @@ import org.apache.camel.spi.HeaderFilterStrategy; /** * Strategy interface for implementing binding between Resteasy and Camel - * */ public interface ResteasyHttpBinding { diff --git a/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyProducer.java b/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyProducer.java index f12d722..fd288fc 100644 --- a/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyProducer.java +++ b/components/camel-resteasy/src/main/java/org/apache/camel/component/resteasy/ResteasyProducer.java @@ -31,7 +31,6 @@ import org.slf4j.LoggerFactory; * ResteasyProducer binds a Camel exchange to a Http Request, acts as a Resteasy * client, and sends the request to a server. Any response will * be bound to Camel exchange. - * */ public class ResteasyProducer extends DefaultProducer { @@ -71,7 +70,6 @@ public class ResteasyProducer extends DefaultProducer { response.close(); } - } diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ResteasyComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ResteasyComponentBuilderFactory.java index a1035e2..504a1b5 100644 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ResteasyComponentBuilderFactory.java +++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ResteasyComponentBuilderFactory.java @@ -49,31 +49,6 @@ public interface ResteasyComponentBuilderFactory { extends ComponentBuilder<ResteasyComponent> { /** - * Sets httpRegistry which can be externalized to be used by camel. - * - * The option is a: - * <code>org.apache.camel.http.common.HttpRegistry</code> type. - * - * Group: common - */ - default ResteasyComponentBuilder httpRegistry( - org.apache.camel.http.common.HttpRegistry httpRegistry) { - doSetProperty("httpRegistry", httpRegistry); - return this; - } - /** - * Sets the proxy class for consumer enpoints. - * - * The option is a: <code>java.lang.String</code> type. - * - * Group: common - */ - default ResteasyComponentBuilder proxyConsumersClasses( - java.lang.String proxyConsumersClasses) { - doSetProperty("proxyConsumersClasses", proxyConsumersClasses); - return this; - } - /** * Allows for bridging the consumer to the Camel routing Error Handler, * which mean any exceptions occurred while the consumer is trying to * pickup incoming messages, or the likes, will now be processed as a @@ -93,20 +68,16 @@ public interface ResteasyComponentBuilderFactory { return this; } /** - * To use a custom org.apache.http.client.CookieStore. By default the - * org.apache.http.impl.client.BasicCookieStore is used which is an - * in-memory only cookie store. Notice if bridgeEndpoint=true then the - * cookie store is forced to be a noop cookie store as cookie shouldn't - * be stored as we are just bridging (eg acting as a proxy). + * Proxy classes for consumer endpoints. Multiple classes can be + * separated by comma. * - * The option is a: <code>org.apache.http.client.CookieStore</code> - * type. + * The option is a: <code>java.lang.String</code> type. * - * Group: producer + * Group: consumer */ - default ResteasyComponentBuilder cookieStore( - org.apache.http.client.CookieStore cookieStore) { - doSetProperty("cookieStore", cookieStore); + default ResteasyComponentBuilder proxyConsumersClasses( + java.lang.String proxyConsumersClasses) { + doSetProperty("proxyConsumersClasses", proxyConsumersClasses); return this; } /** @@ -162,113 +133,17 @@ public interface ResteasyComponentBuilderFactory { return this; } /** - * To use a custom and shared HttpClientConnectionManager to manage - * connections. If this has been configured then this is always used for - * all endpoints created by this component. + * To use a custom ResteasyHttpBinding. * * The option is a: - * <code>org.apache.http.conn.HttpClientConnectionManager</code> type. - * - * Group: advanced - */ - default ResteasyComponentBuilder clientConnectionManager( - org.apache.http.conn.HttpClientConnectionManager clientConnectionManager) { - doSetProperty("clientConnectionManager", clientConnectionManager); - return this; - } - /** - * The maximum number of connections per route. - * - * The option is a: <code>int</code> type. - * - * Default: 20 - * Group: advanced - */ - default ResteasyComponentBuilder connectionsPerRoute( - int connectionsPerRoute) { - doSetProperty("connectionsPerRoute", connectionsPerRoute); - return this; - } - /** - * The time for connection to live, the time unit is millisecond, the - * default value is always keep alive. - * - * The option is a: <code>long</code> type. - * - * Group: advanced - */ - default ResteasyComponentBuilder connectionTimeToLive( - long connectionTimeToLive) { - doSetProperty("connectionTimeToLive", connectionTimeToLive); - return this; - } - /** - * To use a custom HttpBinding to control the mapping between Camel - * message and HttpClient. - * - * The option is a: - * <code>org.apache.camel.http.common.HttpBinding</code> type. - * - * Group: advanced - */ - default ResteasyComponentBuilder httpBinding( - org.apache.camel.http.common.HttpBinding httpBinding) { - doSetProperty("httpBinding", httpBinding); - return this; - } - /** - * To use the custom HttpClientConfigurer to perform configuration of - * the HttpClient that will be used. - * - * The option is a: - * <code>org.apache.camel.component.http.HttpClientConfigurer</code> - * type. - * - * Group: advanced - */ - default ResteasyComponentBuilder httpClientConfigurer( - org.apache.camel.component.http.HttpClientConfigurer httpClientConfigurer) { - doSetProperty("httpClientConfigurer", httpClientConfigurer); - return this; - } - /** - * To use the shared HttpConfiguration as base configuration. - * - * The option is a: - * <code>org.apache.camel.http.common.HttpConfiguration</code> type. - * - * Group: advanced - */ - default ResteasyComponentBuilder httpConfiguration( - org.apache.camel.http.common.HttpConfiguration httpConfiguration) { - doSetProperty("httpConfiguration", httpConfiguration); - return this; - } - /** - * To use a custom org.apache.http.protocol.HttpContext when executing - * requests. - * - * The option is a: <code>org.apache.http.protocol.HttpContext</code> + * <code>org.apache.camel.component.resteasy.ResteasyHttpBinding</code> * type. * * Group: advanced */ - default ResteasyComponentBuilder httpContext( - org.apache.http.protocol.HttpContext httpContext) { - doSetProperty("httpContext", httpContext); - return this; - } - /** - * The maximum number of connections. - * - * The option is a: <code>int</code> type. - * - * Default: 200 - * Group: advanced - */ - default ResteasyComponentBuilder maxTotalConnections( - int maxTotalConnections) { - doSetProperty("maxTotalConnections", maxTotalConnections); + default ResteasyComponentBuilder resteasyHttpBinding( + org.apache.camel.component.resteasy.ResteasyHttpBinding resteasyHttpBinding) { + doSetProperty("resteasyHttpBinding", resteasyHttpBinding); return this; } /** @@ -328,55 +203,6 @@ public interface ResteasyComponentBuilderFactory { doSetProperty("x509HostnameVerifier", x509HostnameVerifier); return this; } - /** - * The timeout in milliseconds used when requesting a connection from - * the connection manager. A timeout value of zero is interpreted as an - * infinite timeout. A timeout value of zero is interpreted as an - * infinite timeout. A negative value is interpreted as undefined - * (system default). - * - * The option is a: <code>int</code> type. - * - * Default: -1 - * Group: timeout - */ - default ResteasyComponentBuilder connectionRequestTimeout( - int connectionRequestTimeout) { - doSetProperty("connectionRequestTimeout", connectionRequestTimeout); - return this; - } - /** - * Determines the timeout in milliseconds until a connection is - * established. A timeout value of zero is interpreted as an infinite - * timeout. A timeout value of zero is interpreted as an infinite - * timeout. A negative value is interpreted as undefined (system - * default). - * - * The option is a: <code>int</code> type. - * - * Default: -1 - * Group: timeout - */ - default ResteasyComponentBuilder connectTimeout(int connectTimeout) { - doSetProperty("connectTimeout", connectTimeout); - return this; - } - /** - * Defines the socket timeout in milliseconds, which is the timeout for - * waiting for data or, put differently, a maximum period inactivity - * between two consecutive data packets). A timeout value of zero is - * interpreted as an infinite timeout. A negative value is interpreted - * as undefined (system default). - * - * The option is a: <code>int</code> type. - * - * Default: -1 - * Group: timeout - */ - default ResteasyComponentBuilder socketTimeout(int socketTimeout) { - doSetProperty("socketTimeout", socketTimeout); - return this; - } } class ResteasyComponentBuilderImpl @@ -394,28 +220,16 @@ public interface ResteasyComponentBuilderFactory { String name, Object value) { switch (name) { - case "httpRegistry": ((ResteasyComponent) component).setHttpRegistry((org.apache.camel.http.common.HttpRegistry) value); return true; - case "proxyConsumersClasses": ((ResteasyComponent) component).setProxyConsumersClasses((java.lang.String) value); return true; case "bridgeErrorHandler": ((ResteasyComponent) component).setBridgeErrorHandler((boolean) value); return true; - case "cookieStore": ((ResteasyComponent) component).setCookieStore((org.apache.http.client.CookieStore) value); return true; + case "proxyConsumersClasses": ((ResteasyComponent) component).setProxyConsumersClasses((java.lang.String) value); return true; case "lazyStartProducer": ((ResteasyComponent) component).setLazyStartProducer((boolean) value); return true; case "allowJavaSerializedObject": ((ResteasyComponent) component).setAllowJavaSerializedObject((boolean) value); return true; case "basicPropertyBinding": ((ResteasyComponent) component).setBasicPropertyBinding((boolean) value); return true; - case "clientConnectionManager": ((ResteasyComponent) component).setClientConnectionManager((org.apache.http.conn.HttpClientConnectionManager) value); return true; - case "connectionsPerRoute": ((ResteasyComponent) component).setConnectionsPerRoute((int) value); return true; - case "connectionTimeToLive": ((ResteasyComponent) component).setConnectionTimeToLive((long) value); return true; - case "httpBinding": ((ResteasyComponent) component).setHttpBinding((org.apache.camel.http.common.HttpBinding) value); return true; - case "httpClientConfigurer": ((ResteasyComponent) component).setHttpClientConfigurer((org.apache.camel.component.http.HttpClientConfigurer) value); return true; - case "httpConfiguration": ((ResteasyComponent) component).setHttpConfiguration((org.apache.camel.http.common.HttpConfiguration) value); return true; - case "httpContext": ((ResteasyComponent) component).setHttpContext((org.apache.http.protocol.HttpContext) value); return true; - case "maxTotalConnections": ((ResteasyComponent) component).setMaxTotalConnections((int) value); return true; + case "resteasyHttpBinding": ((ResteasyComponent) component).setResteasyHttpBinding((org.apache.camel.component.resteasy.ResteasyHttpBinding) value); return true; case "headerFilterStrategy": ((ResteasyComponent) component).setHeaderFilterStrategy((org.apache.camel.spi.HeaderFilterStrategy) value); return true; case "sslContextParameters": ((ResteasyComponent) component).setSslContextParameters((org.apache.camel.support.jsse.SSLContextParameters) value); return true; case "useGlobalSslContextParameters": ((ResteasyComponent) component).setUseGlobalSslContextParameters((boolean) value); return true; case "x509HostnameVerifier": ((ResteasyComponent) component).setX509HostnameVerifier((javax.net.ssl.HostnameVerifier) value); return true; - case "connectionRequestTimeout": ((ResteasyComponent) component).setConnectionRequestTimeout((int) value); return true; - case "connectTimeout": ((ResteasyComponent) component).setConnectTimeout((int) value); return true; - case "socketTimeout": ((ResteasyComponent) component).setSocketTimeout((int) value); return true; default: return false; } } diff --git a/core/camel-componentdsl/src/generated/resources/metadata.json b/core/camel-componentdsl/src/generated/resources/metadata.json index fb2d3e8..28dae62 100644 --- a/core/camel-componentdsl/src/generated/resources/metadata.json +++ b/core/camel-componentdsl/src/generated/resources/metadata.json @@ -5727,6 +5727,7 @@ "title": "Resteasy", "description": "Expose REST endpoints and access external REST servers.", "deprecated": false, + "deprecationNote": "", "firstVersion": "3.4.0", "label": "rest", "javaType": "org.apache.camel.component.resteasy.ResteasyComponent", diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ResteasyEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ResteasyEndpointBuilderFactory.java index 28d99c4..8b34123 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ResteasyEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ResteasyEndpointBuilderFactory.java @@ -519,34 +519,6 @@ public interface ResteasyEndpointBuilderFactory { return (ResteasyEndpointConsumerBuilder) this; } /** - * To use a custom HttpBinding to control the mapping between Camel - * message and HttpClient. - * - * The option is a: - * <code>org.apache.camel.http.common.HttpBinding</code> type. - * - * Group: common (advanced) - */ - default AdvancedResteasyEndpointConsumerBuilder httpBinding( - Object httpBinding) { - doSetProperty("httpBinding", httpBinding); - return this; - } - /** - * To use a custom HttpBinding to control the mapping between Camel - * message and HttpClient. - * - * The option will be converted to a - * <code>org.apache.camel.http.common.HttpBinding</code> type. - * - * Group: common (advanced) - */ - default AdvancedResteasyEndpointConsumerBuilder httpBinding( - String httpBinding) { - doSetProperty("httpBinding", httpBinding); - return this; - } - /** * Whether to eager check whether the HTTP requests has content if the * content-length header is 0 or not present. This can be turned on in * case HTTP clients do not send streamed data. @@ -748,58 +720,6 @@ public interface ResteasyEndpointBuilderFactory { return this; } /** - * To use a custom HttpClientConnectionManager to manage connections. - * - * The option is a: - * <code>org.apache.http.conn.HttpClientConnectionManager</code> type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointConsumerBuilder clientConnectionManager( - Object clientConnectionManager) { - doSetProperty("clientConnectionManager", clientConnectionManager); - return this; - } - /** - * To use a custom HttpClientConnectionManager to manage connections. - * - * The option will be converted to a - * <code>org.apache.http.conn.HttpClientConnectionManager</code> type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointConsumerBuilder clientConnectionManager( - String clientConnectionManager) { - doSetProperty("clientConnectionManager", clientConnectionManager); - return this; - } - /** - * The maximum number of connections per route. - * - * The option is a: <code>int</code> type. - * - * Default: 20 - * Group: advanced - */ - default AdvancedResteasyEndpointConsumerBuilder connectionsPerRoute( - int connectionsPerRoute) { - doSetProperty("connectionsPerRoute", connectionsPerRoute); - return this; - } - /** - * The maximum number of connections per route. - * - * The option will be converted to a <code>int</code> type. - * - * Default: 20 - * Group: advanced - */ - default AdvancedResteasyEndpointConsumerBuilder connectionsPerRoute( - String connectionsPerRoute) { - doSetProperty("connectionsPerRoute", connectionsPerRoute); - return this; - } - /** * To use a custom HeaderFilterStrategy to filter header to and from * Camel message. * @@ -853,38 +773,6 @@ public interface ResteasyEndpointBuilderFactory { return this; } /** - * Register a custom configuration strategy for new HttpClient instances - * created by producers or consumers such as to configure authentication - * mechanisms etc. - * - * The option is a: - * <code>org.apache.camel.component.http.HttpClientConfigurer</code> - * type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointConsumerBuilder httpClientConfigurer( - Object httpClientConfigurer) { - doSetProperty("httpClientConfigurer", httpClientConfigurer); - return this; - } - /** - * Register a custom configuration strategy for new HttpClient instances - * created by producers or consumers such as to configure authentication - * mechanisms etc. - * - * The option will be converted to a - * <code>org.apache.camel.component.http.HttpClientConfigurer</code> - * type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointConsumerBuilder httpClientConfigurer( - String httpClientConfigurer) { - doSetProperty("httpClientConfigurer", httpClientConfigurer); - return this; - } - /** * To configure the HttpClient using the key/values from the Map. * * The option is a: <code>java.util.Map<java.lang.String, @@ -918,32 +806,6 @@ public interface ResteasyEndpointBuilderFactory { return this; } /** - * To use a custom HttpContext instance. - * - * The option is a: <code>org.apache.http.protocol.HttpContext</code> - * type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointConsumerBuilder httpContext( - Object httpContext) { - doSetProperty("httpContext", httpContext); - return this; - } - /** - * To use a custom HttpContext instance. - * - * The option will be converted to a - * <code>org.apache.http.protocol.HttpContext</code> type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointConsumerBuilder httpContext( - String httpContext) { - doSetProperty("httpContext", httpContext); - return this; - } - /** * If this option is true then IN exchange Body of the exchange will be * mapped to HTTP body. Setting this to false will avoid the HTTP * mapping. @@ -1034,32 +896,6 @@ public interface ResteasyEndpointBuilderFactory { return this; } /** - * The maximum number of connections. - * - * The option is a: <code>int</code> type. - * - * Default: 200 - * Group: advanced - */ - default AdvancedResteasyEndpointConsumerBuilder maxTotalConnections( - int maxTotalConnections) { - doSetProperty("maxTotalConnections", maxTotalConnections); - return this; - } - /** - * The maximum number of connections. - * - * The option will be converted to a <code>int</code> type. - * - * Default: 200 - * Group: advanced - */ - default AdvancedResteasyEndpointConsumerBuilder maxTotalConnections( - String maxTotalConnections) { - doSetProperty("maxTotalConnections", maxTotalConnections); - return this; - } - /** * Sets the flag to use the endpoint where you can either populate camel * exchange from servlet response or use request itself which may be * thought as if it is a proxy. @@ -2020,34 +1856,6 @@ public interface ResteasyEndpointBuilderFactory { return (ResteasyEndpointProducerBuilder) this; } /** - * To use a custom HttpBinding to control the mapping between Camel - * message and HttpClient. - * - * The option is a: - * <code>org.apache.camel.http.common.HttpBinding</code> type. - * - * Group: common (advanced) - */ - default AdvancedResteasyEndpointProducerBuilder httpBinding( - Object httpBinding) { - doSetProperty("httpBinding", httpBinding); - return this; - } - /** - * To use a custom HttpBinding to control the mapping between Camel - * message and HttpClient. - * - * The option will be converted to a - * <code>org.apache.camel.http.common.HttpBinding</code> type. - * - * Group: common (advanced) - */ - default AdvancedResteasyEndpointProducerBuilder httpBinding( - String httpBinding) { - doSetProperty("httpBinding", httpBinding); - return this; - } - /** * Configure a cookie handler to maintain a HTTP session. * * The option is a: @@ -2074,44 +1882,6 @@ public interface ResteasyEndpointBuilderFactory { return this; } /** - * To use a custom CookieStore. By default the BasicCookieStore is used - * which is an in-memory only cookie store. Notice if - * bridgeEndpoint=true then the cookie store is forced to be a noop - * cookie store as cookie shouldn't be stored as we are just bridging - * (eg acting as a proxy). If a cookieHandler is set then the cookie - * store is also forced to be a noop cookie store as cookie handling is - * then performed by the cookieHandler. - * - * The option is a: <code>org.apache.http.client.CookieStore</code> - * type. - * - * Group: producer (advanced) - */ - default AdvancedResteasyEndpointProducerBuilder cookieStore( - Object cookieStore) { - doSetProperty("cookieStore", cookieStore); - return this; - } - /** - * To use a custom CookieStore. By default the BasicCookieStore is used - * which is an in-memory only cookie store. Notice if - * bridgeEndpoint=true then the cookie store is forced to be a noop - * cookie store as cookie shouldn't be stored as we are just bridging - * (eg acting as a proxy). If a cookieHandler is set then the cookie - * store is also forced to be a noop cookie store as cookie handling is - * then performed by the cookieHandler. - * - * The option will be converted to a - * <code>org.apache.http.client.CookieStore</code> type. - * - * Group: producer (advanced) - */ - default AdvancedResteasyEndpointProducerBuilder cookieStore( - String cookieStore) { - doSetProperty("cookieStore", cookieStore); - return this; - } - /** * Whether the HTTP DELETE should include the message body or not. By * default HTTP DELETE do not include any HTTP body. However in some * rare cases users may need to be able to include the message body. @@ -2246,58 +2016,6 @@ public interface ResteasyEndpointBuilderFactory { return this; } /** - * To use a custom HttpClientConnectionManager to manage connections. - * - * The option is a: - * <code>org.apache.http.conn.HttpClientConnectionManager</code> type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointProducerBuilder clientConnectionManager( - Object clientConnectionManager) { - doSetProperty("clientConnectionManager", clientConnectionManager); - return this; - } - /** - * To use a custom HttpClientConnectionManager to manage connections. - * - * The option will be converted to a - * <code>org.apache.http.conn.HttpClientConnectionManager</code> type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointProducerBuilder clientConnectionManager( - String clientConnectionManager) { - doSetProperty("clientConnectionManager", clientConnectionManager); - return this; - } - /** - * The maximum number of connections per route. - * - * The option is a: <code>int</code> type. - * - * Default: 20 - * Group: advanced - */ - default AdvancedResteasyEndpointProducerBuilder connectionsPerRoute( - int connectionsPerRoute) { - doSetProperty("connectionsPerRoute", connectionsPerRoute); - return this; - } - /** - * The maximum number of connections per route. - * - * The option will be converted to a <code>int</code> type. - * - * Default: 20 - * Group: advanced - */ - default AdvancedResteasyEndpointProducerBuilder connectionsPerRoute( - String connectionsPerRoute) { - doSetProperty("connectionsPerRoute", connectionsPerRoute); - return this; - } - /** * To use a custom HeaderFilterStrategy to filter header to and from * Camel message. * @@ -2351,38 +2069,6 @@ public interface ResteasyEndpointBuilderFactory { return this; } /** - * Register a custom configuration strategy for new HttpClient instances - * created by producers or consumers such as to configure authentication - * mechanisms etc. - * - * The option is a: - * <code>org.apache.camel.component.http.HttpClientConfigurer</code> - * type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointProducerBuilder httpClientConfigurer( - Object httpClientConfigurer) { - doSetProperty("httpClientConfigurer", httpClientConfigurer); - return this; - } - /** - * Register a custom configuration strategy for new HttpClient instances - * created by producers or consumers such as to configure authentication - * mechanisms etc. - * - * The option will be converted to a - * <code>org.apache.camel.component.http.HttpClientConfigurer</code> - * type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointProducerBuilder httpClientConfigurer( - String httpClientConfigurer) { - doSetProperty("httpClientConfigurer", httpClientConfigurer); - return this; - } - /** * To configure the HttpClient using the key/values from the Map. * * The option is a: <code>java.util.Map<java.lang.String, @@ -2416,32 +2102,6 @@ public interface ResteasyEndpointBuilderFactory { return this; } /** - * To use a custom HttpContext instance. - * - * The option is a: <code>org.apache.http.protocol.HttpContext</code> - * type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointProducerBuilder httpContext( - Object httpContext) { - doSetProperty("httpContext", httpContext); - return this; - } - /** - * To use a custom HttpContext instance. - * - * The option will be converted to a - * <code>org.apache.http.protocol.HttpContext</code> type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointProducerBuilder httpContext( - String httpContext) { - doSetProperty("httpContext", httpContext); - return this; - } - /** * If this option is true then IN exchange Body of the exchange will be * mapped to HTTP body. Setting this to false will avoid the HTTP * mapping. @@ -2532,32 +2192,6 @@ public interface ResteasyEndpointBuilderFactory { return this; } /** - * The maximum number of connections. - * - * The option is a: <code>int</code> type. - * - * Default: 200 - * Group: advanced - */ - default AdvancedResteasyEndpointProducerBuilder maxTotalConnections( - int maxTotalConnections) { - doSetProperty("maxTotalConnections", maxTotalConnections); - return this; - } - /** - * The maximum number of connections. - * - * The option will be converted to a <code>int</code> type. - * - * Default: 200 - * Group: advanced - */ - default AdvancedResteasyEndpointProducerBuilder maxTotalConnections( - String maxTotalConnections) { - doSetProperty("maxTotalConnections", maxTotalConnections); - return this; - } - /** * Sets the flag to use the endpoint where you can either populate camel * exchange from servlet response or use request itself which may be * thought as if it is a proxy. @@ -2997,32 +2631,6 @@ public interface ResteasyEndpointBuilderFactory { return (ResteasyEndpointBuilder) this; } /** - * To use a custom HttpBinding to control the mapping between Camel - * message and HttpClient. - * - * The option is a: - * <code>org.apache.camel.http.common.HttpBinding</code> type. - * - * Group: common (advanced) - */ - default AdvancedResteasyEndpointBuilder httpBinding(Object httpBinding) { - doSetProperty("httpBinding", httpBinding); - return this; - } - /** - * To use a custom HttpBinding to control the mapping between Camel - * message and HttpClient. - * - * The option will be converted to a - * <code>org.apache.camel.http.common.HttpBinding</code> type. - * - * Group: common (advanced) - */ - default AdvancedResteasyEndpointBuilder httpBinding(String httpBinding) { - doSetProperty("httpBinding", httpBinding); - return this; - } - /** * Whether the endpoint should use basic property binding (Camel 2.x) or * the newer property binding with additional capabilities. * @@ -3081,58 +2689,6 @@ public interface ResteasyEndpointBuilderFactory { return this; } /** - * To use a custom HttpClientConnectionManager to manage connections. - * - * The option is a: - * <code>org.apache.http.conn.HttpClientConnectionManager</code> type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointBuilder clientConnectionManager( - Object clientConnectionManager) { - doSetProperty("clientConnectionManager", clientConnectionManager); - return this; - } - /** - * To use a custom HttpClientConnectionManager to manage connections. - * - * The option will be converted to a - * <code>org.apache.http.conn.HttpClientConnectionManager</code> type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointBuilder clientConnectionManager( - String clientConnectionManager) { - doSetProperty("clientConnectionManager", clientConnectionManager); - return this; - } - /** - * The maximum number of connections per route. - * - * The option is a: <code>int</code> type. - * - * Default: 20 - * Group: advanced - */ - default AdvancedResteasyEndpointBuilder connectionsPerRoute( - int connectionsPerRoute) { - doSetProperty("connectionsPerRoute", connectionsPerRoute); - return this; - } - /** - * The maximum number of connections per route. - * - * The option will be converted to a <code>int</code> type. - * - * Default: 20 - * Group: advanced - */ - default AdvancedResteasyEndpointBuilder connectionsPerRoute( - String connectionsPerRoute) { - doSetProperty("connectionsPerRoute", connectionsPerRoute); - return this; - } - /** * To use a custom HeaderFilterStrategy to filter header to and from * Camel message. * @@ -3184,38 +2740,6 @@ public interface ResteasyEndpointBuilderFactory { return this; } /** - * Register a custom configuration strategy for new HttpClient instances - * created by producers or consumers such as to configure authentication - * mechanisms etc. - * - * The option is a: - * <code>org.apache.camel.component.http.HttpClientConfigurer</code> - * type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointBuilder httpClientConfigurer( - Object httpClientConfigurer) { - doSetProperty("httpClientConfigurer", httpClientConfigurer); - return this; - } - /** - * Register a custom configuration strategy for new HttpClient instances - * created by producers or consumers such as to configure authentication - * mechanisms etc. - * - * The option will be converted to a - * <code>org.apache.camel.component.http.HttpClientConfigurer</code> - * type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointBuilder httpClientConfigurer( - String httpClientConfigurer) { - doSetProperty("httpClientConfigurer", httpClientConfigurer); - return this; - } - /** * To configure the HttpClient using the key/values from the Map. * * The option is a: <code>java.util.Map<java.lang.String, @@ -3248,30 +2772,6 @@ public interface ResteasyEndpointBuilderFactory { return this; } /** - * To use a custom HttpContext instance. - * - * The option is a: <code>org.apache.http.protocol.HttpContext</code> - * type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointBuilder httpContext(Object httpContext) { - doSetProperty("httpContext", httpContext); - return this; - } - /** - * To use a custom HttpContext instance. - * - * The option will be converted to a - * <code>org.apache.http.protocol.HttpContext</code> type. - * - * Group: advanced - */ - default AdvancedResteasyEndpointBuilder httpContext(String httpContext) { - doSetProperty("httpContext", httpContext); - return this; - } - /** * If this option is true then IN exchange Body of the exchange will be * mapped to HTTP body. Setting this to false will avoid the HTTP * mapping. @@ -3362,32 +2862,6 @@ public interface ResteasyEndpointBuilderFactory { return this; } /** - * The maximum number of connections. - * - * The option is a: <code>int</code> type. - * - * Default: 200 - * Group: advanced - */ - default AdvancedResteasyEndpointBuilder maxTotalConnections( - int maxTotalConnections) { - doSetProperty("maxTotalConnections", maxTotalConnections); - return this; - } - /** - * The maximum number of connections. - * - * The option will be converted to a <code>int</code> type. - * - * Default: 200 - * Group: advanced - */ - default AdvancedResteasyEndpointBuilder maxTotalConnections( - String maxTotalConnections) { - doSetProperty("maxTotalConnections", maxTotalConnections); - return this; - } - /** * Sets the flag to use the endpoint where you can either populate camel * exchange from servlet response or use request itself which may be * thought as if it is a proxy.