CAMEL-9047: Polished
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cb1c757f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cb1c757f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cb1c757f Branch: refs/heads/master Commit: cb1c757ff8d7a2a8027665a32e128c49aeeacc03 Parents: 217a925 Author: Claus Ibsen <[email protected]> Authored: Mon Mar 6 12:10:24 2017 +0100 Committer: Claus Ibsen <[email protected]> Committed: Mon Mar 6 12:10:24 2017 +0100 ---------------------------------------------------------------------- .../box/api/BoxCollaborationsManager.java | 7 - .../camel-box/camel-box-component/pom.xml | 6 +- .../src/main/docs/box-component.adoc | 807 +++++++++++++++++++ .../src/main/docs/box2-component.adoc | 744 ----------------- .../camel/component/box/BoxComponent.java | 11 +- .../camel/component/box/BoxConfiguration.java | 3 - .../apache/camel/component/box/BoxConsumer.java | 3 - .../apache/camel/component/box/BoxEndpoint.java | 52 +- .../apache/camel/component/box/BoxProducer.java | 3 - .../box/internal/BoxConnectionHelper.java | 3 - .../component/box/internal/BoxConstants.java | 3 - .../box/internal/BoxPropertiesHelper.java | 3 - .../springboot/BoxComponentConfiguration.java | 3 +- 13 files changed, 816 insertions(+), 832 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/cb1c757f/components/camel-box/camel-box-api/src/main/java/org/apache/camel/component/box/api/BoxCollaborationsManager.java ---------------------------------------------------------------------- diff --git a/components/camel-box/camel-box-api/src/main/java/org/apache/camel/component/box/api/BoxCollaborationsManager.java b/components/camel-box/camel-box-api/src/main/java/org/apache/camel/component/box/api/BoxCollaborationsManager.java index e1b4f31..ec90561 100644 --- a/components/camel-box/camel-box-api/src/main/java/org/apache/camel/component/box/api/BoxCollaborationsManager.java +++ b/components/camel-box/camel-box-api/src/main/java/org/apache/camel/component/box/api/BoxCollaborationsManager.java @@ -29,11 +29,8 @@ import org.slf4j.LoggerFactory; /** * Box Collaborations Manager - * * <p> * Provides operations to manage Box collaborations. - * - * * */ public class BoxCollaborationsManager { @@ -201,8 +198,6 @@ public class BoxCollaborationsManager { * * @param collaborationId * - the id of comment to change. - * @param message - * - the new message for the comment. * @return The comment with changed message. */ public void deleteCollaboration(String collaborationId) { @@ -226,9 +221,7 @@ public class BoxCollaborationsManager { */ public Collection<BoxCollaboration.Info> getPendingCollaborations() { try { - return BoxCollaboration.getPendingCollaborations(boxConnection); - } catch (BoxAPIException e) { throw new RuntimeException( String.format("Box API returned the error code %d\n\n%s", e.getResponseCode(), e.getResponse()), e); http://git-wip-us.apache.org/repos/asf/camel/blob/cb1c757f/components/camel-box/camel-box-component/pom.xml ---------------------------------------------------------------------- diff --git a/components/camel-box/camel-box-component/pom.xml b/components/camel-box/camel-box-component/pom.xml index 3f9f39d..669e01e 100644 --- a/components/camel-box/camel-box-component/pom.xml +++ b/components/camel-box/camel-box-component/pom.xml @@ -53,13 +53,13 @@ <dependency> <groupId>com.box</groupId> <artifactId>box-java-sdk</artifactId> - <version>2.1.1</version> + <version>${box-java-sdk-version}</version> </dependency> <dependency> <groupId>net.sourceforge.htmlunit</groupId> <artifactId>htmlunit</artifactId> - <version>2.24</version> + <version>${htmlunit.version}</version> </dependency> <!-- Camel annotations in provided scope to avoid compile errors in IDEs --> @@ -82,7 +82,7 @@ <dependency> <groupId>com.box</groupId> <artifactId>box-java-sdk</artifactId> - <version>2.1.1</version> + <version>${box-java-sdk-version}</version> <classifier>javadoc</classifier> <scope>provided</scope> </dependency> http://git-wip-us.apache.org/repos/asf/camel/blob/cb1c757f/components/camel-box/camel-box-component/src/main/docs/box-component.adoc ---------------------------------------------------------------------- diff --git a/components/camel-box/camel-box-component/src/main/docs/box-component.adoc b/components/camel-box/camel-box-component/src/main/docs/box-component.adoc new file mode 100644 index 0000000..53cfcfc --- /dev/null +++ b/components/camel-box/camel-box-component/src/main/docs/box-component.adoc @@ -0,0 +1,807 @@ +## Box Component + +*Available as of Camel version * + +The Box component provides access to all of the Box.com APIs accessible +using https://github.com/box/box-java-sdk/[box-java-sdk]. It +allows producing messages to upload and download files, create, edit, +and manage folders, etc. It also supports APIs that allow polling for +updates to user accounts and even changes to enterprise accounts, etc. + +Box.com requires the use of OAuth2.0 for all client application +authentication. In order to use camel-box with your account, you'll need +to create a new application within Box.com at +https://app.box.com/developers/services/edit/[https://app.box.com/developers/services/edit/]. +The Box application's client id and secret will allow access to Box APIs +which require a current user. A user access token is generated and +managed by the API for an end user. + +Maven users will need to add the following dependency to their pom.xml +for this component: + +[source,java] +------------------------------------------- + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-box</artifactId> + <version>${camel-version}</version> + </dependency> +------------------------------------------- + +### Connection Authentication Types + +The Box component supports three different types of authenticated connections. + +#### Standard Authentication + +*Standard Authentication* uses the *OAuth 2.0 three-legged authentication process* to authenticate its connections with Box.com. This type of authentication enables Box *managed users* and *external users* to access, edit, and save their Box content through the Box component. + +#### App Enterprise Authentication + +*App Enterprise Authentication* uses the *OAuth 2.0 with JSON Web Tokens (JWT)* to authenticate its connections as a *Service Account* for a *Box Application*. This type of authentication enables a service account to access, edit, and save the Box content of its *Box Application* through the Box component. + +#### App User Authentication + +*App User Authentication* uses the *OAuth 2.0 with JSON Web Tokens (JWT)* to authenticate its connections as an *App User* for a *Box Application*. This type of authentication enables app users to access, edit, and save their Box content in its *Box Application* through the Box component. + +### Box Options + +// component options: START +The Box component supports 2 options which are listed below. + + + +{% raw %} +[width="100%",cols="2,1,1m,1m,5",options="header"] +|======================================================================= +| Name | Group | Default | Java Type | Description +| configuration | common | | BoxConfiguration | To use the shared configuration +| resolvePropertyPlaceholders | advanced | true | boolean | Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders. +|======================================================================= +{% endraw %} +// component options: END + +// endpoint options: START +The Box component is configured using the URI syntax with the following path and query parameters: + + box:apiName/methodName + +#### 2 path parameters: + +{% raw %} +[width="100%",cols="2,1,1m,6",options="header"] +|======================================================================= +| Name | Default | Java Type | Description +| apiName | | BoxApiName | *Required* What kind of operation to perform +| methodName | | String | *Required* What sub operation to use for the selected operation +|======================================================================= +{% endraw %} + +#### 20 query parameters: + +{% raw %} +[width="100%",cols="2,1,1m,1m,5",options="header"] +|======================================================================= +| Name | Group | Default | Java Type | Description +| clientId | common | | String | Box application client ID +| enterpriseId | common | | String | The enterprise ID to use for an App Enterprise. +| inBody | common | | String | Sets the name of a parameter to be passed in the exchange In Body +| userId | common | | String | The user ID to use for an App User. +| 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 or 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 or ERROR level and ignored. +| exchangePattern | consumer (advanced) | | ExchangePattern | Sets the exchange pattern when the consumer creates an exchange. +| httpParams | advanced | | Map | Custom HTTP params for settings like proxy host +| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). +| accessTokenCache | security | | IAccessTokenCache | Custom Access Token Cache for storing and retrieving access tokens. +| clientSecret | security | | String | Box application client secret +| encryptionAlgorithm | security | RSA_SHA_256 | EncryptionAlgorithm | The type of encryption algorithm for JWT. Supported Algorithms: RSA_SHA_256 RSA_SHA_384 RSA_SHA_512 +| maxCacheEntries | security | 100 | int | The maximum number of access tokens in cache. +| authenticationType | authentication | APP_USER_AUTHENTICATION | String | The type of authentication for connection. Types of Authentication: STANDARD_AUTHENTICATION - OAuth 2.0 (3-legged) SERVER_AUTHENTICATION - OAuth 2.0 with JSON Web Tokens +| privateKeyFile | security | | String | The private key for generating the JWT signature. +| privateKeyPassword | security | | String | The password for the private key. +| publicKeyId | security | | String | The ID for public key for validating the JWT signature. +| sslContextParameters | security | | SSLContextParameters | To configure security using SSLContextParameters. +| userName | security | | String | Box user name MUST be provided +| userPassword | security | | String | Box user password MUST be provided if authSecureStorage is not set or returns null on first call +|======================================================================= +{% endraw %} +// endpoint options: END + +### URI format + +[source,java] +-------------------------------------------- + box://endpoint-prefix/endpoint?[options] +-------------------------------------------- + +Endpoint prefix can be one of: + +* collaborations +* comments +* event-logs +* files +* folders +* groups +* events +* search +* tasks +* users + +### BoxComponent + +The Box Component can be configured with the options below. These +options can be provided using the component's bean +property *`configuration`* of +type *`org.apache.camel.component.box.BoxConfiguration`*. These options +can also be specified in the endpoint URI. + +[width="100%",cols="10%,10%,80%",options="header",] +|======================================================================= custom access token cachecom.box.sdk +|Option |Type |Description + +|accessTokenCache |com.box.sdk.IAccessTokenCache |A custom access token cache. For production applications it is recommended to use a distributed cache like Memcached or Redis, and to implement this interface to store and retrieve access tokens appropriately for your environment; when not set an internal access token cache is used; ONLY used when using App Enterprise or User authentication. + +|clientId |String |Box application client ID + +|clientSecret |String |Box application client secret + +|encryptionAlgorithm |com.box.sdk.EncryptionAlgorithm |Algorithm used by OAuth 2.0 with JWT; MUST be provided when using App Enterprise and User authentication + +|enterpriseId |String |The enterprise ID to use for requesting access token; MUST be provided when using App Enterprise authentication + +|httpParams |java.util.Map |Custom HTTP params for settings like proxy host + +|maxCacheEntries |Integer |The maximum number of access tokens in cache; ONLY used when internal access token cache is used + +|privateKeyFile |String |Path to file containing private key used to generate signature in OAuth 2.0 with JWT; MUST be provided when using App Enterprise and User authentication + +|privateKeyPassword |String |Password for private key; only used for App Enterprise and User authentication; MUST be provided when using App Enterprise and User authentication + +|publicKeyId |String |The ID of public key used to generate signature in OAuth 2.0 with JWT; MUST be provided when using App Enterprise and User authentication + +|userId |String |The user ID to use for an App user Authentication; MUST be provided when using App User authentication + +|userName |String |Box user name for a Managed user; MUST be provided when using Standard Authentication + +|userPassword |String |Box user password, MUST be provided when using Standard Authentication and if authSecureStorage is not set, or +returns null on first call +|======================================================================= + +### Producer Endpoints: + +Producer endpoints can use endpoint prefixes followed by endpoint names +and associated options described next. A shorthand alias can be used for +some endpoints. The endpoint URI MUST contain a prefix. + +Endpoint options that are not mandatory are denoted by *[]*. When there +are no mandatory options for an endpoint, one of the set of *[]* options +MUST be provided. Producer endpoints can also use a special +option *`inBody`* that in turn should contain the name of the endpoint +option whose value will be contained in the Camel Exchange In message. + +Any of the endpoint options can be provided in either the endpoint URI, +or dynamically in a message header. The message header name must be of +the format *`CamelBox.<option>`*. Note that the *`inBody`* option +overrides message header, i.e. the endpoint +option *`inBody=option`* would override a *`CamelBox.option`* header. + +If a value is not provided for the option *defaultRequest* either in the +endpoint URI or in a message header, it will be assumed to be `null`. +Note that the `null` value will only be used if other options do not +satisfy matching endpoints. + +In case of Box API errors the endpoint will throw a +RuntimeCamelException with a +*com.box.sdk.BoxAPIException* derived exception +cause. + +#### Endpoint Prefix _collaborations_ + +For more information on Box collaborations see +https://docs.box.com/reference#collaboration-object[https://docs.box.com/reference#collaboration-object]. The +following endpoints can be invoked with the prefix *`collaborations`* as +follows: + +[source,java] +------------------------------------------- + box://collaborations/endpoint?[options] +------------------------------------------- + +[width="100%",cols="10%,10%,10%,70%",options="header",] +|======================================================================= +|Endpoint |Shorthand Alias |Options |Result Body Type + +|addFolderCollaboration |add |folderId, collaborator, role |com.box.sdk.BoxCollaboration + +|addFolderCollaborationByEmail |addByEmail |folderId, email, role |com.box.sdk.BoxCollaboration + +|deleteCollaboration |delete |collaborationId | + +|getFolderCollaborations |collaborations |folderId |java.util.Collection + +|getPendingCollaborations |pendingCollaborations | |java.util.Collection + +|getCollaborationInfo |info |collaborationId |com.box.sdk.BoxCollaboration.Info + +|updateCollaborationInfo |updateInfo |collaborationId, info |com.box.sdk.BoxCollaboration +|======================================================================= + +[[Box-URIOptionsforcollaborations]] +URI Options for _collaborations_ + + +[width="100%",cols="10%,90%",options="header",] +|======================================================================= +|Name |Type + +|collaborationId |String + +|collaborator |com.box.sdk.BoxCollaborator + +|role |com.box.sdk.BoxCollaboration.Role + +|folderId |String + +|email |String + +|info |com.box.sdk.BoxCollaboration.Info +|======================================================================= + +#### Endpoint Prefix _comments_ + +For more information on Box comments see +https://docs.box.com/reference#comment-object[https://docs.box.com/reference#comment-object]. The +following endpoints can be invoked with the prefix *`comments`* as +follows: + +[source,java] +------------------------------------------- + box://comments/endpoint?[options] +------------------------------------------- + +[width="100%",cols="10%,10%,10%,70%",options="header",] +|======================================================================= +|Endpoint |Shorthand Alias |Options |Result Body Type + +|addFileComment |add |fileId, message |com.box.sdk.BoxFile + +|changeCommentMessage |updateMessage |commentId, message |com.box.sdk.BoxComment + +|deleteComment |delete |commentId | + +|getCommentInfo |info |commentId |com.box.sdk.BoxComment.Info + +|getFileComments |comments |fileId |java.util.List + +|replyToComment |reply |commentId, message |com.box.sdk.BoxComment +|======================================================================= + +[[Box-URIOptionsforcollaborations]] +URI Options for _collaborations_ + + +[width="100%",cols="10%,90%",options="header",] +|======================================================================= +|Name |Type + +|commentId |String + +|fileId |String + +|message |String + +|======================================================================= + +#### Endpoint Prefix _events-logs_ + +For more information on Box event logs see +https://docs.box.com/reference#events[https://docs.box.com/reference#events]. +The following endpoints can be invoked with the prefix *`events`* as follows: + +[source,java] +--------------------------------- + box://event-logs/endpoint?[options] +--------------------------------- + +[width="100%",cols="10%,10%,10%,70%",options="header",] +|======================================================================= +|Endpoint |Shorthand Alias |Options |Result Body Type + +|getEnterpriseEvents |events |position, after, before, [types] |java.util.List +|======================================================================= + +[[Box-URIOptionsforevent-logs]] +URI Options for _event-logs_ + +[width="100%",cols="10%,90%",options="header",] +|======================================================================= +|Name |Type + +|position |String + +|after |Date + +|before |Date + +|types |com.box.sdk.BoxEvent.Types[] +|======================================================================= + +#### Endpoint Prefix _files_ + +For more information on Box files see +https://docs.box.com/reference#file-object[https://docs.box.com/reference#file-object]. +The following endpoints can be invoked with the +prefix *`files`* as follows. + +[source,java] +---------------------------------------- + box://files/endpoint?[options] +---------------------------------------- + +[width="100%",cols="10%,10%,10%,70%",options="header",] +|======================================================================= +|Endpoint |Shorthand Alias |Options |Result Body Type + +|uploadFile |upload |parentFolderId, content, fileName, [created], [modified], [size], [listener] |com.box.sdk.BoxFile + +|downloadFile |download |fileId, output, [rangeStart], [rangeEnd], [listener] |java.io.OutputStream + +|copyFile |copy |fileId, destinationFolderId, [newName] |com.box.sdk.BoxFile + +|moveFile |move |fileId, destinationFolderId, [newName] |com.box.sdk.BoxFile + +|renameFile |rename |fileId, newFileName |com.box.sdk.BoxFile + +|createFileSharedLink |link |fileId, access, [unshareDate], [permissions] |com.box.sdk.BoxSharedLink + +|deleteFile |delete |fileId | + +|uploadNewFileVersion |uploadVersion |fileId, fileContent, [modified], [fileSize], [listener] |com.box.boxsdk.BoxFile + +|promoteFileVersion |promoteVersion |fileId, version |com.box.sdk.BoxFileVersion + +|getFileVersions |versions |fileId |java.util.Collection + +|downloadPreviousFileVersions |downloadVersion |fileId, version, output, [listener] |java.io.OutputStream + +|deleteFileVersion |deleteVersion |fileId, version | + +|getFileInfo |info |fileId, fields |com.box.sdk.BoxFile.Info + +|updateFileInfo |updateInfo |fileId, info |com.box.sdk.BoxFile + +|createFileMetadata |createMetadata |fileId, metadata, [typeName] |com.box.sdk.Metadata + +|getFileMetadata |metadata |fileId, [typeName] |com.box.sdk.Metadata + +|updateFileMetadata |updateMetadata |fileId, metadata |com.box.sdk.Metadata + +|deleteFileMetadata |deleteMetadata |fileId | + +|getDownloadUrl |url |fileId |java.net.URL + +|getPreviewLink |preview |fileId |java.net.URL + +|getFileThumbnail |thumbnail |fileId, fileType, minWidth, minHeight, maxWidth, maxHeight |byte[] +|======================================================================= + +[[Box-URIOptionsforfiles]] +URI Options for _files_ + +[width="100%",cols="10%,90%",options="header",] +|======================================================================= +|Name |Type + +|parentFolderId |String + +|content |java.io.InputStream + +|fileName |String + +|created |Date + +|modified |Date + +|size |Long + +|listener |com.box.sdk.ProgressListener + +|output |java.io.OutputStream + +|rangeStart |Long + +|rangeEnd |Long + +|outputStreams |java.io.OutputStream[] + +|destinationFolderId |String + +|newName |String + +|fields |String[] + +|info |com.box.sdk.BoxFile.Info + +|fileSize |Long + +|version |Integer + +|access |com.box.sdk.BoxSharedLink.Access + +|unshareDate |Date + +|permissions |com.box.sdk.BoxSharedLink.Permissions + +|fileType |com.box.sdk.BoxFile.ThumbnailFileType + +|minWidth |Integer + +|minHeight |Integer + +|maxWidth |Integer + +|maxHeight |Integer + +|metadata |com.box.sdk.Metadata + +|typeName |String +|======================================================================= + +#### Endpoint Prefix _folders_ + +For more information on Box folders see +https://docs.box.com/reference#folder-object[https://docs.box.com/reference#folder-object]. +The following endpoints can be invoked with the prefix +*`folders`* as follows. + +[source,java] +------------------------------------------- + box://folders/endpoint?[options] +------------------------------------------- + +[width="100%",cols="10%,10%,10%,70%",options="header",] +|======================================================================= +|Endpoint |Shorthand Alias |Options |Result Body Type + +|getRootFolder |root | |com.box.sdk.BoxFolder + +|createFolder |create |parentFolderId, folderName |com.box.sdk.BoxFolder + +|copyFolder |copy |folderId, destinationfolderId, [newName] |com.box.sdk.BoxFolder + +|moveFolder |move |folderId, destinationFolderId, newName |com.box.sdk.BoxFolder + +|renameFolder |rename |folderId, newFolderName |com.box.sdk.BoxFolder + +|createFolderSharedLink |link |folderId, access, [unsharedDate], [permissions] |java.util.List + +|deleteFolder |delete |folderId | + +|getFolder |folder |path |com.box.sdk.BoxFolder + +|getFolderInfo |info |folderId, fields |com.box.sdk.BoxFolder.Info + +|getFolderItems |items |folderId, offset, limit, fields |com.box.sdk.BoxFolder + +|updateFolderInfo |updateInfo |folderId, info |com.box.sdk.BoxFolder +|======================================================================= + +[[Box-URIOptionsforfolders]] +URI Options for _folders_ + +[width="100%",cols="10%,90%",options="header",] +|======================================================================= +|Name |Type + +|path |String[] + +|folderId |String + +|offset |Long + +|limit |Long + +|fields |String[] + +|parentFolderId |String + +|folderName |String + +|destinationFolderId |String + +|newName |String + +|newFolderName |String + +|info |String + +|access |com.box.sdk.BoxSharedLink.Access + +|unshareDate |Date + +|permissions |com.box.sdk.BoxSharedLink.Permissions +|======================================================================= + +#### Endpoint Prefix _groups_ + +For more information on Box groups see +https://docs.box.com/reference#group-object[https://docs.box.com/reference#group-object]. +The following endpoints can be invoked with the prefix *`groups`* as +follows: + +[source,java] +----------------------------------- + box://groups/endpoint?[options] +----------------------------------- + +[width="100%",cols="10%,10%,10%,70%",options="header",] +|======================================================================= +|Endpoint |Shorthand Alias |Options |Result Body Type + +|createGroup |create |name |com.box.sdk.BoxGroup + +|addGroupMembership |createMembership |groupId, userId, role |com.box.sdk.BoxGroupMembership + +|deleteGroup |delete |groupId | + +|getAllGroups |groups | |java.util.Collection + +|getGroupInfo |info |groupId |com.box.sdk.BoxGroup.Info + +|addGroupMembership |addMembership |groupId, userId, role |com.box.sdk.BoxGroupMembership + +|deleteGroupMembership |deleteMembership |groupMembershipId | + +|getGroupMemberships |memberships |groupId |java.uti.Collection + +|getGroupMembershipInfo |membershipInfo |groupMemebershipId |com.box.sdk.BoxGroup.Info + +|updateGroupMembershipInfo |updateMembershipInfo |groupMemebershipId, info |com.box.sdk.BoxGroupMembership +|======================================================================= + +[[Box-URIOptionsforgroups]] +URI Options for _groups_ + +[width="100%",cols="10%,90%",options="header",] +|======================================================================= +|Name |Type + +|name |String + +|groupId |String + +|userId |String + +|role |com.box.sdk.BoxGroupMembership.Role + +|groupMembershipId |String + +|info |com.box.sdk.BoxGroupMembership.Info + +|======================================================================= + +#### Endpoint Prefix _search_ + +For more information on Box search API see +https://docs.box.com/reference#searching-for-content[https://docs.box.com/reference#searching-for-content]. The +following endpoints can be invoked with the prefix *`search`* as +follows: + +[source,java] +----------------------------------- + box://search/endpoint?[options] +----------------------------------- + +[width="100%",cols="10%,10%,10%,70%",options="header",] +|======================================================================= +|Endpoint |Shorthand Alias |Options |Result Body Type + +|searchFolder |search |folderId, query |java.util.Collection +|======================================================================= + +[[Box-URIOptionsforsearch]] +URI Options for _search_ + +[width="100%",cols="10%,90%",options="header",] +|======================================================================= +|Name |Type + +|folderId |String + +|query |String +|======================================================================= + +#### Endpoint Prefix _tasks_ + +For information on Box tasks see +https://docs.box.com/reference#task-object-1[https://docs.box.com/reference#task-object-1]. +The following endpoints can be invoked with the prefix *`tasks`* as +follows: + +[source,java] +---------------------------------- + box://tasks/endpoint?[options] +---------------------------------- + +[width="100%",cols="10%,10%,10%,70%",options="header",] +|======================================================================= +|Endpoint |Shorthand Alias |Options |Result Body Type + +|addFileTask |add |fileId, action, dueAt, [message] |com.box.sdk.BoxUser + +|deleteTask |delete |taskId | + +|getFileTasks |tasks |fileId |java.util.List + +|getTaskInfo |info |taskId |com.box.sdk.BoxTask.Info + +|updateTaskInfo |updateInfo |taskId, info |com.box.sdk.BoxTask + +|addAssignmentToTask |addAssignment |taskId, assignTo |com.box.sdk.BoxTask + +|deleteTaskAssignment |deleteAssignment |taskAssignmentId | + +|getTaskAssignments |assignments | taskId |java.util.List + +|getTaskAssignmentInfo |assignmentInfo |taskAssignmentId |com.box.sdk.BoxTaskAssignment.Info +|======================================================================= + +[[Box-URIOptionsfortasks]] +URI Options for _tasks_ + +[width="100%",cols="10%,90%",options="header",] +|======================================================================= +|Name |Type + +|fileId |String + +|action |com.box.sdk.BoxTask.Action + +|dueAt |Date + +|message |String + +|taskId |String + +|info |com.box.sdk.BoxTask.Info + +|assignTo |com.box.sdk.BoxUser + +|taskAssignmentId |String +|======================================================================= + +#### Endpoint Prefix _users_ + +For information on Box users see +https://docs.box.com/reference#user-object[https://docs.box.com/reference#user-object]. +The following endpoints can be invoked with the prefix *`users`* as +follows: + +[source,java] +---------------------------------- + box://users/endpoint?[options] +---------------------------------- + +[width="100%",cols="10%,10%,10%,70%",options="header",] +|======================================================================= +|Endpoint |Shorthand Alias |Options |Result Body Type + +|getCurrentUser |currentUser | |com.box.sdk.BoxUser + +|getAllEnterpriseOrExternalUsers |users |filterTerm, [fields] |com.box.sdk.BoxUser + +|createAppUser |create |name, [params] |com.box.sdk.BoxUser + +|createEnterpriseUser |create |login, name, [params] |com.box.sdk.BoxUser + +|deleteUser |delete |userId, notifyUser, force | + +|getUserEmailAlias |emailAlias |userId |com.box.sdk.BoxUser + +|deleteUserEmailAlias |deleteEmailAlias |userId, emailAliasId |java.util.List + +|getUserInfo |info | userId |com.box.sdk.BoxUser.Info + +|updateUserInfo |updateInfo |userId, info |com.box.sdk.BoxUser +|======================================================================= + +[[Box-URIOptionsforusers]] +URI Options for _users_ + +[width="100%",cols="10%,90%",options="header",] +|======================================================================= +|Name |Type + +|defaultRequest |com.box.restclientv2.requestsbase.BoxDefaultRequestObject + +|emailAliasRequest |com.box.boxjavalibv2.requests.requestobjects.BoxEmailAliasRequestObject + +|emailId |String + +|filterTerm |String + +|folderId |String + +|simpleUserRequest |com.box.boxjavalibv2.requests.requestobjects.BoxSimpleUserRequestObject + +|userDeleteRequest |com.box.boxjavalibv2.requests.requestobjects.BoxUserDeleteRequestObject + +|userId |String + +|userRequest |com.box.boxjavalibv2.requests.requestobjects.BoxUserRequestObject + +|userUpdateLoginRequest |com.box.boxjavalibv2.requests.requestobjects.BoxUserUpdateLoginRequestObject +|======================================================================= + +### Consumer Endpoints: + +For more information on Box events see +https://docs.box.com/reference#events[https://docs.box.com/reference#events]. +Consumer endpoints can only use the endpoint prefix *events* as +shown in the example next. + +[source,java] +---------------------------------------- + box://events/endpoint?[options] +---------------------------------------- + +[width="100%",cols="10%,10%,10%,70%",options="header",] +|======================================================================= +|Endpoint |Shorthand Alias |Options |Result Body Type + +|events | |[startingPosition] |com.box.sdk.BoxEvent +|======================================================================= + +[[Box-URIOptionsforevents]] +URI Options for _events_ + +[width="100%",cols="10%,90%",options="header",] +|======================================================================= +|Name |Type + +|startingPosition |Long +|======================================================================= + +### Message header + +Any of the options can be provided in a message header for producer +endpoints with *CamelBox.* prefix. + +### Message body + +All result message bodies utilize objects provided by the Box Java SDK. +Producer endpoints can specify the option name for incoming message body +in the *inBody* endpoint parameter. + +### Use cases + +The following route uploads new files to the user's root folder: + +[source,java] +----------------------------------------------------------- + from("file:...") + .to("box://files/upload/inBody=fileUploadRequest"); +----------------------------------------------------------- + +The following route polls user's account for updates: + +[source,java] +----------------------------------------------------------------------------- + from("box://events/listen?startingPosition=-1") + .to("bean:blah"); +----------------------------------------------------------------------------- + +The following route uses a producer with dynamic header options. The +*fileId* property has the Box file id and the *output* property has +the output stream of the file contents, so they are assigned to the +*CamelBox.fileId* header and *CamelBox.output* header respectively +as follows: + +[source,java] +------------------------------------------------------- + from("direct:foo") + .setHeader("CamelBox.fileId", header("fileId")) + .setHeader("CamelBox.output", header("output")) + .to("box://files/download") + .to("file://..."); +------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/cb1c757f/components/camel-box/camel-box-component/src/main/docs/box2-component.adoc ---------------------------------------------------------------------- diff --git a/components/camel-box/camel-box-component/src/main/docs/box2-component.adoc b/components/camel-box/camel-box-component/src/main/docs/box2-component.adoc deleted file mode 100644 index 1e3a810..0000000 --- a/components/camel-box/camel-box-component/src/main/docs/box2-component.adoc +++ /dev/null @@ -1,744 +0,0 @@ -## Box Component - -*Available as of Camel version * - -The Box component provides access to all of the Box.com APIs accessible -using https://github.com/box/box-java-sdk/[box-java-sdk]. It -allows producing messages to upload and download files, create, edit, -and manage folders, etc. It also supports APIs that allow polling for -updates to user accounts and even changes to enterprise accounts, etc. - -Box.com requires the use of OAuth2.0 for all client application -authentication. In order to use camel-box with your account, you'll need -to create a new application within Box.com at -https://app.box.com/developers/services/edit/[https://app.box.com/developers/services/edit/]. -The Box application's client id and secret will allow access to Box APIs -which require a current user. A user access token is generated and -managed by the API for an end user. - -Maven users will need to add the following dependency to their pom.xml -for this component: - -[source,java] -------------------------------------------- - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-box</artifactId> - <version>${camel-version}</version> - </dependency> -------------------------------------------- - -### Connection Authentication Types - -The Box component supports three different types of authenticated connections. - -#### Standard Authentication - -*Standard Authentication* uses the *OAuth 2.0 three-legged authentication process* to authenticate its connections with Box.com. This type of authentication enables Box *managed users* and *external users* to access, edit, and save their Box content through the Box component. - -#### App Enterprise Authentication - -*App Enterprise Authentication* uses the *OAuth 2.0 with JSON Web Tokens (JWT)* to authenticate its connections as a *Service Account* for a *Box Application*. This type of authentication enables a service account to access, edit, and save the Box content of its *Box Application* through the Box component. - -#### App User Authentication - -*App User Authentication* uses the *OAuth 2.0 with JSON Web Tokens (JWT)* to authenticate its connections as an *App User* for a *Box Application*. This type of authentication enables app users to access, edit, and save their Box content in its *Box Application* through the Box component. - -### URI format - -[source,java] --------------------------------------------- - box://endpoint-prefix/endpoint?[options] --------------------------------------------- - -Endpoint prefix can be one of: - -* collaborations -* comments -* event-logs -* files -* folders -* groups -* events -* search -* tasks -* users - -### BoxComponent - -The Box Component can be configured with the options below. These -options can be provided using the component's bean -property *`configuration`* of -type *`org.apache.camel.component.box.BoxConfiguration`*. These options -can also be specified in the endpoint URI. - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= custom access token cachecom.box.sdk -|Option |Type |Description - -|accessTokenCache |com.box.sdk.IAccessTokenCache |A custom access token cache. For production applications it is recommended to use a distributed cache like Memcached or Redis, and to implement this interface to store and retrieve access tokens appropriately for your environment; when not set an internal access token cache is used; ONLY used when using App Enterprise or User authentication. - -|clientId |String |Box application client ID - -|clientSecret |String |Box application client secret - -|encryptionAlgorithm |com.box.sdk.EncryptionAlgorithm |Algorithm used by OAuth 2.0 with JWT; MUST be provided when using App Enterprise and User authentication - -|enterpriseId |String |The enterprise ID to use for requesting access token; MUST be provided when using App Enterprise authentication - -|httpParams |java.util.Map |Custom HTTP params for settings like proxy host - -|maxCacheEntries |Integer |The maximum number of access tokens in cache; ONLY used when internal access token cache is used - -|privateKeyFile |String |Path to file containing private key used to generate signature in OAuth 2.0 with JWT; MUST be provided when using App Enterprise and User authentication - -|privateKeyPassword |String |Password for private key; only used for App Enterprise and User authentication; MUST be provided when using App Enterprise and User authentication - -|publicKeyId |String |The ID of public key used to generate signature in OAuth 2.0 with JWT; MUST be provided when using App Enterprise and User authentication - -|userId |String |The user ID to use for an App user Authentication; MUST be provided when using App User authentication - -|userName |String |Box user name for a Managed user; MUST be provided when using Standard Authentication - -|userPassword |String |Box user password, MUST be provided when using Standard Authentication and if authSecureStorage is not set, or -returns null on first call -|======================================================================= - -### Producer Endpoints: - -Producer endpoints can use endpoint prefixes followed by endpoint names -and associated options described next. A shorthand alias can be used for -some endpoints. The endpoint URI MUST contain a prefix. - -Endpoint options that are not mandatory are denoted by *[]*. When there -are no mandatory options for an endpoint, one of the set of *[]* options -MUST be provided. Producer endpoints can also use a special -option *`inBody`* that in turn should contain the name of the endpoint -option whose value will be contained in the Camel Exchange In message. - -Any of the endpoint options can be provided in either the endpoint URI, -or dynamically in a message header. The message header name must be of -the format *`CamelBox.<option>`*. Note that the *`inBody`* option -overrides message header, i.e. the endpoint -option *`inBody=option`* would override a *`CamelBox.option`* header. - -If a value is not provided for the option *defaultRequest* either in the -endpoint URI or in a message header, it will be assumed to be `null`. -Note that the `null` value will only be used if other options do not -satisfy matching endpoints. - -In case of Box API errors the endpoint will throw a -RuntimeCamelException with a -*com.box.sdk.BoxAPIException* derived exception -cause. - -#### Endpoint Prefix _collaborations_ - -For more information on Box collaborations see -https://docs.box.com/reference#collaboration-object[https://docs.box.com/reference#collaboration-object]. The -following endpoints can be invoked with the prefix *`collaborations`* as -follows: - -[source,java] -------------------------------------------- - box://collaborations/endpoint?[options] -------------------------------------------- - -[width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= -|Endpoint |Shorthand Alias |Options |Result Body Type - -|addFolderCollaboration |add |folderId, collaborator, role |com.box.sdk.BoxCollaboration - -|addFolderCollaborationByEmail |addByEmail |folderId, email, role |com.box.sdk.BoxCollaboration - -|deleteCollaboration |delete |collaborationId | - -|getFolderCollaborations |collaborations |folderId |java.util.Collection - -|getPendingCollaborations |pendingCollaborations | |java.util.Collection - -|getCollaborationInfo |info |collaborationId |com.box.sdk.BoxCollaboration.Info - -|updateCollaborationInfo |updateInfo |collaborationId, info |com.box.sdk.BoxCollaboration -|======================================================================= - -[[Box-URIOptionsforcollaborations]] -URI Options for _collaborations_ - - -[width="100%",cols="10%,90%",options="header",] -|======================================================================= -|Name |Type - -|collaborationId |String - -|collaborator |com.box.sdk.BoxCollaborator - -|role |com.box.sdk.BoxCollaboration.Role - -|folderId |String - -|email |String - -|info |com.box.sdk.BoxCollaboration.Info -|======================================================================= - -#### Endpoint Prefix _comments_ - -For more information on Box comments see -https://docs.box.com/reference#comment-object[https://docs.box.com/reference#comment-object]. The -following endpoints can be invoked with the prefix *`comments`* as -follows: - -[source,java] -------------------------------------------- - box://comments/endpoint?[options] -------------------------------------------- - -[width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= -|Endpoint |Shorthand Alias |Options |Result Body Type - -|addFileComment |add |fileId, message |com.box.sdk.BoxFile - -|changeCommentMessage |updateMessage |commentId, message |com.box.sdk.BoxComment - -|deleteComment |delete |commentId | - -|getCommentInfo |info |commentId |com.box.sdk.BoxComment.Info - -|getFileComments |comments |fileId |java.util.List - -|replyToComment |reply |commentId, message |com.box.sdk.BoxComment -|======================================================================= - -[[Box-URIOptionsforcollaborations]] -URI Options for _collaborations_ - - -[width="100%",cols="10%,90%",options="header",] -|======================================================================= -|Name |Type - -|commentId |String - -|fileId |String - -|message |String - -|======================================================================= - -#### Endpoint Prefix _events-logs_ - -For more information on Box event logs see -https://docs.box.com/reference#events[https://docs.box.com/reference#events]. -The following endpoints can be invoked with the prefix *`events`* as follows: - -[source,java] ---------------------------------- - box://event-logs/endpoint?[options] ---------------------------------- - -[width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= -|Endpoint |Shorthand Alias |Options |Result Body Type - -|getEnterpriseEvents |events |position, after, before, [types] |java.util.List -|======================================================================= - -[[Box-URIOptionsforevent-logs]] -URI Options for _event-logs_ - -[width="100%",cols="10%,90%",options="header",] -|======================================================================= -|Name |Type - -|position |String - -|after |Date - -|before |Date - -|types |com.box.sdk.BoxEvent.Types[] -|======================================================================= - -#### Endpoint Prefix _files_ - -For more information on Box files see -https://docs.box.com/reference#file-object[https://docs.box.com/reference#file-object]. -The following endpoints can be invoked with the -prefix *`files`* as follows. - -[source,java] ----------------------------------------- - box://files/endpoint?[options] ----------------------------------------- - -[width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= -|Endpoint |Shorthand Alias |Options |Result Body Type - -|uploadFile |upload |parentFolderId, content, fileName, [created], [modified], [size], [listener] |com.box.sdk.BoxFile - -|downloadFile |download |fileId, output, [rangeStart], [rangeEnd], [listener] |java.io.OutputStream - -|copyFile |copy |fileId, destinationFolderId, [newName] |com.box.sdk.BoxFile - -|moveFile |move |fileId, destinationFolderId, [newName] |com.box.sdk.BoxFile - -|renameFile |rename |fileId, newFileName |com.box.sdk.BoxFile - -|createFileSharedLink |link |fileId, access, [unshareDate], [permissions] |com.box.sdk.BoxSharedLink - -|deleteFile |delete |fileId | - -|uploadNewFileVersion |uploadVersion |fileId, fileContent, [modified], [fileSize], [listener] |com.box.boxsdk.BoxFile - -|promoteFileVersion |promoteVersion |fileId, version |com.box.sdk.BoxFileVersion - -|getFileVersions |versions |fileId |java.util.Collection - -|downloadPreviousFileVersions |downloadVersion |fileId, version, output, [listener] |java.io.OutputStream - -|deleteFileVersion |deleteVersion |fileId, version | - -|getFileInfo |info |fileId, fields |com.box.sdk.BoxFile.Info - -|updateFileInfo |updateInfo |fileId, info |com.box.sdk.BoxFile - -|createFileMetadata |createMetadata |fileId, metadata, [typeName] |com.box.sdk.Metadata - -|getFileMetadata |metadata |fileId, [typeName] |com.box.sdk.Metadata - -|updateFileMetadata |updateMetadata |fileId, metadata |com.box.sdk.Metadata - -|deleteFileMetadata |deleteMetadata |fileId | - -|getDownloadUrl |url |fileId |java.net.URL - -|getPreviewLink |preview |fileId |java.net.URL - -|getFileThumbnail |thumbnail |fileId, fileType, minWidth, minHeight, maxWidth, maxHeight |byte[] -|======================================================================= - -[[Box-URIOptionsforfiles]] -URI Options for _files_ - -[width="100%",cols="10%,90%",options="header",] -|======================================================================= -|Name |Type - -|parentFolderId |String - -|content |java.io.InputStream - -|fileName |String - -|created |Date - -|modified |Date - -|size |Long - -|listener |com.box.sdk.ProgressListener - -|output |java.io.OutputStream - -|rangeStart |Long - -|rangeEnd |Long - -|outputStreams |java.io.OutputStream[] - -|destinationFolderId |String - -|newName |String - -|fields |String[] - -|info |com.box.sdk.BoxFile.Info - -|fileSize |Long - -|version |Integer - -|access |com.box.sdk.BoxSharedLink.Access - -|unshareDate |Date - -|permissions |com.box.sdk.BoxSharedLink.Permissions - -|fileType |com.box.sdk.BoxFile.ThumbnailFileType - -|minWidth |Integer - -|minHeight |Integer - -|maxWidth |Integer - -|maxHeight |Integer - -|metadata |com.box.sdk.Metadata - -|typeName |String -|======================================================================= - -#### Endpoint Prefix _folders_ - -For more information on Box folders see -https://docs.box.com/reference#folder-object[https://docs.box.com/reference#folder-object]. -The following endpoints can be invoked with the prefix -*`folders`* as follows. - -[source,java] -------------------------------------------- - box://folders/endpoint?[options] -------------------------------------------- - -[width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= -|Endpoint |Shorthand Alias |Options |Result Body Type - -|getRootFolder |root | |com.box.sdk.BoxFolder - -|createFolder |create |parentFolderId, folderName |com.box.sdk.BoxFolder - -|copyFolder |copy |folderId, destinationfolderId, [newName] |com.box.sdk.BoxFolder - -|moveFolder |move |folderId, destinationFolderId, newName |com.box.sdk.BoxFolder - -|renameFolder |rename |folderId, newFolderName |com.box.sdk.BoxFolder - -|createFolderSharedLink |link |folderId, access, [unsharedDate], [permissions] |java.util.List - -|deleteFolder |delete |folderId | - -|getFolder |folder |path |com.box.sdk.BoxFolder - -|getFolderInfo |info |folderId, fields |com.box.sdk.BoxFolder.Info - -|getFolderItems |items |folderId, offset, limit, fields |com.box.sdk.BoxFolder - -|updateFolderInfo |updateInfo |folderId, info |com.box.sdk.BoxFolder -|======================================================================= - -[[Box-URIOptionsforfolders]] -URI Options for _folders_ - -[width="100%",cols="10%,90%",options="header",] -|======================================================================= -|Name |Type - -|path |String[] - -|folderId |String - -|offset |Long - -|limit |Long - -|fields |String[] - -|parentFolderId |String - -|folderName |String - -|destinationFolderId |String - -|newName |String - -|newFolderName |String - -|info |String - -|access |com.box.sdk.BoxSharedLink.Access - -|unshareDate |Date - -|permissions |com.box.sdk.BoxSharedLink.Permissions -|======================================================================= - -#### Endpoint Prefix _groups_ - -For more information on Box groups see -https://docs.box.com/reference#group-object[https://docs.box.com/reference#group-object]. -The following endpoints can be invoked with the prefix *`groups`* as -follows: - -[source,java] ------------------------------------ - box://groups/endpoint?[options] ------------------------------------ - -[width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= -|Endpoint |Shorthand Alias |Options |Result Body Type - -|createGroup |create |name |com.box.sdk.BoxGroup - -|addGroupMembership |createMembership |groupId, userId, role |com.box.sdk.BoxGroupMembership - -|deleteGroup |delete |groupId | - -|getAllGroups |groups | |java.util.Collection - -|getGroupInfo |info |groupId |com.box.sdk.BoxGroup.Info - -|addGroupMembership |addMembership |groupId, userId, role |com.box.sdk.BoxGroupMembership - -|deleteGroupMembership |deleteMembership |groupMembershipId | - -|getGroupMemberships |memberships |groupId |java.uti.Collection - -|getGroupMembershipInfo |membershipInfo |groupMemebershipId |com.box.sdk.BoxGroup.Info - -|updateGroupMembershipInfo |updateMembershipInfo |groupMemebershipId, info |com.box.sdk.BoxGroupMembership -|======================================================================= - -[[Box-URIOptionsforgroups]] -URI Options for _groups_ - -[width="100%",cols="10%,90%",options="header",] -|======================================================================= -|Name |Type - -|name |String - -|groupId |String - -|userId |String - -|role |com.box.sdk.BoxGroupMembership.Role - -|groupMembershipId |String - -|info |com.box.sdk.BoxGroupMembership.Info - -|======================================================================= - -#### Endpoint Prefix _search_ - -For more information on Box search API see -https://docs.box.com/reference#searching-for-content[https://docs.box.com/reference#searching-for-content]. The -following endpoints can be invoked with the prefix *`search`* as -follows: - -[source,java] ------------------------------------ - box://search/endpoint?[options] ------------------------------------ - -[width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= -|Endpoint |Shorthand Alias |Options |Result Body Type - -|searchFolder |search |folderId, query |java.util.Collection -|======================================================================= - -[[Box-URIOptionsforsearch]] -URI Options for _search_ - -[width="100%",cols="10%,90%",options="header",] -|======================================================================= -|Name |Type - -|folderId |String - -|query |String -|======================================================================= - -#### Endpoint Prefix _tasks_ - -For information on Box tasks see -https://docs.box.com/reference#task-object-1[https://docs.box.com/reference#task-object-1]. -The following endpoints can be invoked with the prefix *`tasks`* as -follows: - -[source,java] ----------------------------------- - box://tasks/endpoint?[options] ----------------------------------- - -[width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= -|Endpoint |Shorthand Alias |Options |Result Body Type - -|addFileTask |add |fileId, action, dueAt, [message] |com.box.sdk.BoxUser - -|deleteTask |delete |taskId | - -|getFileTasks |tasks |fileId |java.util.List - -|getTaskInfo |info |taskId |com.box.sdk.BoxTask.Info - -|updateTaskInfo |updateInfo |taskId, info |com.box.sdk.BoxTask - -|addAssignmentToTask |addAssignment |taskId, assignTo |com.box.sdk.BoxTask - -|deleteTaskAssignment |deleteAssignment |taskAssignmentId | - -|getTaskAssignments |assignments | taskId |java.util.List - -|getTaskAssignmentInfo |assignmentInfo |taskAssignmentId |com.box.sdk.BoxTaskAssignment.Info -|======================================================================= - -[[Box-URIOptionsfortasks]] -URI Options for _tasks_ - -[width="100%",cols="10%,90%",options="header",] -|======================================================================= -|Name |Type - -|fileId |String - -|action |com.box.sdk.BoxTask.Action - -|dueAt |Date - -|message |String - -|taskId |String - -|info |com.box.sdk.BoxTask.Info - -|assignTo |com.box.sdk.BoxUser - -|taskAssignmentId |String -|======================================================================= - -#### Endpoint Prefix _users_ - -For information on Box users see -https://docs.box.com/reference#user-object[https://docs.box.com/reference#user-object]. -The following endpoints can be invoked with the prefix *`users`* as -follows: - -[source,java] ----------------------------------- - box://users/endpoint?[options] ----------------------------------- - -[width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= -|Endpoint |Shorthand Alias |Options |Result Body Type - -|getCurrentUser |currentUser | |com.box.sdk.BoxUser - -|getAllEnterpriseOrExternalUsers |users |filterTerm, [fields] |com.box.sdk.BoxUser - -|createAppUser |create |name, [params] |com.box.sdk.BoxUser - -|createEnterpriseUser |create |login, name, [params] |com.box.sdk.BoxUser - -|deleteUser |delete |userId, notifyUser, force | - -|getUserEmailAlias |emailAlias |userId |com.box.sdk.BoxUser - -|deleteUserEmailAlias |deleteEmailAlias |userId, emailAliasId |java.util.List - -|getUserInfo |info | userId |com.box.sdk.BoxUser.Info - -|updateUserInfo |updateInfo |userId, info |com.box.sdk.BoxUser -|======================================================================= - -[[Box-URIOptionsforusers]] -URI Options for _users_ - -[width="100%",cols="10%,90%",options="header",] -|======================================================================= -|Name |Type - -|defaultRequest |com.box.restclientv2.requestsbase.BoxDefaultRequestObject - -|emailAliasRequest |com.box.boxjavalibv2.requests.requestobjects.BoxEmailAliasRequestObject - -|emailId |String - -|filterTerm |String - -|folderId |String - -|simpleUserRequest |com.box.boxjavalibv2.requests.requestobjects.BoxSimpleUserRequestObject - -|userDeleteRequest |com.box.boxjavalibv2.requests.requestobjects.BoxUserDeleteRequestObject - -|userId |String - -|userRequest |com.box.boxjavalibv2.requests.requestobjects.BoxUserRequestObject - -|userUpdateLoginRequest |com.box.boxjavalibv2.requests.requestobjects.BoxUserUpdateLoginRequestObject -|======================================================================= - -### Consumer Endpoints: - -For more information on Box events see -https://docs.box.com/reference#events[https://docs.box.com/reference#events]. -Consumer endpoints can only use the endpoint prefix *events* as -shown in the example next. - -[source,java] ----------------------------------------- - box://events/endpoint?[options] ----------------------------------------- - -[width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= -|Endpoint |Shorthand Alias |Options |Result Body Type - -|events | |[startingPosition] |com.box.sdk.BoxEvent -|======================================================================= - -[[Box-URIOptionsforevents]] -URI Options for _events_ - -[width="100%",cols="10%,90%",options="header",] -|======================================================================= -|Name |Type - -|startingPosition |Long -|======================================================================= - -### Message header - -Any of the options can be provided in a message header for producer -endpoints with *CamelBox.* prefix. - -### Message body - -All result message bodies utilize objects provided by the Box Java SDK. -Producer endpoints can specify the option name for incoming message body -in the *inBody* endpoint parameter. - -### Use cases - -The following route uploads new files to the user's root folder: - -[source,java] ------------------------------------------------------------ - from("file:...") - .to("box://files/upload/inBody=fileUploadRequest"); ------------------------------------------------------------ - -The following route polls user's account for updates: - -[source,java] ------------------------------------------------------------------------------ - from("box://events/listen?startingPosition=-1") - .to("bean:blah"); ------------------------------------------------------------------------------ - -The following route uses a producer with dynamic header options. The -*fileId* property has the Box file id and the *output* property has -the output stream of the file contents, so they are assigned to the -*CamelBox.fileId* header and *CamelBox.output* header respectively -as follows: - -[source,java] -------------------------------------------------------- - from("direct:foo") - .setHeader("CamelBox.fileId", header("fileId")) - .setHeader("CamelBox.output", header("output")) - .to("box://files/download") - .to("file://..."); -------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/cb1c757f/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxComponent.java b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxComponent.java index 70d3344..f825ed0 100644 --- a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxComponent.java +++ b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxComponent.java @@ -17,23 +17,14 @@ package org.apache.camel.component.box; import com.box.sdk.BoxAPIConnection; - import org.apache.camel.CamelContext; import org.apache.camel.Endpoint; -import org.apache.camel.component.box.internal.BoxConnectionHelper; import org.apache.camel.component.box.internal.BoxApiCollection; import org.apache.camel.component.box.internal.BoxApiName; +import org.apache.camel.component.box.internal.BoxConnectionHelper; import org.apache.camel.spi.Metadata; import org.apache.camel.util.component.AbstractApiComponent; -/** - * Represents the component that manages {@link BoxEndpoint}. - * - * - * - */ -// @UriEndpoint(scheme = "box", consumerClass = BoxConsumer.class, -// consumerPrefix = "consumer", syntax = "", title = "Box Component") public class BoxComponent extends AbstractApiComponent<BoxApiName, BoxConfiguration, BoxApiCollection> { @Metadata(label = "advanced") http://git-wip-us.apache.org/repos/asf/camel/blob/cb1c757f/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxConfiguration.java b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxConfiguration.java index 242fff7..55eb974 100644 --- a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxConfiguration.java +++ b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxConfiguration.java @@ -31,9 +31,6 @@ import org.apache.camel.util.jsse.SSLContextParameters; /** * Component configuration for Box component. - * - * - * */ @UriParams public class BoxConfiguration { http://git-wip-us.apache.org/repos/asf/camel/blob/cb1c757f/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxConsumer.java ---------------------------------------------------------------------- diff --git a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxConsumer.java b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxConsumer.java index 888b676..95a3484 100644 --- a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxConsumer.java +++ b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxConsumer.java @@ -35,9 +35,6 @@ import org.apache.camel.util.component.ApiMethodHelper; /** * The Box consumer. - * - * - * */ public class BoxConsumer extends AbstractApiConsumer<BoxApiName, BoxConfiguration> implements EventListener { http://git-wip-us.apache.org/repos/asf/camel/blob/cb1c757f/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxEndpoint.java b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxEndpoint.java index fd7ecde..b406c95 100644 --- a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxEndpoint.java +++ b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxEndpoint.java @@ -19,15 +19,14 @@ package org.apache.camel.component.box; import java.util.Map; import com.box.sdk.BoxAPIConnection; - import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; -import org.apache.camel.component.box.api.BoxFilesManager; import org.apache.camel.component.box.api.BoxCollaborationsManager; import org.apache.camel.component.box.api.BoxCommentsManager; import org.apache.camel.component.box.api.BoxEventLogsManager; import org.apache.camel.component.box.api.BoxEventsManager; +import org.apache.camel.component.box.api.BoxFilesManager; import org.apache.camel.component.box.api.BoxFoldersManager; import org.apache.camel.component.box.api.BoxGroupsManager; import org.apache.camel.component.box.api.BoxSearchManager; @@ -45,15 +44,12 @@ import org.apache.camel.util.component.ApiMethod; import org.apache.camel.util.component.ApiMethodPropertiesHelper; /** - * Represents a Box endpoint. - * - * - * + * For uploading downloading and managing files folders groups collaborations etc on box DOT com. */ @UriEndpoint(scheme = "box", title = "Box", syntax = "box:apiName/methodName", consumerClass = BoxConsumer.class, consumerPrefix = "consumer", label = "api,file,cloud", lenientProperties = true) public class BoxEndpoint extends AbstractApiEndpoint<BoxApiName, BoxConfiguration> { - @UriParam(name = "configuration", description = "Box 2 Configuration") + @UriParam private BoxConfiguration configuration; // cached connection @@ -70,11 +66,6 @@ public class BoxEndpoint extends AbstractApiEndpoint<BoxApiName, BoxConfiguratio this.configuration = endpointConfiguration; } - /* - * (non-Javadoc) - * - * @see org.apache.camel.impl.DefaultEndpoint#getComponent() - */ @Override public BoxComponent getComponent() { return (BoxComponent) super.getComponent(); @@ -82,27 +73,15 @@ public class BoxEndpoint extends AbstractApiEndpoint<BoxApiName, BoxConfiguratio /** * The BoxAPIConnection of endpoint. - * - * @return the BoxAPIConnection of endpoint. */ public BoxAPIConnection getBoxConnection() { return boxConnection; } - /* - * (non-Javadoc) - * - * @see org.apache.camel.Endpoint#createProducer() - */ public Producer createProducer() throws Exception { return new BoxProducer(this); } - /* - * (non-Javadoc) - * - * @see org.apache.camel.Endpoint#createConsumer(org.apache.camel.Processor) - */ public Consumer createConsumer(Processor processor) throws Exception { // make sure inBody is not set for consumers if (inBody != null) { @@ -114,34 +93,15 @@ public class BoxEndpoint extends AbstractApiEndpoint<BoxApiName, BoxConfiguratio return consumer; } - /* - * (non-Javadoc) - * - * @see - * org.apache.camel.util.component.AbstractApiEndpoint#getPropertiesHelper() - */ @Override protected ApiMethodPropertiesHelper<BoxConfiguration> getPropertiesHelper() { return BoxPropertiesHelper.getHelper(); } - /* - * (non-Javadoc) - * - * @see - * org.apache.camel.util.component.AbstractApiEndpoint#getThreadProfileName( - * ) - */ protected String getThreadProfileName() { return BoxConstants.THREAD_PROFILE_NAME; } - /* - * (non-Javadoc) - * - * @see org.apache.camel.util.component.AbstractApiEndpoint# - * afterConfigureProperties() - */ @Override protected void afterConfigureProperties() { // create connection eagerly, a good way to validate configuration @@ -149,12 +109,6 @@ public class BoxEndpoint extends AbstractApiEndpoint<BoxApiName, BoxConfiguratio } - /* - * (non-Javadoc) - * - * @see org.apache.camel.util.component.AbstractApiEndpoint#getApiProxy(org. - * apache.camel.util.component.ApiMethod, java.util.Map) - */ @Override public Object getApiProxy(ApiMethod method, Map<String, Object> args) { if (apiProxy == null) { http://git-wip-us.apache.org/repos/asf/camel/blob/cb1c757f/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxProducer.java b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxProducer.java index 0df9c12..ea537da 100644 --- a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxProducer.java +++ b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxProducer.java @@ -23,9 +23,6 @@ import org.apache.camel.util.component.AbstractApiProducer; /** * The Box producer. - * - * - * */ public class BoxProducer extends AbstractApiProducer<BoxApiName, BoxConfiguration> { http://git-wip-us.apache.org/repos/asf/camel/blob/cb1c757f/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConnectionHelper.java ---------------------------------------------------------------------- diff --git a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConnectionHelper.java b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConnectionHelper.java index 2158d64..f8e0e5f 100644 --- a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConnectionHelper.java +++ b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConnectionHelper.java @@ -66,9 +66,6 @@ import org.slf4j.LoggerFactory; * * <p> * Utility class for creating Box API Connections - * - * - * */ public final class BoxConnectionHelper { http://git-wip-us.apache.org/repos/asf/camel/blob/cb1c757f/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConstants.java ---------------------------------------------------------------------- diff --git a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConstants.java b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConstants.java index c4922fa..11f584b 100644 --- a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConstants.java +++ b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConstants.java @@ -18,9 +18,6 @@ package org.apache.camel.component.box.internal; /** * Constants for Box component. - * - * - * */ public interface BoxConstants { http://git-wip-us.apache.org/repos/asf/camel/blob/cb1c757f/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxPropertiesHelper.java ---------------------------------------------------------------------- diff --git a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxPropertiesHelper.java b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxPropertiesHelper.java index 2ad52ce..ae9b4f6 100644 --- a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxPropertiesHelper.java +++ b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxPropertiesHelper.java @@ -21,9 +21,6 @@ import org.apache.camel.util.component.ApiMethodPropertiesHelper; /** * Singleton {@link ApiMethodPropertiesHelper} for Box component. - * - * - * */ public final class BoxPropertiesHelper extends ApiMethodPropertiesHelper<BoxConfiguration> { http://git-wip-us.apache.org/repos/asf/camel/blob/cb1c757f/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 fa4a5ab..d60ba98 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 @@ -24,7 +24,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.NestedConfigurationProperty; /** - * Represents a Box endpoint. + * For uploading downloading and managing files folders groups collaborations + * etc on box DOT com. * * Generated by camel-package-maven-plugin - do not edit this file! */
