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 2017/03/06 11:10:50 UTC
[05/15] camel git commit: CAMEL-9047: Rename box2 to box
http://git-wip-us.apache.org/repos/asf/camel/blob/db0ca734/components/camel-box2/camel-box2-component/src/test/resources/test-options.properties
----------------------------------------------------------------------
diff --git a/components/camel-box2/camel-box2-component/src/test/resources/test-options.properties b/components/camel-box2/camel-box2-component/src/test/resources/test-options.properties
deleted file mode 100644
index c5a5481..0000000
--- a/components/camel-box2/camel-box2-component/src/test/resources/test-options.properties
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-###############################################
-## Authentication properties for Box2 Component
-###############################################
-
-#############################################################################
-## Authentication properties for Box2 Component using STANDARD_AUTHENTICATION
-#############################################################################
-authenticationType=STANDARD_AUTHENTICATION
-## User name and password
-## Create a free developer account on http://developers.box.com/ and provide user name password
-userName=
-userPassword=
-## Application client id and secret
-## Create a test Box.com application and provide its clientId and clientSecret
-clientId=
-clientSecret=
http://git-wip-us.apache.org/repos/asf/camel/blob/db0ca734/components/camel-box2/camel-box2-component/tmp/test-options.properties
----------------------------------------------------------------------
diff --git a/components/camel-box2/camel-box2-component/tmp/test-options.properties b/components/camel-box2/camel-box2-component/tmp/test-options.properties
deleted file mode 100644
index 30a032c..0000000
--- a/components/camel-box2/camel-box2-component/tmp/test-options.properties
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-###############################################
-## Authentication properties for Box2 Component
-###############################################
-
-#############################################################################
-## Authentication properties for Box2 Component using STANDARD_AUTHENTICATION
-#############################################################################
-authenticationType=STANDARD_AUTHENTICATION
-## User name and password
-## Create a free developer account on http://developers.box.com/ and provide user name password
-userName=punkhornsw@gmail.com
-userPassword=RedHat12!@
-## Application client id and secret
-## Create a test Box.com application and provide its clientId and clientSecret
-clientId=4vvr1njh5d0u3o8lpowbgnameqic9mz3
-clientSecret=rh0qN6EWyMek61fELV8N82XblkK2EJMr
-
-###################################################################################
-## Authentication properties for Box2 Component using APP_ENTERPRISE_AUTHENTICATION
-###################################################################################
-#authenticationType=APP_ENTERPRISE_AUTHENTICATION
-#enterpriseId=8962085
-#clientId=4vvr1njh5d0u3o8lpowbgnameqic9mz3
-#clientSecret=rh0qN6EWyMek61fELV8N82XblkK2EJMr
-#publicKeyId=b22nf9qt
-#privateKeyFile=/Volumes/Development/Dev/box-java-sdk/private_key.pem
-#privateKeyPassword=RedHat12!@
-#encryptionAlgorithm=RSA_SHA_256
-#maxCacheEntries=100
-### Application client id and secret
-### Create a test Box.com application and provide its clientId and clientSecret
-#clientId=4vvr1njh5d0u3o8lpowbgnameqic9mz3
-#clientSecret=rh0qN6EWyMek61fELV8N82XblkK2EJMr
-
-###################################################################################
-## Authentication properties for Box2 Component using APP_USER_AUTHENTICATION
-###################################################################################
-#authenticationType=APP_USER_AUTHENTICATION
-#userId=punkhornsw@gmail.com
-#clientId=4vvr1njh5d0u3o8lpowbgnameqic9mz3
-#clientSecret=rh0qN6EWyMek61fELV8N82XblkK2EJMr
-#publicKeyId=b22nf9qt
-#privateKeyFile=/Volumes/Development/Dev/box-java-sdk/private_key.pem
-#privateKeyPassword=RedHat12!@
-#encryptionAlgorithm=RSA_SHA_256
-#maxCacheEntries=100
-### Application client id and secret
-### Create a test Box.com application and provide its clientId and clientSecret
-#clientId=4vvr1njh5d0u3o8lpowbgnameqic9mz3
-#clientSecret=rh0qN6EWyMek61fELV8N82XblkK2EJMr
http://git-wip-us.apache.org/repos/asf/camel/blob/db0ca734/components/camel-box2/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-box2/pom.xml b/components/camel-box2/pom.xml
deleted file mode 100644
index 1b6efac..0000000
--- a/components/camel-box2/pom.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>components</artifactId>
- <groupId>org.apache.camel</groupId>
- <version>2.19.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>camel-box2-parent</artifactId>
- <packaging>pom</packaging>
-
- <name>Camel Box2 Component Parent</name>
- <description>Parent project for Camel {Box2} Component</description>
-
- <modules>
- <module>camel-box2-component</module>
- <module>camel-box2-api</module>
- </modules>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/camel/blob/db0ca734/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 6b4bc32..33bc2ea 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -867,6 +867,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-box-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-braintree</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/camel/blob/db0ca734/platforms/spring-boot/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConfiguration.java
index 311d7fd..fa4a5ab 100644
--- a/platforms/spring-boot/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConfiguration.java
@@ -17,18 +17,14 @@
package org.apache.camel.component.box.springboot;
import java.util.Map;
-import com.box.boxjavalibv2.BoxConnectionManagerBuilder;
-import com.box.boxjavalibv2.IBoxConfig;
-import com.box.boxjavalibv2.authorization.IAuthSecureStorage;
-import com.box.boxjavalibv2.authorization.OAuthRefreshListener;
+import com.box.sdk.IAccessTokenCache;
import org.apache.camel.component.box.internal.BoxApiName;
import org.apache.camel.util.jsse.SSLContextParameters;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
/**
- * For uploading downloading and managing files folders groups collaborations
- * etc on box DOT com.
+ * Represents a Box endpoint.
*
* Generated by camel-package-maven-plugin - do not edit this file!
*/
@@ -68,84 +64,117 @@ public class BoxComponentConfiguration {
public static final Class CAMEL_NESTED_CLASS = org.apache.camel.component.box.BoxConfiguration.class;
/**
* What kind of operation to perform
+ *
+ * @param apiNamethe
+ * API Name to set
*/
private BoxApiName apiName;
/**
* What sub operation to use for the selected operation
+ *
+ * @param methodNamethe
+ * methodName to set
*/
private String methodName;
/**
- * Box application client ID
+ * The enterprise ID to use for an App Enterprise.
+ *
+ * @param enterpriseIdthe
+ * enterpriseId to set
*/
- private String clientId;
+ private String enterpriseId;
/**
- * Box application client secret
+ * The user ID to use for an App User.
+ *
+ * @param userIdthe
+ * userId to set
*/
- private String clientSecret;
+ private String userId;
/**
- * OAuth Secure Storage callback, can be used to provide and or save
- * OAuth tokens. The callback may return null on first call to allow the
- * component to login and authorize application and obtain an OAuth
- * token, which can then be saved in the secure storage. For the
- * component to be able to create a token automatically a user password
- * must be provided.
+ * The ID for public key for validating the JWT signature.
+ *
+ * @param publicKeyIdthe
+ * publicKeyId to set
*/
- private IAuthSecureStorage authSecureStorage;
+ private String publicKeyId;
/**
- * Box user name, MUST be provided
+ * The private key for generating the JWT signature.
+ *
+ * @param privateKeythe
+ * privateKey to set
*/
- private String userName;
+ private String privateKeyFile;
/**
- * Box user password, MUST be provided if authSecureStorage is not set,
- * or returns null on first call
+ * The password for the private key.
+ *
+ * @param privateKeyPasswordthe
+ * privateKeyPassword to set
*/
- private String userPassword;
- /**
- * OAuth listener for token updates, if the Camel application needs to
- * use the access token outside the route
- */
- private OAuthRefreshListener refreshListener;
+ private String privateKeyPassword;
/**
- * Flag to revoke OAuth refresh token on route shutdown, default false.
- * Will require a fresh refresh token on restart using either a custom
- * IAuthSecureStorage or automatic component login by providing a user
- * password
+ * The type of authentication for connection.
+ * <p>
+ * Types of Authentication:
+ * <ul>
+ * <li>STANDARD_AUTHENTICATION - OAuth 2.0 (3-legged)</li>
+ * <li>SERVER_AUTHENTICATION - OAuth 2.0 with JSON Web Tokens</li>
+ * </ul>
+ *
+ * @param authenticationTypethe
+ * authenticationType to set
*/
- private Boolean revokeOnShutdown;
+ private String authenticationType = "APP_USER_AUTHENTICATION";
/**
- * Box shared link for shared endpoints, can be a link for a shared
- * comment, file or folder
+ * Box application client ID
+ *
+ * @param clientIdthe
+ * clientId to set
*/
- private String sharedLink;
+ private String clientId;
/**
- * Password associated with the shared link, MUST be provided with
- * sharedLink
+ * Box application client secret
+ *
+ * @param clientSecretthe
+ * clientSecret to set
*/
- private String sharedPassword;
+ private String clientSecret;
/**
- * Custom Box SDK configuration, not required normally
+ * Box user name, MUST be provided
+ *
+ * @param userNamethe
+ * userName to set
*/
- private IBoxConfig boxConfig;
+ private String userName;
/**
- * Custom Box connection manager builder, used to override default
- * settings like max connections for underlying HttpClient.
+ * Box user password, MUST be provided if authSecureStorage is not set,
+ * or returns null on first call
+ *
+ * @param userPasswordthe
+ * userPassword to set
*/
- @NestedConfigurationProperty
- private BoxConnectionManagerBuilder connectionManagerBuilder;
+ private String userPassword;
/**
* Custom HTTP params for settings like proxy host
+ *
+ * @param httpParamsthe
+ * httpParams to set
*/
private Map httpParams;
/**
* To configure security using SSLContextParameters.
+ *
+ * @param sslContextParametersthe
+ * sslContextParameters to set
*/
@NestedConfigurationProperty
private SSLContextParameters sslContextParameters;
/**
- * Amount of time the component will wait for a response from Box.com,
- * default is 30 seconds
+ * Custom Access Token Cache for storing and retrieving access tokens.
+ *
+ * @param accessTokenCache
+ * - the Custom Access Token Cache
*/
- private Integer loginTimeout;
+ private IAccessTokenCache accessTokenCache;
public BoxApiName getApiName() {
return apiName;
@@ -163,93 +192,84 @@ public class BoxComponentConfiguration {
this.methodName = methodName;
}
- public String getClientId() {
- return clientId;
+ public String getEnterpriseId() {
+ return enterpriseId;
}
- public void setClientId(String clientId) {
- this.clientId = clientId;
+ public void setEnterpriseId(String enterpriseId) {
+ this.enterpriseId = enterpriseId;
}
- public String getClientSecret() {
- return clientSecret;
+ public String getUserId() {
+ return userId;
}
- public void setClientSecret(String clientSecret) {
- this.clientSecret = clientSecret;
+ public void setUserId(String userId) {
+ this.userId = userId;
}
- public IAuthSecureStorage getAuthSecureStorage() {
- return authSecureStorage;
+ public String getPublicKeyId() {
+ return publicKeyId;
}
- public void setAuthSecureStorage(IAuthSecureStorage authSecureStorage) {
- this.authSecureStorage = authSecureStorage;
+ public void setPublicKeyId(String publicKeyId) {
+ this.publicKeyId = publicKeyId;
}
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getUserPassword() {
- return userPassword;
+ public String getPrivateKeyFile() {
+ return privateKeyFile;
}
- public void setUserPassword(String userPassword) {
- this.userPassword = userPassword;
+ public void setPrivateKeyFile(String privateKeyFile) {
+ this.privateKeyFile = privateKeyFile;
}
- public OAuthRefreshListener getRefreshListener() {
- return refreshListener;
+ public String getPrivateKeyPassword() {
+ return privateKeyPassword;
}
- public void setRefreshListener(OAuthRefreshListener refreshListener) {
- this.refreshListener = refreshListener;
+ public void setPrivateKeyPassword(String privateKeyPassword) {
+ this.privateKeyPassword = privateKeyPassword;
}
- public Boolean getRevokeOnShutdown() {
- return revokeOnShutdown;
+ public String getAuthenticationType() {
+ return authenticationType;
}
- public void setRevokeOnShutdown(Boolean revokeOnShutdown) {
- this.revokeOnShutdown = revokeOnShutdown;
+ public void setAuthenticationType(String authenticationType) {
+ this.authenticationType = authenticationType;
}
- public String getSharedLink() {
- return sharedLink;
+ public String getClientId() {
+ return clientId;
}
- public void setSharedLink(String sharedLink) {
- this.sharedLink = sharedLink;
+ public void setClientId(String clientId) {
+ this.clientId = clientId;
}
- public String getSharedPassword() {
- return sharedPassword;
+ public String getClientSecret() {
+ return clientSecret;
}
- public void setSharedPassword(String sharedPassword) {
- this.sharedPassword = sharedPassword;
+ public void setClientSecret(String clientSecret) {
+ this.clientSecret = clientSecret;
}
- public IBoxConfig getBoxConfig() {
- return boxConfig;
+ public String getUserName() {
+ return userName;
}
- public void setBoxConfig(IBoxConfig boxConfig) {
- this.boxConfig = boxConfig;
+ public void setUserName(String userName) {
+ this.userName = userName;
}
- public BoxConnectionManagerBuilder getConnectionManagerBuilder() {
- return connectionManagerBuilder;
+ public String getUserPassword() {
+ return userPassword;
}
- public void setConnectionManagerBuilder(
- BoxConnectionManagerBuilder connectionManagerBuilder) {
- this.connectionManagerBuilder = connectionManagerBuilder;
+ public void setUserPassword(String userPassword) {
+ this.userPassword = userPassword;
}
public Map getHttpParams() {
@@ -269,12 +289,12 @@ public class BoxComponentConfiguration {
this.sslContextParameters = sslContextParameters;
}
- public Integer getLoginTimeout() {
- return loginTimeout;
+ public IAccessTokenCache getAccessTokenCache() {
+ return accessTokenCache;
}
- public void setLoginTimeout(Integer loginTimeout) {
- this.loginTimeout = loginTimeout;
+ public void setAccessTokenCache(IAccessTokenCache accessTokenCache) {
+ this.accessTokenCache = accessTokenCache;
}
}
}
\ No newline at end of file