Box Component
Available as of Camel 2.14
...
Code Block |
---|
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-box</artifactId> <version>${camel-version}</version> </dependency> |
URI format
Code Block |
---|
box://endpoint-prefix/endpoint?[options] |
...
- collaborations
- comments
- events
- files
- folders
- groups
- poll-events
- search
- shared-comments
- shared-files
- shared-folders
- shared-items
- 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.
Option | Type | Description |
---|---|---|
authSecureStorage | com.box.boxjavalibv2.authorization.IAuthSecureStorage | 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. |
boxConfig | com.box.boxjavalibv2.IBoxConfig | Custom Box SDK configuration, not required normally |
clientId | String | Box application client ID |
clientSecret | String | Box application client secret |
connectionManagerBuilder | com.box.boxjavalibv2.BoxConnectionManagerBuilder | Custom Box connection manager builder, used to override default settings like max connections for underlying HttpClient. |
httpParams | java.util.Map | Custom HTTP params for settings like proxy host |
loginTimeout | int | amount of time the component will wait for a response from Box.com, default is 30 seconds |
refreshListener | com.box.boxjavalibv2.authorization.OAuthRefreshListener | OAuth listener for token updates, if the Camel application needs to use the access token outside the route |
revokeOnShutdown | boolean | 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 |
sharedLink | String | Box shared link for shared-* endpoints, can be a link for a shared comment, file or folder |
sharedPassword | String | Password associated with the shared link, MUST be provided with sharedLink |
userName | String | Box user name, MUST be provided |
userPassword | String | Box user password, MUST be provided 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.
...
In case of Box API errors the endpoint will throw a RuntimeCamelException with a com.box.restclientv2.exceptions.BoxSDKException derived exception cause.
Endpoint Prefix collaborations
The following endpoints can be invoked with the prefix collaborations
as follows:
...
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
createCollaboration | create | collabRequest, folderId | com.box.boxjavalibv2.dao.BoxCollaboration |
deleteCollaboration | delete | collabId, defaultRequest | |
getAllCollaborations | allCollaborations | getAllCollabsRequest | java.util.List |
getCollaboration | collaboration | collabId, defaultRequest | com.box.boxjavalibv2.dao.BoxCollaboration |
updateCollaboration | update | collabId, collabRequest | com.box.boxjavalibv2.dao.BoxCollaboration |
URI Options for collaborations
If a value is not provided for one of the option(s) [defaultRequest] either in the endpoint URI or in a message header, it will be assumed to be null
. Note that the null
value(s) will only be used if other options do not satisfy matching endpoints.
Name | Type |
---|---|
collabId | String |
collabRequest | com.box.boxjavalibv2.requests.requestobjects.BoxCollabRequestObject |
defaultRequest | com.box.restclientv2.requestsbase.BoxDefaultRequestObject |
folderId | String |
getAllCollabsRequest | com.box.boxjavalibv2.requests.requestobjects.BoxGetAllCollabsRequestObject |
Endpoint Prefix events
The following endpoints can be invoked with the prefix events
as follows:
...
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
getEventOptions | eventOptions | defaultRequest | com.box.boxjavalibv2.dao.BoxCollection |
getEvents | events | eventRequest | com.box.boxjavalibv2.dao.BoxEventCollection |
URI Options for events
If a value is not provided for one of the option(s) [defaultRequest] either in the endpoint URI or in a message header, it will be assumed to be null
. Note that the null
value(s) will only be used if other options do not satisfy matching endpoints.
Name | Type |
---|---|
defaultRequest | com.box.restclientv2.requestsbase.BoxDefaultRequestObject |
eventRequest | com.box.boxjavalibv2.requests.requestobjects.BoxEventRequestObject |
Endpoint Prefix groups
The following endpoints can be invoked with the prefix groups
as follows:
...
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
createGroup | [groupRequest], [name] | com.box.boxjavalibv2.dao.BoxGroup | |
createMembership | [groupId, role, userId], [groupMembershipRequest] | com.box.boxjavalibv2.dao.BoxGroupMembership | |
deleteGroup | delete | defaultRequest, groupId | |
deleteMembership | delete | defaultRequest, membershipId | |
getAllCollaborations | allCollaborations | defaultRequest, groupId | com.box.boxjavalibv2.dao.BoxCollection |
getAllGroups | allGroups | defaultRequest | com.box.boxjavalibv2.dao.BoxCollection |
getMembership | membership | defaultRequest, membershipId | com.box.boxjavalibv2.dao.BoxGroupMembership |
getMemberships | memberships | defaultRequest, groupId | com.box.boxjavalibv2.dao.BoxCollection |
updateGroup | update | groupId, groupRequest | com.box.boxjavalibv2.dao.BoxGroup |
updateMembership | update | [groupMembershipRequest], [role], membershipId | com.box.boxjavalibv2.dao.BoxGroupMembership |
URI Options for groups
If a value is not provided for one of the option(s) [defaultRequest] either in the endpoint URI or in a message header, it will be assumed to be null
. Note that the null
value(s) will only be used if other options do not satisfy matching endpoints.
Name | Type |
---|---|
defaultRequest | com.box.restclientv2.requestsbase.BoxDefaultRequestObject |
groupId | String |
groupMembershipRequest | com.box.boxjavalibv2.requests.requestobjects.BoxGroupMembershipRequestObject |
groupRequest | com.box.boxjavalibv2.requests.requestobjects.BoxGroupRequestObject |
membershipId | String |
name | String |
role | String |
userId | String |
Endpoint Prefix search
The following endpoints can be invoked with the prefix search
as follows:
...
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
search | defaultRequest, searchQuery | com.box.boxjavalibv2.dao.BoxCollection |
URI Options for search
If a value is not provided for one of the option(s) [defaultRequest] either in the endpoint URI or in a message header, it will be assumed to be null
. Note that the null
value(s) will only be used if other options do not satisfy matching endpoints.
Name | Type |
---|---|
defaultRequest | com.box.restclientv2.requestsbase.BoxDefaultRequestObject |
searchQuery | String |
Endpoint Prefix comments and shared-comments
The following endpoints can be invoked with the prefix comments or shared-comments
as follows. The shared-comments prefix requires a sharedLink and sharedPassword.
...
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
addComment | [commentRequest], [commentedItemId, commentedItemType, message] | com.box.boxjavalibv2.dao.BoxComment | |
deleteComment | delete | commentId, defaultRequest | |
getComment | comment | commentId, defaultRequest | com.box.boxjavalibv2.dao.BoxComment |
updateComment | update | commentId, commentRequest | com.box.boxjavalibv2.dao.BoxComment |
URI Options
...
for comments and shared-comments
...
Name | Type |
---|---|
commentId | String |
commentRequest | com.box.boxjavalibv2.requests.requestobjects.BoxCommentRequestObject |
commentedItemId | String |
commentedItemType | com.box.boxjavalibv2.dao.IBoxType |
defaultRequest | com.box.restclientv2.requestsbase.BoxDefaultRequestObject |
message | String |
7. Endpoint Prefix shared-files
...
The following endpoints can be invoked with the prefix shared-files
as follows:
...
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
copyFile | fileId, itemCopyRequest | com.box.boxjavalibv2.dao.BoxFile | |
createSharedLink | create | fileId, sharedLinkRequest | com.box.boxjavalibv2.dao.BoxFile |
deleteFile | defaultRequest, fileId | ||
downloadFile | download | [destination, listener], [listener, outputStreams], defaultRequest, fileId | java.io.InputStream |
downloadThumbnail | download | extension, fileId, imageRequest | java.io.InputStream |
getFile | file | defaultRequest, fileId | com.box.boxjavalibv2.dao.BoxFile |
getFileComments | fileComments | defaultRequest, fileId | com.box.boxjavalibv2.dao.BoxCollection |
getFileVersions | fileVersions | defaultRequest, fileId | java.util.List |
getPreview | preview | extension, fileId, imageRequest | com.box.boxjavalibv2.dao.BoxPreview |
getThumbnail | thumbnail | extension, fileId, imageRequest | com.box.boxjavalibv2.dao.BoxThumbnail |
updateFileInfo | update | fileId, fileRequest | com.box.boxjavalibv2.dao.BoxFile |
uploadFile | upload | fileUploadRequest | com.box.boxjavalibv2.dao.BoxFile |
uploadNewVersion | upload | fileId, fileUploadRequest | com.box.boxjavalibv2.dao.BoxFile |
URI Options for shared-files
...
If a value is not provided for one of the option(s) [defaultRequest] either in the endpoint URI or in a message header, it will be assumed to be null
. Note that the null
value(s) will only be used if other options do not satisfy matching endpoints.
Name | Type |
---|---|
defaultRequest | com.box.restclientv2.requestsbase.BoxDefaultRequestObject |
destination | java.io.File |
extension | String |
fileId | String |
fileRequest | com.box.boxjavalibv2.requests.requestobjects.BoxFileRequestObject |
fileUploadRequest | com.box.restclientv2.requestsbase.BoxFileUploadRequestObject |
imageRequest | com.box.boxjavalibv2.requests.requestobjects.BoxImageRequestObject |
itemCopyRequest | com.box.boxjavalibv2.requests.requestobjects.BoxItemCopyRequestObject |
listener | com.box.boxjavalibv2.filetransfer.IFileTransferListener |
outputStreams | java.io.OutputStream[] |
sharedLinkRequest | com.box.boxjavalibv2.requests.requestobjects.BoxSharedLinkRequestObject |
8. Endpoint Prefix shared-folders
...
The following endpoints can be invoked with the prefix shared-folders
as follows:
...
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
copyFolder | folderId, itemCopyRequest | com.box.boxjavalibv2.dao.BoxFolder | |
createFolder | create | folderRequest | com.box.boxjavalibv2.dao.BoxFolder |
createSharedLink | create | folderId, sharedLinkRequest | com.box.boxjavalibv2.dao.BoxFolder |
deleteFolder | delete | folderDeleteRequest, folderId | |
getFolder | folder | defaultRequest, folderId | com.box.boxjavalibv2.dao.BoxFolder |
getFolderCollaborations | folderCollaborations | defaultRequest, folderId | java.util.List |
getFolderItems | folderItems | folderId, pagingRequest | com.box.boxjavalibv2.dao.BoxCollection |
updateFolderInfo | update | folderId, folderRequest | com.box.boxjavalibv2.dao.BoxFolder |
URI Options for shared-folders
...
If a value is not provided for one of the option(s) [defaultRequest] either in the endpoint URI or in a message header, it will be assumed to be null
. Note that the null
value(s) will only be used if other options do not satisfy matching endpoints.
Name | Type |
---|---|
defaultRequest | com.box.restclientv2.requestsbase.BoxDefaultRequestObject |
folderDeleteRequest | com.box.boxjavalibv2.requests.requestobjects.BoxFolderDeleteRequestObject |
folderId | String |
folderRequest | com.box.boxjavalibv2.requests.requestobjects.BoxFolderRequestObject |
itemCopyRequest | com.box.boxjavalibv2.requests.requestobjects.BoxItemCopyRequestObject |
pagingRequest | com.box.boxjavalibv2.requests.requestobjects.BoxPagingRequestObject |
sharedLinkRequest | com.box.boxjavalibv2.requests.requestobjects.BoxSharedLinkRequestObject |
9. Endpoint Prefix shared-items
...
The following endpoints can be invoked with the prefix shared-items
as follows:
...
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
getSharedItem | sharedItem | defaultRequest | com.box.boxjavalibv2.dao.BoxItem |
URI Options for shared-items
...
If a value is not provided for one of the option(s) [defaultRequest] either in the endpoint URI or in a message header, it will be assumed to be null
. Note that the null
value(s) will only be used if other options do not satisfy matching endpoints.
Name | Type |
---|---|
defaultRequest | com.box.restclientv2.requestsbase.BoxDefaultRequestObject |
10. Endpoint Prefix users
...
The following endpoints can be invoked with the prefix users
as follows:
...
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
addEmailAlias | emailAliasRequest, userId | com.box.boxjavalibv2.dao.BoxEmailAlias | |
createEnterpriseUser | create | userRequest | com.box.boxjavalibv2.dao.BoxUser |
deleteEmailAlias | defaultRequest, emailId, userId | ||
deleteEnterpriseUser | userDeleteRequest, userId | ||
getAllEnterpriseUser | allEnterpriseUser | defaultRequest, filterTerm | java.util.List |
getCurrentUser | currentUser | defaultRequest | com.box.boxjavalibv2.dao.BoxUser |
getEmailAliases | emailAliases | defaultRequest, userId | java.util.List |
moveFolderToAnotherUser | folderId, simpleUserRequest, userId | com.box.boxjavalibv2.dao.BoxFolder | |
updateUserInformaiton | update | userId, userRequest | com.box.boxjavalibv2.dao.BoxUser |
updateUserPrimaryLogin | update | userId, userUpdateLoginRequest | com.box.boxjavalibv2.dao.BoxUser |
URI Options for users
...
If a value is not provided for one of the option(s) [defaultRequest] either in the endpoint URI or in a message header, it will be assumed to be null
. Note that the null
value(s) will only be used if other options do not satisfy matching endpoints.
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:
Consumer endpoints can only use the endpoint prefix poll-events as shown in the example next. By default the consumer will split the com.box.boxjavalibv2.dao.BoxEventCollection from every long poll and create an exchange for every com.box.boxjavalibv2.dao.BoxEvent. To make the consumer return the entire collection in a single exchange, use the URI option consumer.splitResult=false.
...
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
poll | limit, streamPosition, streamType | com.box.boxjavalibv2.dao.BoxEvent by default, or com.box.boxjavalibv2.dao.BoxEventCollection when consumer.splitResult=false |
URI Options for poll-events
Name | Type |
---|---|
limit | Integer |
streamPosition | Long |
streamType | String |
splitResult | boolean |
Message header
Any of the URI options#urioptions can be provided in a message header for producer endpoints with CamelFacebook. prefix.
Message body
All result message bodies utilize objects provided by the Facebook4J API. Producer endpoints can specify the option name for incoming message body in the inBody endpoint parameter.
For endpoints that return an array, or facebook4j.ResponseList, or java.util.List, a consumer endpoint will map every elements in the list to distinct messages.
Use cases
To create a post within your Facebook profile, send this producer a facebook4j.PostUpdate body.
...