You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/03/22 16:56:50 UTC
[7/8] camel git commit: Fixed component docs
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/7dc24fa9
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7dc24fa9
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7dc24fa9
Branch: refs/heads/camel-2.17.x
Commit: 7dc24fa99c5965dd5a36ae0ac44ea9abafe568fc
Parents: 7a00489
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Mar 22 16:48:30 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Mar 22 16:56:22 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/7dc24fa9/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/7dc24fa9/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/7dc24fa9/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