@Metadata(label="rest") public class RestConfigurationDefinition extends Object
Constructor and Description |
---|
RestConfigurationDefinition() |
Modifier and Type | Method and Description |
---|---|
RestConfigurationDefinition |
apiComponent(String componentId)
To use a specific Camel rest API component
|
RestConfigurationDefinition |
apiContextIdPattern(String pattern)
Sets an CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name matches the pattern.
|
RestConfigurationDefinition |
apiContextListing(boolean listing)
Sets whether listing of all available CamelContext's with REST services in the JVM is enabled.
|
RestConfigurationDefinition |
apiContextPath(String contextPath)
Sets a leading context-path the REST services will be using.
|
RestConfigurationDefinition |
apiContextRouteId(String routeId)
Sets the route id to use for the route that services the REST API.
|
RestConfigurationDefinition |
apiHost(String host)
To define a specific host to use for API documentation (eg swagger) instead
of using a generated API hostname that is relative to the REST service host.
|
RestConfigurationDefinition |
apiProperty(String key,
String value)
For configuring an api property, such as api.title, or api.version.
|
RestConfigurationDefinition |
apiVendorExtension(boolean vendorExtension)
Whether vendor extension is enabled in the Rest APIs.
|
org.apache.camel.spi.RestConfiguration |
asRestConfiguration(org.apache.camel.CamelContext context)
Creates a
RestConfiguration instance based on the definition |
RestConfigurationDefinition |
bindingMode(RestBindingMode bindingMode)
To specify the binding mode
|
RestConfigurationDefinition |
bindingMode(String bindingMode)
To specify the binding mode
|
RestConfigurationDefinition |
clientRequestValidation(boolean clientRequestValidation)
Whether to enable validation of the client request to check whether the Content-Type and Accept headers from
the client is supported by the Rest-DSL configuration of its consumes/produces settings.
|
RestConfigurationDefinition |
component(String componentId)
To use a specific Camel rest component (consumer)
|
RestConfigurationDefinition |
componentProperty(String key,
String value)
For additional configuration options on component level
The value can use # to refer to a bean to lookup in the registry.
|
RestConfigurationDefinition |
consumerProperty(String key,
String value)
For additional configuration options on consumer level
The value can use # to refer to a bean to lookup in the registry.
|
RestConfigurationDefinition |
contextPath(String contextPath)
Sets a leading context-path the REST services will be using.
|
RestConfigurationDefinition |
corsAllowCredentials(boolean corsAllowCredentials)
Shortcut for setting the
Access-Control-Allow-Credentials header. |
RestConfigurationDefinition |
corsHeaderProperty(String key,
String value)
For configuring CORS headers
|
RestConfigurationDefinition |
dataFormatProperty(String key,
String value)
For additional configuration options on data format level
The value can use # to refer to a bean to lookup in the registry.
|
RestConfigurationDefinition |
enableCORS(boolean enableCORS)
To specify whether to enable CORS which means Camel will automatic include CORS in the HTTP headers in the response.
|
RestConfigurationDefinition |
endpointProperty(String key,
String value)
For additional configuration options on endpoint level
The value can use # to refer to a bean to lookup in the registry.
|
String |
getApiComponent() |
String |
getApiContextIdPattern() |
Boolean |
getApiContextListing() |
String |
getApiContextPath() |
String |
getApiContextRouteId() |
String |
getApiHost() |
List<RestPropertyDefinition> |
getApiProperties() |
Boolean |
getApiVendorExtension() |
RestBindingMode |
getBindingMode() |
Boolean |
getClientRequestValidation() |
String |
getComponent() |
List<RestPropertyDefinition> |
getComponentProperties() |
List<RestPropertyDefinition> |
getConsumerProperties() |
String |
getContextPath() |
List<RestPropertyDefinition> |
getCorsHeaders() |
List<RestPropertyDefinition> |
getDataFormatProperties() |
Boolean |
getEnableCORS() |
List<RestPropertyDefinition> |
getEndpointProperties() |
String |
getHost() |
RestHostNameResolver |
getHostNameResolver() |
String |
getJsonDataFormat() |
String |
getPort() |
String |
getProducerApiDoc() |
String |
getProducerComponent() |
String |
getScheme() |
Boolean |
getSkipBindingOnErrorCode() |
Boolean |
getUseXForwardHeaders() |
String |
getXmlDataFormat() |
RestConfigurationDefinition |
host(String host)
To define the host to use, such as 0.0.0.0 or localhost
|
RestConfigurationDefinition |
hostNameResolver(RestHostNameResolver hostNameResolver)
To specify the hostname resolver
|
RestConfigurationDefinition |
jsonDataFormat(String name)
To use a specific json data format
Important: This option is only for setting a custom name of the data format, not to refer to an existing data format instance.
|
RestConfigurationDefinition |
port(int port)
To specify the port number to use for the REST service
|
RestConfigurationDefinition |
port(String port)
To specify the port number to use for the REST service
|
RestConfigurationDefinition |
producerApiDoc(String apiDoc)
Sets the location of the api document (swagger api) the REST producer will use
to validate the REST uri and query parameters are valid accordingly to the api document.
|
RestConfigurationDefinition |
producerComponent(String componentId)
To use a specific Camel rest component (producer)
|
RestConfigurationDefinition |
scheme(String scheme)
To use a specific scheme such as http/https
|
void |
setApiComponent(String apiComponent)
The name of the Camel component to use as the REST API (such as swagger)
|
void |
setApiContextIdPattern(String apiContextIdPattern)
Sets an CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name matches the pattern.
|
void |
setApiContextListing(Boolean apiContextListing)
Sets whether listing of all available CamelContext's with REST services in the JVM is enabled.
|
void |
setApiContextPath(String contextPath)
Sets a leading API context-path the REST API services will be using.
|
void |
setApiContextRouteId(String apiContextRouteId)
Sets the route id to use for the route that services the REST API.
|
void |
setApiHost(String apiHost)
To use an specific hostname for the API documentation (eg swagger)
This can be used to override the generated host with this configured hostname
|
void |
setApiProperties(List<RestPropertyDefinition> apiProperties)
Allows to configure as many additional properties for the api documentation (swagger).
|
void |
setApiVendorExtension(Boolean apiVendorExtension)
Whether vendor extension is enabled in the Rest APIs.
|
void |
setBindingMode(RestBindingMode bindingMode)
Sets the binding mode to use.
|
void |
setClientRequestValidation(Boolean clientRequestValidation)
Whether to enable validation of the client request to check whether the Content-Type and Accept headers from
the client is supported by the Rest-DSL configuration of its consumes/produces settings.
|
void |
setComponent(String component)
The Camel Rest component to use for the REST transport (consumer), such as restlet, spark-rest.
|
void |
setComponentProperties(List<RestPropertyDefinition> componentProperties)
Allows to configure as many additional properties for the rest component in use.
|
void |
setConsumerProperties(List<RestPropertyDefinition> consumerProperties)
Allows to configure as many additional properties for the rest consumer in use.
|
void |
setContextPath(String contextPath)
Sets a leading context-path the REST services will be using.
|
void |
setCorsHeaders(List<RestPropertyDefinition> corsHeaders)
Allows to configure custom CORS headers.
|
void |
setDataFormatProperties(List<RestPropertyDefinition> dataFormatProperties)
Allows to configure as many additional properties for the data formats in use.
|
void |
setEnableCORS(Boolean enableCORS)
Whether to enable CORS headers in the HTTP response.
|
void |
setEndpointProperties(List<RestPropertyDefinition> endpointProperties)
Allows to configure as many additional properties for the rest endpoint in use.
|
void |
setHost(String host)
The hostname to use for exposing the REST service.
|
void |
setHostNameResolver(RestHostNameResolver hostNameResolver)
If no hostname has been explicit configured, then this resolver is used to compute the hostname the REST service will be using.
|
void |
setJsonDataFormat(String jsonDataFormat)
Name of specific json data format to use.
|
void |
setPort(String port)
The port number to use for exposing the REST service.
|
void |
setProducerApiDoc(String producerApiDoc)
Sets the location of the api document (swagger api) the REST producer will use
to validate the REST uri and query parameters are valid accordingly to the api document.
|
void |
setProducerComponent(String producerComponent)
Sets the name of the Camel component to use as the REST producer
|
void |
setScheme(String scheme)
The scheme to use for exposing the REST service.
|
void |
setSkipBindingOnErrorCode(Boolean skipBindingOnErrorCode)
Whether to skip binding on output if there is a custom HTTP error code header.
|
void |
setUseXForwardHeaders(Boolean useXForwardHeaders)
Whether to use X-Forward headers for Host and related setting.
|
void |
setXmlDataFormat(String xmlDataFormat)
Name of specific XML data format to use.
|
RestConfigurationDefinition |
skipBindingOnErrorCode(boolean skipBindingOnErrorCode)
To specify whether to skip binding output if there is a custom HTTP error code
|
RestConfigurationDefinition |
useXForwardHeaders(boolean useXForwardHeaders)
To specify whether to use X-Forward headers for Host and related setting
|
RestConfigurationDefinition |
xmlDataFormat(String name)
To use a specific XML data format
Important: This option is only for setting a custom name of the data format, not to refer to an existing data format instance.
|
public RestConfigurationDefinition()
public String getComponent()
public void setComponent(String component)
public String getApiComponent()
public void setApiComponent(String apiComponent)
public String getProducerComponent()
public void setProducerComponent(String producerComponent)
public void setScheme(String scheme)
public String getApiHost()
public void setApiHost(String apiHost)
public void setPort(String port)
public String getProducerApiDoc()
public void setProducerApiDoc(String producerApiDoc)
public String getContextPath()
public void setContextPath(String contextPath)
public String getApiContextPath()
public void setApiContextPath(String contextPath)
contextPath
- the API context pathpublic String getApiContextRouteId()
public void setApiContextRouteId(String apiContextRouteId)
apiContextRouteId
- the route idpublic String getApiContextIdPattern()
public void setApiContextIdPattern(String apiContextIdPattern)
PatternHelper.matchPattern(String, String)
apiContextIdPattern
- the patternpublic Boolean getApiContextListing()
public void setApiContextListing(Boolean apiContextListing)
public Boolean getApiVendorExtension()
public void setApiVendorExtension(Boolean apiVendorExtension)
public RestHostNameResolver getHostNameResolver()
public void setHostNameResolver(RestHostNameResolver hostNameResolver)
public RestBindingMode getBindingMode()
public void setBindingMode(RestBindingMode bindingMode)
public Boolean getSkipBindingOnErrorCode()
public void setSkipBindingOnErrorCode(Boolean skipBindingOnErrorCode)
public Boolean getClientRequestValidation()
public void setClientRequestValidation(Boolean clientRequestValidation)
public Boolean getEnableCORS()
public void setEnableCORS(Boolean enableCORS)
public String getJsonDataFormat()
public void setJsonDataFormat(String jsonDataFormat)
public String getXmlDataFormat()
public void setXmlDataFormat(String xmlDataFormat)
public List<RestPropertyDefinition> getComponentProperties()
public void setComponentProperties(List<RestPropertyDefinition> componentProperties)
public List<RestPropertyDefinition> getEndpointProperties()
public void setEndpointProperties(List<RestPropertyDefinition> endpointProperties)
public List<RestPropertyDefinition> getConsumerProperties()
public void setConsumerProperties(List<RestPropertyDefinition> consumerProperties)
public List<RestPropertyDefinition> getDataFormatProperties()
public void setDataFormatProperties(List<RestPropertyDefinition> dataFormatProperties)
public List<RestPropertyDefinition> getApiProperties()
public void setApiProperties(List<RestPropertyDefinition> apiProperties)
public List<RestPropertyDefinition> getCorsHeaders()
public void setCorsHeaders(List<RestPropertyDefinition> corsHeaders)
public Boolean getUseXForwardHeaders()
public void setUseXForwardHeaders(Boolean useXForwardHeaders)
public RestConfigurationDefinition component(String componentId)
public RestConfigurationDefinition apiComponent(String componentId)
public RestConfigurationDefinition producerComponent(String componentId)
public RestConfigurationDefinition scheme(String scheme)
public RestConfigurationDefinition host(String host)
public RestConfigurationDefinition apiHost(String host)
public RestConfigurationDefinition port(int port)
public RestConfigurationDefinition port(String port)
public RestConfigurationDefinition producerApiDoc(String apiDoc)
public RestConfigurationDefinition apiContextPath(String contextPath)
public RestConfigurationDefinition apiContextRouteId(String routeId)
public RestConfigurationDefinition apiContextIdPattern(String pattern)
public RestConfigurationDefinition apiContextListing(boolean listing)
public RestConfigurationDefinition apiVendorExtension(boolean vendorExtension)
public RestConfigurationDefinition contextPath(String contextPath)
public RestConfigurationDefinition hostNameResolver(RestHostNameResolver hostNameResolver)
public RestConfigurationDefinition bindingMode(RestBindingMode bindingMode)
public RestConfigurationDefinition bindingMode(String bindingMode)
public RestConfigurationDefinition skipBindingOnErrorCode(boolean skipBindingOnErrorCode)
public RestConfigurationDefinition clientRequestValidation(boolean clientRequestValidation)
public RestConfigurationDefinition enableCORS(boolean enableCORS)
public RestConfigurationDefinition jsonDataFormat(String name)
name
- name of the data format to resolve
public RestConfigurationDefinition xmlDataFormat(String name)
name
- name of the data format to resolve
public RestConfigurationDefinition componentProperty(String key, String value)
public RestConfigurationDefinition endpointProperty(String key, String value)
public RestConfigurationDefinition consumerProperty(String key, String value)
public RestConfigurationDefinition dataFormatProperty(String key, String value)
public RestConfigurationDefinition apiProperty(String key, String value)
public RestConfigurationDefinition corsHeaderProperty(String key, String value)
public RestConfigurationDefinition corsAllowCredentials(boolean corsAllowCredentials)
Access-Control-Allow-Credentials
header.public RestConfigurationDefinition useXForwardHeaders(boolean useXForwardHeaders)
public org.apache.camel.spi.RestConfiguration asRestConfiguration(org.apache.camel.CamelContext context) throws Exception
RestConfiguration
instance based on the definitioncontext
- the camel contextException
- is thrown if error creating the configurationApache Camel