org.apache.camel.component.rest
Class RestEndpoint

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultEndpoint
          extended by org.apache.camel.component.rest.RestEndpoint
All Implemented Interfaces:
CamelContextAware, Endpoint, IsSingleton, Service, ShutdownableService, HasId, StatefulService, SuspendableService

@UriEndpoint(scheme="rest")
public class RestEndpoint
extends DefaultEndpoint


Field Summary
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
RestEndpoint(String endpointUri, RestComponent component)
           
 
Method Summary
 Consumer createConsumer(Processor processor)
          Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor
 Producer createProducer()
          Creates a new producer which is used send messages into the endpoint
 RestComponent getComponent()
          Returns the component that created this endpoint.
 String getComponentName()
           
 String getConsumes()
           
 String getMethod()
           
 Map<String,Object> getParameters()
           
 String getPath()
           
 String getProduces()
           
 String getUriTemplate()
           
 boolean isLenientProperties()
          Should all properties be known or does the endpoint allow unknown options?

lenient = false means that the endpoint should validate that all given options is known and configured properly.

 boolean isSingleton()
          Whether this class supports being singleton or not.
 void setComponentName(String componentName)
           
 void setConsumes(String consumes)
           
 void setMethod(String method)
           
 void setParameters(Map<String,Object> parameters)
           
 void setPath(String path)
           
 void setProduces(String produces)
           
 void setUriTemplate(String uriTemplate)
           
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, doStart, doStop, equals, getCamelContext, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExchangePattern, getId, getPollingConsumerQueueSize, hashCode, isPollingConsumerBlockWhenFull, isSynchronous, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

RestEndpoint

public RestEndpoint(String endpointUri,
                    RestComponent component)
Method Detail

getComponent

public RestComponent getComponent()
Description copied from class: DefaultEndpoint
Returns the component that created this endpoint.

Overrides:
getComponent in class DefaultEndpoint
Returns:
the component that created this endpoint, or null if none set

getMethod

public String getMethod()

setMethod

public void setMethod(String method)

getPath

public String getPath()

setPath

public void setPath(String path)

getUriTemplate

public String getUriTemplate()

setUriTemplate

public void setUriTemplate(String uriTemplate)

getConsumes

public String getConsumes()

setConsumes

public void setConsumes(String consumes)

getProduces

public String getProduces()

setProduces

public void setProduces(String produces)

getComponentName

public String getComponentName()

setComponentName

public void setComponentName(String componentName)

getParameters

public Map<String,Object> getParameters()

setParameters

public void setParameters(Map<String,Object> parameters)

createProducer

public Producer createProducer()
                        throws Exception
Description copied from interface: Endpoint
Creates a new producer which is used send messages into the endpoint

Returns:
a newly created producer
Throws:
Exception - can be thrown

createConsumer

public Consumer createConsumer(Processor processor)
                        throws Exception
Description copied from interface: Endpoint
Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor

Parameters:
processor - the given processor
Returns:
a newly created consumer
Throws:
Exception - can be thrown

isSingleton

public boolean isSingleton()
Description copied from interface: IsSingleton
Whether this class supports being singleton or not.

Returns:
true to be a single shared instance, false to create new instances.

isLenientProperties

public boolean isLenientProperties()
Description copied from interface: Endpoint
Should all properties be known or does the endpoint allow unknown options?

lenient = false means that the endpoint should validate that all given options is known and configured properly. lenient = true means that the endpoint allows additional unknown options to be passed to it but does not throw a ResolveEndpointFailedException when creating the endpoint.

This options is used by a few components for instance the HTTP based that can have dynamic URI options appended that is targeted for an external system.

Most endpoints is configured to be not lenient.

Specified by:
isLenientProperties in interface Endpoint
Overrides:
isLenientProperties in class DefaultEndpoint
Returns:
whether properties is lenient or not


Apache Camel