camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/8] camel git commit: Fixed component docs
Date Tue, 22 Mar 2016 15:56:46 GMT
Fixed component docs


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

Branch: refs/heads/master
Commit: 1c76b491d33488a51ad8f916fbf9dda23e9d7329
Parents: aa7ca43
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Mar 22 16:48:30 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Mar 22 16:48:30 2016 +0100

----------------------------------------------------------------------
 .../component/braintree/BraintreeComponent.java |  2 ++
 .../braintree/BraintreeConfiguration.java       | 30 ++++++++++++++++++++
 .../component/braintree/BraintreeEndpoint.java  | 14 ++++-----
 3 files changed, 39 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1c76b491/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeComponent.java
b/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeComponent.java
index 5b468cc..8918771 100644
--- a/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeComponent.java
+++ b/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeComponent.java
@@ -49,6 +49,8 @@ public class BraintreeComponent extends AbstractApiComponent<BraintreeApiName,
B
 
     @Override
     protected Endpoint createEndpoint(String uri, String methodName, BraintreeApiName apiName,
BraintreeConfiguration endpointConfiguration) {
+        endpointConfiguration.setApiName(apiName);
+        endpointConfiguration.setMethodName(methodName);
         return new BraintreeEndpoint(uri, this, apiName, methodName, endpointConfiguration,
getGateway(endpointConfiguration));
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/1c76b491/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeConfiguration.java
b/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeConfiguration.java
index e366c2c..4376a9e 100644
--- a/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeConfiguration.java
+++ b/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeConfiguration.java
@@ -18,9 +18,11 @@ package org.apache.camel.component.braintree;
 
 import com.braintreegateway.BraintreeGateway;
 import com.braintreegateway.Environment;
+import org.apache.camel.component.braintree.internal.BraintreeApiName;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriParams;
+import org.apache.camel.spi.UriPath;
 import org.apache.camel.util.ObjectHelper;
 
 /**
@@ -33,6 +35,12 @@ public class BraintreeConfiguration {
     private static final String PUBLIC_KEY  = "public_key";
     private static final String PRIVATE_KEY = "private_key";
 
+    @UriPath
+    @Metadata(required = "true")
+    private BraintreeApiName apiName;
+    @UriPath @Metadata(required = "true")
+    private String methodName;
+
     @UriParam
     @Metadata(required = "true")
     private String environment;
@@ -57,6 +65,28 @@ public class BraintreeConfiguration {
     @Metadata(label = "proxy")
     private Integer proxyPort;
 
+    public BraintreeApiName getApiName() {
+        return apiName;
+    }
+
+    /**
+     * What kind of operation to perform
+     */
+    public void setApiName(BraintreeApiName apiName) {
+        this.apiName = apiName;
+    }
+
+    public String getMethodName() {
+        return methodName;
+    }
+
+    /**
+     * What sub operation to use for the selected operation
+     */
+    public void setMethodName(String methodName) {
+        this.methodName = methodName;
+    }
+
     public String getEnvironment() {
         return ObjectHelper.notNull(environment, ENVIRONMENT);
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/1c76b491/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeEndpoint.java
b/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeEndpoint.java
index 5df6301..0c2af85 100644
--- a/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeEndpoint.java
+++ b/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeEndpoint.java
@@ -29,6 +29,7 @@ import org.apache.camel.component.braintree.internal.BraintreeApiName;
 import org.apache.camel.component.braintree.internal.BraintreeConstants;
 import org.apache.camel.component.braintree.internal.BraintreePropertiesHelper;
 import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
 import org.apache.camel.util.component.AbstractApiEndpoint;
 import org.apache.camel.util.component.ApiMethod;
@@ -37,21 +38,20 @@ import org.apache.camel.util.component.ApiMethodPropertiesHelper;
 /**
  * The braintree component is used for integrating with the Braintree Payment System.
  */
-@UriEndpoint(scheme = "braintree", title = "Braintree", syntax = "braintree:name", consumerClass
= BraintreeConsumer.class, label = "Braintree")
+@UriEndpoint(scheme = "braintree", title = "Braintree", syntax = "braintree:name", consumerClass
= BraintreeConsumer.class, label = "api,cloud,payment")
 public class BraintreeEndpoint extends AbstractApiEndpoint<BraintreeApiName, BraintreeConfiguration>
{
 
-    @UriPath(description = "the method name")
-    private final String name;
+    @UriParam
+    private final BraintreeConfiguration configuration;
 
     private Object apiProxy;
     private final BraintreeGateway gateway;
 
     public BraintreeEndpoint(String uri, BraintreeComponent component,
-                         BraintreeApiName apiName, String methodName, BraintreeConfiguration
endpointConfiguration, BraintreeGateway gateway) {
-        super(uri, component, apiName, methodName, BraintreeApiCollection.getCollection().getHelper(apiName),
endpointConfiguration);
-
+                         BraintreeApiName apiName, String methodName, BraintreeConfiguration
configuration, BraintreeGateway gateway) {
+        super(uri, component, apiName, methodName, BraintreeApiCollection.getCollection().getHelper(apiName),
configuration);
+        this.configuration = configuration;
         this.gateway = gateway;
-        this.name = methodName;
     }
 
     @Override


Mime
View raw message