@UriEndpoint(scheme="restlet",
title="Restlet",
syntax="restlet:protocol:host:port/uriPattern",
consumerClass=RestletConsumer.class,
label="rest",
lenientProperties=true)
public class RestletEndpoint
extends org.apache.camel.impl.DefaultEndpoint
implements org.apache.camel.AsyncEndpoint, org.apache.camel.spi.HeaderFilterStrategyAware
| Constructor and Description |
|---|
RestletEndpoint(RestletComponent component,
String remaining) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect(RestletConsumer restletConsumer) |
org.apache.camel.Consumer |
createConsumer(org.apache.camel.Processor processor) |
org.apache.camel.Exchange |
createExchange() |
org.apache.camel.Producer |
createProducer() |
void |
disconnect(RestletConsumer restletConsumer) |
protected void |
doStart() |
protected void |
doStop() |
int |
getConnectTimeout() |
org.apache.camel.ExchangePattern |
getExchangePattern() |
org.apache.camel.spi.HeaderFilterStrategy |
getHeaderFilterStrategy() |
String |
getHost() |
int |
getPort() |
String |
getProtocol() |
RestletBinding |
getRestletBinding() |
org.restlet.data.Method |
getRestletMethod() |
org.restlet.data.Method[] |
getRestletMethods() |
Map<String,String> |
getRestletRealm() |
List<String> |
getRestletUriPatterns() |
int |
getSocketTimeout() |
org.apache.camel.util.jsse.SSLContextParameters |
getSslContextParameters() |
String |
getUriPattern() |
boolean |
isAutoCloseStream() |
boolean |
isDisableStreamCache() |
boolean |
isLenientProperties() |
boolean |
isSingleton() |
boolean |
isStreamRepresentation() |
boolean |
isThrowExceptionOnFailure() |
void |
setAutoCloseStream(boolean autoCloseStream)
Whether to auto close the stream representation as response from calling a REST service using the restlet producer.
|
void |
setConnectTimeout(int connectTimeout)
The Client will give up connection if the connection is timeout, 0 for unlimited wait.
|
void |
setDisableStreamCache(boolean disableStreamCache)
Determines whether or not the raw input stream from Restlet is cached or not
(Camel will read the stream into a in memory/overflow to file, Stream caching) cache.
|
void |
setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
To use a custom HeaderFilterStrategy to filter header to and from Camel message.
|
void |
setHost(String host)
The hostname of the restlet service
|
void |
setPort(int port)
The port number of the restlet service
|
void |
setProtocol(String protocol)
The protocol to use which is http or https
|
void |
setRestletBinding(RestletBinding restletBinding)
To use a custom RestletBinding to bind between Restlet and Camel message.
|
void |
setRestletMethod(org.restlet.data.Method restletMethod)
On a producer endpoint, specifies the request method to use.
|
void |
setRestletMethods(org.restlet.data.Method[] restletMethods)
Specify one or more methods separated by commas (e.g.
|
void |
setRestletRealm(Map<String,String> restletRealm)
To configure the security realms of restlet as a map.
|
void |
setRestletUriPatterns(List<String> restletUriPatterns)
Specify one ore more URI templates to be serviced by a restlet consumer endpoint, using the # notation to
reference a List
|
void |
setSocketTimeout(int socketTimeout)
The Client socket receive timeout, 0 for unlimited wait.
|
void |
setSslContextParameters(org.apache.camel.util.jsse.SSLContextParameters scp)
To configure security using SSLContextParameters.
|
void |
setStreamRepresentation(boolean streamRepresentation)
Whether to support stream representation as response from calling a REST service using the restlet producer.
|
void |
setThrowExceptionOnFailure(boolean throwExceptionOnFailure)
Whether to throw exception on a producer failure.
|
void |
setUriPattern(String uriPattern)
The resource pattern such as /customer/{id}
|
protected void |
updateEndpointUri() |
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExceptionHandler, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBridgeErrorHandler, isPollingConsumerBlockWhenFull, isSynchronous, setBridgeErrorHandler, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toStringdoResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic RestletEndpoint(RestletComponent component, String remaining) throws Exception
Exceptionpublic boolean isSingleton()
isSingleton in interface org.apache.camel.IsSingletonpublic boolean isLenientProperties()
isLenientProperties in interface org.apache.camel.EndpointisLenientProperties in class org.apache.camel.impl.DefaultEndpointpublic org.apache.camel.Exchange createExchange()
createExchange in interface org.apache.camel.EndpointcreateExchange in class org.apache.camel.impl.DefaultEndpointpublic org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
throws Exception
createConsumer in interface org.apache.camel.EndpointExceptionpublic org.apache.camel.Producer createProducer()
throws Exception
createProducer in interface org.apache.camel.EndpointExceptionpublic void connect(RestletConsumer restletConsumer) throws Exception
Exceptionpublic void disconnect(RestletConsumer restletConsumer) throws Exception
Exceptionpublic org.restlet.data.Method getRestletMethod()
public void setRestletMethod(org.restlet.data.Method restletMethod)
public String getProtocol()
public void setProtocol(String protocol)
public String getHost()
public void setHost(String host)
public int getPort()
public void setPort(int port)
public int getSocketTimeout()
public void setSocketTimeout(int socketTimeout)
public int getConnectTimeout()
public void setConnectTimeout(int connectTimeout)
public String getUriPattern()
public void setUriPattern(String uriPattern)
public RestletBinding getRestletBinding()
public void setRestletBinding(RestletBinding restletBinding)
public void setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
setHeaderFilterStrategy in interface org.apache.camel.spi.HeaderFilterStrategyAwarepublic org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
getHeaderFilterStrategy in interface org.apache.camel.spi.HeaderFilterStrategyAwarepublic void setRestletRealm(Map<String,String> restletRealm)
public org.apache.camel.ExchangePattern getExchangePattern()
getExchangePattern in class org.apache.camel.impl.DefaultEndpointpublic void setRestletMethods(org.restlet.data.Method[] restletMethods)
public org.restlet.data.Method[] getRestletMethods()
public void setRestletUriPatterns(List<String> restletUriPatterns)
public boolean isThrowExceptionOnFailure()
public void setThrowExceptionOnFailure(boolean throwExceptionOnFailure)
public boolean isDisableStreamCache()
public void setDisableStreamCache(boolean disableStreamCache)
public org.apache.camel.util.jsse.SSLContextParameters getSslContextParameters()
public void setSslContextParameters(org.apache.camel.util.jsse.SSLContextParameters scp)
public boolean isStreamRepresentation()
public void setStreamRepresentation(boolean streamRepresentation)
InputStream as the
message body on the Camel Message body. If using this option you may want to enable the
autoCloseStream option as well to ensure the input stream is closed when the Camel Exchange
is done being routed. However if you need to read the stream outside a Camel route, you may need
to not auto close the stream.public boolean isAutoCloseStream()
public void setAutoCloseStream(boolean autoCloseStream)
InputStream from the streaming response to ensure the input stream is closed when the Camel Exchange
is done being routed. However if you need to read the stream outside a Camel route, you may need
to not auto close the stream.protected void updateEndpointUri()
protected void doStart()
throws Exception
doStart in class org.apache.camel.impl.DefaultEndpointExceptionApache Camel