Package org.apache.camel.coap
Class CoAPEndpoint
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.coap.CoAPEndpoint
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.CamelContextAware,org.apache.camel.ComponentAware,org.apache.camel.Endpoint,org.apache.camel.IsSingleton,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasCamelContext,org.apache.camel.spi.HasId,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="2.16.0",
scheme="coap,coaps,coap+tcp,coaps+tcp",
title="CoAP",
syntax="coap:uri",
category=IOT,
headersClass=CoAPConstants.class)
public class CoAPEndpoint
extends org.apache.camel.support.DefaultEndpoint
Send and receive messages to/from COAP capable devices.
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.californium.core.CoapClientcreateCoapClient(URI uri) org.apache.camel.ConsumercreateConsumer(org.apache.camel.Processor processor) org.eclipse.californium.scandium.DTLSConnectorcreateDTLSConnector(InetSocketAddress address, boolean client) org.apache.camel.Producerstatic booleanenableDTLS(URI uri) static booleangetAlias()Gets the alias used to query the KeyStore for the private key and certificate.org.apache.camel.coap.CamelCoapResourcegetCamelCoapResource(String path) Gets the cipherSuites String.Gets the configuration options for server-side client-authentication requirements.Comma separated list of methods that the CoAP consumer will bind to.org.eclipse.californium.core.CoapServerGet the configured private key for use with Raw Public Key.org.eclipse.californium.scandium.dtls.pskstore.PskStoreGet the PskStore to use for pre-shared key.Get the configured public key for use with Raw Public Key.org.apache.camel.support.jsse.SSLContextParametersGet the SSLContextParameters object for setting up TLS.org.eclipse.californium.scandium.dtls.rpkstore.TrustedRpkStoreGet the TrustedRpkStore to use to determine trust in raw public keys.getUri()The URI for the CoAP endpointbooleanbooleanbooleanisNotify()booleanbooleanbooleanvoidSets the alias used to query the KeyStore for the private key and certificate.voidsetCipherSuites(String cipherSuites) Sets the cipherSuites String.voidsetClientAuthentication(String clientAuthentication) Sets the configuration options for server-side client-authentication requirements.voidsetCoapMethodRestrict(String coapMethodRestrict) voidsetNotify(boolean notify) Notify observers that the resource of this URI has changed, based on RFC 7641.voidsetObservable(boolean observable) Make CoAP resource observable for source endpoint, based on RFC 7641.voidsetObserve(boolean observe) Send an observe request from a source endpoint, based on RFC 7641.voidsetPrivateKey(PrivateKey privateKey) Set the configured private key for use with Raw Public Key.voidsetPskStore(org.eclipse.californium.scandium.dtls.pskstore.PskStore pskStore) Set the PskStore to use for pre-shared key.voidsetPublicKey(PublicKey publicKey) Set the configured public key for use with Raw Public Key.voidsetRecommendedCipherSuitesOnly(boolean recommendedCipherSuitesOnly) The CBC cipher suites are not recommended.voidsetSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) Set the SSLContextParameters object for setting up TLS.voidsetTrustedRpkStore(org.eclipse.californium.scandium.dtls.rpkstore.TrustedRpkStore trustedRpkStore) Set the TrustedRpkStore to use to determine trust in raw public keys.voidMethods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toStringMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.ComponentAware
getComponentMethods inherited from interface org.apache.camel.Endpoint
getEndpointBaseUri, isSingletonProducerMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
CoAPEndpoint
-
-
Method Details
-
setCoapMethodRestrict
-
getCoapMethodRestrict
Comma separated list of methods that the CoAP consumer will bind to. The default is to bind to all methods (DELETE, GET, POST, PUT). -
createProducer
- Throws:
Exception
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception - Throws:
Exception
-
setUri
-
getUri
The URI for the CoAP endpoint -
getCamelCoapResource
public org.apache.camel.coap.CamelCoapResource getCamelCoapResource(String path) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
getPathSegmentsFromURI
-
getCoapServer
public org.eclipse.californium.core.CoapServer getCoapServer() throws IOException, GeneralSecurityException- Throws:
IOExceptionGeneralSecurityException
-
getAlias
Gets the alias used to query the KeyStore for the private key and certificate. This parameter is used when we are enabling TLS with certificates on the service side, and similarly on the client side when TLS is used with certificates and client authentication. If the parameter is not specified then the default behavior is to use the first alias in the keystore that contains a key entry. This configuration parameter does not apply to configuring TLS via a Raw Public Key or a Pre-Shared Key. -
setAlias
Sets the alias used to query the KeyStore for the private key and certificate. This parameter is used when we are enabling TLS with certificates on the service side, and similarly on the client side when TLS is used with certificates and client authentication. If the parameter is not specified then the default behavior is to use the first alias in the keystore that contains a key entry. This configuration parameter does not apply to configuring TLS via a Raw Public Key or a Pre-Shared Key. -
isObserve
public boolean isObserve() -
setObserve
public void setObserve(boolean observe) Send an observe request from a source endpoint, based on RFC 7641. -
isObservable
public boolean isObservable() -
setObservable
public void setObservable(boolean observable) Make CoAP resource observable for source endpoint, based on RFC 7641. -
isNotify
public boolean isNotify() -
setNotify
public void setNotify(boolean notify) Notify observers that the resource of this URI has changed, based on RFC 7641. Use this flag on a destination endpoint, with an URI that matches an existing source endpoint URI. -
getSslContextParameters
public org.apache.camel.support.jsse.SSLContextParameters getSslContextParameters()Get the SSLContextParameters object for setting up TLS. This is required for coaps+tcp, and for coaps when we are using certificates for TLS (as opposed to RPK or PKS). -
setSslContextParameters
public void setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) Set the SSLContextParameters object for setting up TLS. This is required for coaps+tcp, and for coaps when we are using certificates for TLS (as opposed to RPK or PKS). -
getTrustedRpkStore
public org.eclipse.californium.scandium.dtls.rpkstore.TrustedRpkStore getTrustedRpkStore()Get the TrustedRpkStore to use to determine trust in raw public keys. -
setTrustedRpkStore
public void setTrustedRpkStore(org.eclipse.californium.scandium.dtls.rpkstore.TrustedRpkStore trustedRpkStore) Set the TrustedRpkStore to use to determine trust in raw public keys. -
getPskStore
public org.eclipse.californium.scandium.dtls.pskstore.PskStore getPskStore()Get the PskStore to use for pre-shared key. -
setPskStore
public void setPskStore(org.eclipse.californium.scandium.dtls.pskstore.PskStore pskStore) Set the PskStore to use for pre-shared key. -
getPrivateKey
Get the configured private key for use with Raw Public Key. -
setPrivateKey
Set the configured private key for use with Raw Public Key. -
getPublicKey
Get the configured public key for use with Raw Public Key. -
setPublicKey
Set the configured public key for use with Raw Public Key. -
getCipherSuites
Gets the cipherSuites String. This is a comma separated String of ciphersuites to configure. If it is not specified, then it falls back to getting the ciphersuites from the sslContextParameters object. -
setCipherSuites
Sets the cipherSuites String. This is a comma separated String of ciphersuites to configure. If it is not specified, then it falls back to getting the ciphersuites from the sslContextParameters object. -
getClientAuthentication
Gets the configuration options for server-side client-authentication requirements. The value is either null or one of NONE, WANT, REQUIRE. If this value is not specified, then it falls back to checking the sslContextParameters.getServerParameters().getClientAuthentication() value. -
setClientAuthentication
Sets the configuration options for server-side client-authentication requirements. The value must be one of NONE, WANT, REQUIRE. If this value is not specified, then it falls back to checking the sslContextParameters.getServerParameters().getClientAuthentication() value. -
isRecommendedCipherSuitesOnly
public boolean isRecommendedCipherSuitesOnly() -
setRecommendedCipherSuitesOnly
public void setRecommendedCipherSuitesOnly(boolean recommendedCipherSuitesOnly) The CBC cipher suites are not recommended. If you want to use them, you first need to set the recommendedCipherSuitesOnly option to false. -
isClientAuthenticationRequired
public boolean isClientAuthenticationRequired() -
isClientAuthenticationWanted
public boolean isClientAuthenticationWanted() -
enableDTLS
-
enableTCP
-
createDTLSConnector
public org.eclipse.californium.scandium.DTLSConnector createDTLSConnector(InetSocketAddress address, boolean client) throws IOException - Throws:
IOException
-
createCoapClient
public org.eclipse.californium.core.CoapClient createCoapClient(URI uri) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-