org.apache.camel.spi
Class RestConfiguration

java.lang.Object
  extended by org.apache.camel.spi.RestConfiguration

public class RestConfiguration
extends Object

Configuration use by RestConsumerFactory for Camel components to support the Camel rest DSL.


Nested Class Summary
static class RestConfiguration.RestBindingMode
           
static class RestConfiguration.RestHostNameResolver
           
 
Constructor Summary
RestConfiguration()
           
 
Method Summary
 RestConfiguration.RestBindingMode getBindingMode()
          Gets the binding mode used by the REST consumer
 String getComponent()
          Gets the name of the Camel component to use as the REST consumer
 Map<String,Object> getComponentProperties()
          Gets additional options on component level
 Map<String,Object> getConsumerProperties()
          Gets additional options on consumer level
 String getContextPath()
          Gets the configured context-path
 Map<String,Object> getDataFormatProperties()
          Gets additional options on data format level
 Map<String,Object> getEndpointProperties()
          Gets additional options on endpoint level
 String getHost()
          Gets the hostname to use by the REST consumer
 String getJsonDataFormat()
          Gets the name of the json data format.
 int getPort()
          Gets the port to use by the REST consumer
 RestConfiguration.RestHostNameResolver getRestHostNameResolver()
          Gets the resolver to use for resolving hostname
 String getScheme()
          Gets the scheme to use by the REST consumer
 String getXmlDataFormat()
          Gets the name of the xml data format.
 void setBindingMode(RestConfiguration.RestBindingMode bindingMode)
          Sets the binding mode to be used by the REST consumer
 void setBindingMode(String bindingMode)
          Sets the binding mode to be used by the REST consumer
 void setComponent(String componentName)
          Sets the name of the Camel component to use as the REST consumer
 void setComponentProperties(Map<String,Object> componentProperties)
          Sets additional options on component level
 void setConsumerProperties(Map<String,Object> consumerProperties)
          Sets additional options on consumer level
 void setContextPath(String contextPath)
          Sets a leading context-path the REST services will be using.
 void setDataFormatProperties(Map<String,Object> dataFormatProperties)
          Sets additional options on data format level
 void setEndpointProperties(Map<String,Object> endpointProperties)
          Sets additional options on endpoint level
 void setHost(String host)
          Sets the hostname to use by the REST consumer
 void setJsonDataFormat(String name)
          Sets a custom json data format to be used
 void setPort(int port)
          Sets the port to use by the REST consumer
 void setRestHostNameResolver(RestConfiguration.RestHostNameResolver restHostNameResolver)
          Sets the resolver to use for resolving hostname
 void setRestHostNameResolver(String restHostNameResolver)
          Sets the resolver to use for resolving hostname
 void setScheme(String scheme)
          Sets the scheme to use by the REST consumer
 void setXmlDataFormat(String name)
          Sets a custom xml data format to be used
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestConfiguration

public RestConfiguration()
Method Detail

getComponent

public String getComponent()
Gets the name of the Camel component to use as the REST consumer

Returns:
the component name, or null to let Camel search the Registry to find suitable implementation

setComponent

public void setComponent(String componentName)
Sets the name of the Camel component to use as the REST consumer

Parameters:
componentName - the name of the component (such as restlet, spark-rest, etc.)

getHost

public String getHost()
Gets the hostname to use by the REST consumer

Returns:
the hostname, or null to use default hostname

setHost

public void setHost(String host)
Sets the hostname to use by the REST consumer

Parameters:
host - the hostname

getScheme

public String getScheme()
Gets the scheme to use by the REST consumer

Returns:
the scheme, or null to use default scheme

setScheme

public void setScheme(String scheme)
Sets the scheme to use by the REST consumer

Parameters:
scheme - the scheme

getPort

public int getPort()
Gets the port to use by the REST consumer

Returns:
the port, or 0 or -1 to use default port

setPort

public void setPort(int port)
Sets the port to use by the REST consumer

Parameters:
port - the port number

getContextPath

public String getContextPath()
Gets the configured context-path

Returns:
the context path, or null if none configured.

setContextPath

public void setContextPath(String contextPath)
Sets a leading context-path the REST services will be using.

This can be used when using components such as camel-servlet where the deployed web application is deployed using a context-path.

Parameters:
contextPath - the context path

getRestHostNameResolver

public RestConfiguration.RestHostNameResolver getRestHostNameResolver()
Gets the resolver to use for resolving hostname

Returns:
the resolver

setRestHostNameResolver

public void setRestHostNameResolver(RestConfiguration.RestHostNameResolver restHostNameResolver)
Sets the resolver to use for resolving hostname

Parameters:
restHostNameResolver - the resolver

setRestHostNameResolver

public void setRestHostNameResolver(String restHostNameResolver)
Sets the resolver to use for resolving hostname

Parameters:
restHostNameResolver - the resolver

getBindingMode

public RestConfiguration.RestBindingMode getBindingMode()
Gets the binding mode used by the REST consumer

Returns:
the binding mode

setBindingMode

public void setBindingMode(RestConfiguration.RestBindingMode bindingMode)
Sets the binding mode to be used by the REST consumer

Parameters:
bindingMode - the binding mode

setBindingMode

public void setBindingMode(String bindingMode)
Sets the binding mode to be used by the REST consumer

Parameters:
bindingMode - the binding mode

getJsonDataFormat

public String getJsonDataFormat()
Gets the name of the json data format.

Returns:
the name, or null to use default

setJsonDataFormat

public void setJsonDataFormat(String name)
Sets a custom json data format to be used

Parameters:
name - name of the data format

getXmlDataFormat

public String getXmlDataFormat()
Gets the name of the xml data format.

Returns:
the name, or null to use default

setXmlDataFormat

public void setXmlDataFormat(String name)
Sets a custom xml data format to be used

Parameters:
name - name of the data format

getComponentProperties

public Map<String,Object> getComponentProperties()
Gets additional options on component level

Returns:
additional options

setComponentProperties

public void setComponentProperties(Map<String,Object> componentProperties)
Sets additional options on component level

Parameters:
componentProperties - the options

getEndpointProperties

public Map<String,Object> getEndpointProperties()
Gets additional options on endpoint level

Returns:
additional options

setEndpointProperties

public void setEndpointProperties(Map<String,Object> endpointProperties)
Sets additional options on endpoint level

Parameters:
endpointProperties - the options

getConsumerProperties

public Map<String,Object> getConsumerProperties()
Gets additional options on consumer level

Returns:
additional options

setConsumerProperties

public void setConsumerProperties(Map<String,Object> consumerProperties)
Sets additional options on consumer level

Parameters:
consumerProperties - the options

getDataFormatProperties

public Map<String,Object> getDataFormatProperties()
Gets additional options on data format level

Returns:
additional options

setDataFormatProperties

public void setDataFormatProperties(Map<String,Object> dataFormatProperties)
Sets additional options on data format level

Parameters:
dataFormatProperties - the options


Apache Camel