Repository: camel Updated Branches: refs/heads/master d298a84f8 -> 44c7bd696
Added camel-irc docs to gitbook Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a858596b Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a858596b Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a858596b Branch: refs/heads/master Commit: a858596b5901c68b76655269d19a0055608d2a96 Parents: d298a84 Author: Andrea Cosentino <anco...@gmail.com> Authored: Thu Apr 21 17:54:48 2016 +0200 Committer: Andrea Cosentino <anco...@gmail.com> Committed: Thu Apr 21 17:54:48 2016 +0200 ---------------------------------------------------------------------- components/camel-irc/src/main/docs/irc.adoc | 181 +++++++++++++++++++++++ docs/user-manual/en/SUMMARY.md | 1 + 2 files changed, 182 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/a858596b/components/camel-irc/src/main/docs/irc.adoc ---------------------------------------------------------------------- diff --git a/components/camel-irc/src/main/docs/irc.adoc b/components/camel-irc/src/main/docs/irc.adoc new file mode 100644 index 0000000..07b96e9 --- /dev/null +++ b/components/camel-irc/src/main/docs/irc.adoc @@ -0,0 +1,181 @@ +[[IRC-IRCComponent]] +IRC Component +~~~~~~~~~~~~~ + +The *irc* component implements an +http://en.wikipedia.org/wiki/Internet_Relay_Chat[IRC] (Internet Relay +Chat) transport. + +Maven users will need to add the following dependency to their `pom.xml` +for this component: + +[source,xml] +------------------------------------------------------------ +<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-irc</artifactId> + <version>x.x.x</version> + <!-- use the same version as your Camel core version --> +</dependency> +------------------------------------------------------------ + +[[IRC-URIformat]] +URI format +^^^^^^^^^^ + +[source,java] +--------------------------------------------------------------------- +irc:nick@host[:port]/#room[?options] +irc:nick@host[:port]?channels=#channel1,#channel2,#channel3[?options] +--------------------------------------------------------------------- + +You can append query options to the URI in the following format, +`?option=value&option=value&...` + +[[IRC-Options]] +Options +^^^^^^^ + + +// component options: START +The IRC component has no options. +// component options: END + + + +// endpoint options: START +The IRC component supports 23 endpoint options which are listed below: + +[width="100%",cols="2s,1,1m,1m,5",options="header"] +|======================================================================= +| Name | Group | Default | Java Type | Description +| hostname | common | | String | *Required* Hostname for the IRC chat server +| port | common | 6667,6668,6669 | int | Port number for the IRC chat server +| autoRejoin | common | true | boolean | Whether to auto re-join when being kicked +| colors | common | true | boolean | Whether or not the server supports color codes. +| nickname | common | | String | The nickname used in chat. +| nickPassword | common | | String | Your IRC server nickname password. +| onJoin | common | true | boolean | Handle user join events. +| onKick | common | true | boolean | Handle kick events. +| onMode | common | true | boolean | Handle mode change events. +| onNick | common | true | boolean | Handle nickname change events. +| onPart | common | true | boolean | Handle user part events. +| onPrivmsg | common | true | boolean | Handle private message events. +| onQuit | common | true | boolean | Handle user quit events. +| onReply | common | false | boolean | Whether or not to handle general responses to commands or informational messages. +| onTopic | common | true | boolean | Handle topic change events. +| password | common | | String | The IRC server password. +| persistent | common | true | boolean | Use persistent messages. +| realname | common | | String | The IRC user's actual name. +| username | common | | String | The IRC server user name. +| bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored. +| exceptionHandler | consumer (advanced) | | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored. +| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange +| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). +|======================================================================= +// endpoint options: END + + +[[IRC-SSLSupport]] +SSL Support +^^^^^^^^^^^ + +[[IRC-UsingtheJSSEConfigurationUtility]] +Using the JSSE Configuration Utility +++++++++++++++++++++++++++++++++++++ + +As of Camel 2.9, the IRC component supports SSL/TLS configuration +through the link:camel-configuration-utilities.html[Camel JSSE +Configuration Utility]. This utility greatly decreases the amount of +component specific code you need to write and is configurable at the +endpoint and component levels. The following examples demonstrate how +to use the utility with the IRC component. + +[[IRC-Programmaticconfigurationoftheendpoint]] +Programmatic configuration of the endpoint + +[source,java] +----------------------------------------------------------------------------------------------------------------------------------------- +KeyStoreParameters ksp = new KeyStoreParameters(); +ksp.setResource("/users/home/server/truststore.jks"); +ksp.setPassword("keystorePassword"); + +TrustManagersParameters tmp = new TrustManagersParameters(); +tmp.setKeyStore(ksp); + +SSLContextParameters scp = new SSLContextParameters(); +scp.setTrustManagers(tmp); + +Registry registry = ... +registry.bind("sslContextParameters", scp); + +... + +from(...) + .to("ircs://camel-prd-user@server:6669/#camel-test?nickname=camel-prd&password=password&sslContextParameters=#sslContextParameters"); +----------------------------------------------------------------------------------------------------------------------------------------- + +[[IRC-SpringDSLbasedconfigurationofendpoint]] +Spring DSL based configuration of endpoint + +[source,xml] +---------------------------------------------------------------------------------------------------------------------------------------------- +... + <camel:sslContextParameters + id="sslContextParameters"> + <camel:trustManagers> + <camel:keyStore + resource="/users/home/server/truststore.jks" + password="keystorePassword"/> + </camel:keyManagers> + </camel:sslContextParameters>... +... + <to uri="ircs://camel-prd-user@server:6669/#camel-test?nickname=camel-prd&password=password&sslContextParameters=#sslContextParameters"/>... +---------------------------------------------------------------------------------------------------------------------------------------------- + +[[IRC-Usingthelegacybasicconfigurationoptions]] +Using the legacy basic configuration options +++++++++++++++++++++++++++++++++++++++++++++ + +You can also connect to an SSL enabled IRC server, as follows: + +[source,java] +-------------------------------------------------- +ircs:host[:port]/#room?username=user&password=pass +-------------------------------------------------- + +By default, the IRC transport uses +http://moepii.sourceforge.net/irclib/javadoc/org/schwering/irc/lib/ssl/SSLDefaultTrustManager.html[SSLDefaultTrustManager]. +If you need to provide your own custom trust manager, use the +`trustManager` parameter as follows: + +[source,java] +---------------------------------------------------------------------------------------------- +ircs:host[:port]/#room?username=user&password=pass&trustManager=#referenceToMyTrustManagerBean +---------------------------------------------------------------------------------------------- + +[[IRC-Usingkeys]] +Using keys +^^^^^^^^^^ + +*Available as of Camel 2.2* + +Some irc rooms requires you to provide a key to be able to join that +channel. The key is just a secret word. + +For example we join 3 channels where as only channel 1 and 3 uses a key. + +[source,java] +----------------------------------------------------------------------------- +irc:n...@irc.server.org?channels=#chan1,#chan2,#chan3&keys=chan1Key,,chan3key +----------------------------------------------------------------------------- + +[[IRC-SeeAlso]] +See Also +^^^^^^^^ + +* link:configuring-camel.html[Configuring Camel] +* link:component.html[Component] +* link:endpoint.html[Endpoint] +* link:getting-started.html[Getting Started] + http://git-wip-us.apache.org/repos/asf/camel/blob/a858596b/docs/user-manual/en/SUMMARY.md ---------------------------------------------------------------------- diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md index 4c97057..958f0f1 100644 --- a/docs/user-manual/en/SUMMARY.md +++ b/docs/user-manual/en/SUMMARY.md @@ -158,6 +158,7 @@ * [Hystrix](hystrix.adoc) * [Ibatis](ibatis.adoc) * [Infinispan](infinispan.adoc) + * [IRC](irc.adoc) * [Ironmq](ironmq.adoc) * [JMS](jms.adoc) * [JMX](jmx.adoc)