camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/4] camel git commit: CAMEL-7999: More components include documentation
Date Fri, 19 Dec 2014 13:06:23 GMT
CAMEL-7999: More components include documentation


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/009c3748
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/009c3748
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/009c3748

Branch: refs/heads/master
Commit: 009c37487573e09f3457666a936d042f0d4dee51
Parents: e8ad42b
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri Dec 19 13:38:35 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Dec 19 13:38:35 2014 +0100

----------------------------------------------------------------------
 .../camel/component/irc/IrcComponent.java       |  8 +++--
 .../camel/component/irc/IrcConfiguration.java   | 34 +++++++++++++++++++-
 .../apache/camel/component/irc/IrcEndpoint.java |  8 +++--
 3 files changed, 45 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/009c3748/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java
b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java
index c2522b4..edf4dc0 100644
--- a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java
+++ b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java
@@ -20,7 +20,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.impl.UriEndpointComponent;
 import org.schwering.irc.lib.IRCConnection;
 import org.schwering.irc.lib.IRCEventListener;
 import org.schwering.irc.lib.ssl.SSLIRCConnection;
@@ -32,10 +32,14 @@ import org.slf4j.LoggerFactory;
  *
  * @version 
  */
-public class IrcComponent extends DefaultComponent {
+public class IrcComponent extends UriEndpointComponent {
     private static final Logger LOG = LoggerFactory.getLogger(IrcComponent.class);
     private final Map<String, IRCConnection> connectionCache = new HashMap<String,
IRCConnection>();
 
+    public IrcComponent() {
+        super(IrcEndpoint.class);
+    }
+
     public IrcEndpoint createEndpoint(String uri, String remaining, Map<String, Object>
parameters) throws Exception {
         // every endpoint gets it's own configuration
         IrcConfiguration config = new IrcConfiguration();

http://git-wip-us.apache.org/repos/asf/camel/blob/009c3748/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java
b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java
index fe8bcd9..5ee86ad 100644
--- a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java
+++ b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java
@@ -26,6 +26,9 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.apache.camel.spi.UriPath;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.URISupport;
 import org.apache.camel.util.UnsafeUriCharactersEncoder;
@@ -35,30 +38,50 @@ import org.schwering.irc.lib.ssl.SSLTrustManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@UriParams
 public class IrcConfiguration implements Cloneable {
     private static final Logger LOG = LoggerFactory.getLogger(IrcConfiguration.class);
 
     private List<IrcChannel> channels = new ArrayList<IrcChannel>();
+    @UriPath
     private String hostname;
+    @UriPath
+    private int port;
+    private int[] ports = {6667, 6668, 6669};
+    @UriParam
     private String password;
+    @UriParam
     private String nickname;
+    @UriParam
     private String realname;
+    @UriParam
     private String username;
     private SSLTrustManager trustManager = new SSLDefaultTrustManager();
     private boolean usingSSL;
+    @UriParam(defaultValue = "true")
     private boolean persistent = true;
+    @UriParam(defaultValue = "true")
     private boolean colors = true;
+    @UriParam(defaultValue = "true")
     private boolean onNick = true;
+    @UriParam(defaultValue = "true")
     private boolean onQuit = true;
+    @UriParam(defaultValue = "true")
     private boolean onJoin = true;
+    @UriParam(defaultValue = "true")
     private boolean onKick = true;
+    @UriParam(defaultValue = "true")
     private boolean onMode = true;
+    @UriParam(defaultValue = "true")
     private boolean onPart = true;
+    @UriParam(defaultValue = "false")
     private boolean onReply;
+    @UriParam(defaultValue = "true")
     private boolean onTopic = true;
+    @UriParam(defaultValue = "true")
     private boolean onPrivmsg = true;
+    @UriParam(defaultValue = "true")
     private boolean autoRejoin = true;
-    private int[] ports = {6667, 6668, 6669};
     private SSLContextParameters sslContextParameters;
 
     public IrcConfiguration() {
@@ -135,6 +158,7 @@ public class IrcConfiguration implements Cloneable {
         
         if (uri.getPort() != -1) {
             setPorts(new int[] {uri.getPort()});
+            setPort(uri.getPort());
         }
         
         setNickname(username);
@@ -236,6 +260,14 @@ public class IrcConfiguration implements Cloneable {
         this.ports = ports;
     }
 
+    public int getPort() {
+        return port;
+    }
+
+    public void setPort(int port) {
+        this.port = port;
+    }
+
     public boolean isPersistent() {
         return persistent;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/009c3748/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java
b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java
index bad8d02..7e84b38 100644
--- a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java
+++ b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java
@@ -21,6 +21,8 @@ import org.apache.camel.ExchangePattern;
 import org.apache.camel.Processor;
 import org.apache.camel.impl.DefaultEndpoint;
 import org.apache.camel.impl.DefaultExchange;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.UnsafeUriCharactersEncoder;
 import org.schwering.irc.lib.IRCConnection;
@@ -35,11 +37,13 @@ import org.slf4j.LoggerFactory;
  *
  * @version 
  */
+@UriEndpoint(scheme = "irc", consumerClass = IrcConsumer.class, label = "chat")
 public class IrcEndpoint extends DefaultEndpoint {
     private static final Logger LOG = LoggerFactory.getLogger(IrcEndpoint.class);
-    
-    private IrcBinding binding;
+
+    @UriParam
     private IrcConfiguration configuration;
+    private IrcBinding binding;
     private IrcComponent component;
 
     public IrcEndpoint(String endpointUri, IrcComponent component, IrcConfiguration configuration)
{


Mime
View raw message