@Metadata(label="rest") public class RestConfigurationDefinition extends Object
Constructor and Description |
---|
RestConfigurationDefinition() |
Modifier and Type | Method and Description |
---|---|
RestConfiguration |
asRestConfiguration(CamelContext context)
Creates a
RestConfiguration instance based on the definition |
RestConfigurationDefinition |
bindingMode(RestBindingMode bindingMode)
To specify the binding mode
|
RestConfigurationDefinition |
component(String componentId)
To use a specific Camel rest component
|
RestConfigurationDefinition |
componentProperty(String key,
String value)
For additional configuration options on component level
|
RestConfigurationDefinition |
consumerProperty(String key,
String value)
For additional configuration options on consumer level
|
RestConfigurationDefinition |
contextPath(String contextPath)
Sets a leading context-path the REST services will be using.
|
RestConfigurationDefinition |
corsHeaderProperty(String key,
String value)
For configuring CORS headers
|
RestConfigurationDefinition |
dataFormatProperty(String key,
String value)
For additional configuration options on data format level
|
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
|
RestBindingMode |
getBindingMode() |
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 |
getScheme() |
Boolean |
getSkipBindingOnErrorCode() |
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 |
scheme(String scheme)
To use a specific scheme such as http/https
|
void |
setBindingMode(RestBindingMode bindingMode)
Sets the binding mode to use.
|
void |
setComponent(String component)
The Camel Rest component to use for the REST transport, 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 |
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 |
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 |
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 void setScheme(String scheme)
public void setPort(String port)
public String getContextPath()
public void setContextPath(String contextPath)
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 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> getCorsHeaders()
public void setCorsHeaders(List<RestPropertyDefinition> corsHeaders)
public RestConfigurationDefinition component(String componentId)
public RestConfigurationDefinition scheme(String scheme)
public RestConfigurationDefinition host(String host)
public RestConfigurationDefinition port(int port)
public RestConfigurationDefinition port(String port)
public RestConfigurationDefinition contextPath(String contextPath)
public RestConfigurationDefinition hostNameResolver(RestHostNameResolver hostNameResolver)
public RestConfigurationDefinition bindingMode(RestBindingMode bindingMode)
public RestConfigurationDefinition skipBindingOnErrorCode(boolean skipBindingOnErrorCode)
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 corsHeaderProperty(String key, String value)
public RestConfiguration asRestConfiguration(CamelContext context) throws Exception
RestConfiguration
instance based on the definitioncontext
- the camel contextException
- is thrown if error creating the configurationApache Camel