Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Questo contenuto non è disponibile nella lingua selezionata.
Chapter 59. GoogleCalendar
GoogleCalendar component Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
Available as of Camel 2.15
Component Description Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
The Google Calendar component provides access to Google Calendar via the Google Calendar Web APIs.
Google Calendar uses the OAuth 2.0 protocol for authenticating a Google account and authorizing access to user data. Before you can use this component, you will need to create an account and generate OAuth credentials. Credentials comprise of a clientId, clientSecret, and a refreshToken. A handy resource for generating a long-lived refreshToken is the OAuth playground.
Maven users will need to add the following dependency to their pom.xml for this component:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-google-calendar</artifactId>
<version>2.17.0.redhat-630xxx</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-google-calendar</artifactId>
<version>2.17.0.redhat-630xxx</version>
</dependency>
URI Format Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
The GoogleCalendar Component uses the following URI format:
google-calendar://endpoint-prefix/endpoint?[options]
google-calendar://endpoint-prefix/endpoint?[options]
Endpoint prefix can be one of:
- acl
- calendars
- channels
- colors
- events
- freebusy
- list
- settings
GoogleCalendarComponent Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
The GoogleCalendar 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.google.calendar.GoogleCalendarConfiguration.
| Option | Type | |
|---|---|---|
accessToken
|
String
|
OAuth 2 access token. This typically expires after an hour so refreshToken is recommended for long term usage.
|
applicationName
|
String
|
Google calendar application name. Example would be camel-google-calendar/1.0.
|
clientId
|
String
|
Client ID of the calendar application. |
clientSecret
|
String
|
Client secret of the calendar application. |
refreshToken
|
String
|
OAuth2 refresh token. Using this token, the Google Calendar component can obtain a new accessToken whenever the current one expires - a necessity if the application is long-lived.
|
scopes
|
List<String>
|
Specifies the level of permissions you want a calendar application to have to a user account. See https://developers.google.com/google-apps/calendar/auth for more info. |
emailAddress
|
String
|
Camel 2.16.0: the
emailAddress of the Google Service Account.
|
p12FileName
|
String
|
Camel 2.16.0: the name of the
.p12 file which has the private key to use with the Google Service Account.
|
Producer Endpoints Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
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
CamelGoogleCalendar.<option>. Note that the inBody option overrides message header, i.e. the endpoint option inBody=option would override a CamelGoogleCalendar.option header.
1. Endpoint Prefix acl Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
The following endpoints can be invoked with the prefix
acl as follows:
google-calendar://acl/endpoint?[options]
google-calendar://acl/endpoint?[options]
| Endpoint | Shorthand Alias | Options | Result Body Type |
|---|---|---|---|
| delete | calendarId, ruleId | ||
| get | calendarId, ruleId | com.google.api.services.calendar.model.AclRule | |
| insert | calendarId, content | com.google.api.services.calendar.model.AclRule | |
| list | calendarId |
com.google.api.services.calendar.model.Acl
|
|
| patch | calendarId, content, ruleId | com.google.api.services.calendar.model.AclRule | |
| update | calendarId, content, ruleId | com.google.api.services.calendar.model.AclRule | |
| watch | calendarId, contentChannel | com.google.api.services.calendar.model.Channel |
URI Options for acl Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
| Name | Type |
|---|---|
| calendarId | String |
| content | com.google.api.services.calendar.model.AclRule |
| contentChannel | com.google.api.services.calendar.model.Channel |
| ruleId | String |
2. Endpoint Prefix calendars Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
The following endpoints can be invoked with the prefix
calendars as follows:
google-calendar://calendars/endpoint?[options]
google-calendar://calendars/endpoint?[options]
| Endpoint | Shorthand Alias | Options | Result Body Type |
|---|---|---|---|
| clear | calendarId | ||
| delete | calendarId | ||
| get | calendarId |
com.google.api.services.calendar.Calendar
|
|
| insert | content |
com.google.api.services.calendar.Calendar
|
|
| patch | calendarId, content |
com.google.api.services.calendar.Calendar
|
|
| update | calendarId, content |
com.google.api.services.calendar.Calendar
|
URI Options for calendars Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
| Name | Type |
|---|---|
| calendarId | String |
| content | com.google.api.services.calendar.model.Calendar |
3. Endpoint Prefix channels Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
The following endpoints can be invoked with the prefix
channels as follows:
google-calendar://channels/endpoint?[options]
google-calendar://channels/endpoint?[options]
| Endpoint | Shorthand Alias | Options | Result Body Type |
|---|---|---|---|
| stop | contentChannel |
URI Options for channels Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
| Name | Type |
|---|---|
| contentChannel | com.google.api.services.calendar.model.Channel |
4. Endpoint Prefix colors Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
The following endpoints can be invoked with the prefix
colors as follows:
google-calendar://colors/endpoint?[options]
google-calendar://colors/endpoint?[options]
| Endpoint | Shorthand Alias | Options | Result Body Type |
|---|---|---|---|
| get |
com.google.api.services.calendar.model.Colors
|
URI Options for colors Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
| Name | Type |
|---|
5. Endpoint Prefix events Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
The following endpoints can be invoked with the prefix
events as follows:
google-calendar://events/endpoint?[options]
google-calendar://events/endpoint?[options]
| Endpoint | Shorthand Alias | Options | Result Body Type |
|---|---|---|---|
| calendarImport | calendarId, content | com.google.api.services.calendar.model.Event | |
| delete | calendarId, eventId | ||
| get | calendarId, eventId | com.google.api.services.calendar.model.Event | |
| insert | calendarId, content | com.google.api.services.calendar.model.Event | |
| instances | calendarId, eventId |
com.google.api.services.calendar.model.Events
|
|
| list | calendarId |
com.google.api.services.calendar.model.Events
|
|
| move | calendarId, destination, eventId | com.google.api.services.calendar.model.Event | |
| patch | calendarId, content, eventId | com.google.api.services.calendar.model.Event | |
| quickAdd | calendarId, text | com.google.api.services.calendar.model.Event | |
| update | calendarId, content, eventId | com.google.api.services.calendar.model.Event | |
| watch | calendarId, contentChannel | com.google.api.services.calendar.model.Channel |
URI Options for events Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
| Name | Type |
|---|---|
| calendarId | String |
| content | com.google.api.services.calendar.model.Event |
| contentChannel | com.google.api.services.calendar.model.Channel |
| destination | String |
| eventId | String |
| text | String |
6. Endpoint Prefix freebusy Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
The following endpoints can be invoked with the prefix
freebusy as follows:
google-calendar://freebusy/endpoint?[options]
google-calendar://freebusy/endpoint?[options]
| Endpoint | Shorthand Alias | Options | Result Body Type |
|---|---|---|---|
| query | content | com.google.api.services.calendar.model.FreeBusyResponse |
URI Options for freebusy Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
| Name | Type |
|---|---|
| content | com.google.api.services.calendar.model.FreeBusyRequest |
7. Endpoint Prefix list Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
The following endpoints can be invoked with the prefix
list as follows:
google-calendar://list/endpoint?[options]
google-calendar://list/endpoint?[options]
| Endpoint | Shorthand Alias | Options | Result Body Type |
|---|---|---|---|
| delete | calendarId | ||
| get | calendarId |
com.google.api.services.calendar.model.CalendarListEntry
|
|
| insert | content |
com.google.api.services.calendar.model.CalendarListEntry
|
|
| list |
com.google.api.services.calendar.model.CalendarList
|
||
| patch | calendarId, content |
com.google.api.services.calendar.model.CalendarListEntry
|
|
| update | calendarId, content |
com.google.api.services.calendar.model.CalendarListEntry
|
|
| watch | contentChannel | com.google.api.services.calendar.model.Channel |
URI Options for list Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
| Name | Type |
|---|---|
| calendarId | String |
| content | com.google.api.services.calendar.model.CalendarListEntry |
| contentChannel | com.google.api.services.calendar.model.Channel |
8. Endpoint Prefix settings Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
The following endpoints can be invoked with the prefix
settings as follows:
google-calendar://settings/endpoint?[options]
google-calendar://settings/endpoint?[options]
| Endpoint | Shorthand Alias | Options | Result Body Type |
|---|---|---|---|
| get | setting |
com.google.api.services.calendar.model.Setting
|
|
| list |
com.google.api.services.calendar.model.Settings
|
||
| watch | contentChannel | com.google.api.services.calendar.model.Channel |
URI Options for settings Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
| Name | Type |
|---|---|
| contentChannel | com.google.api.services.calendar.model.Channel |
| setting | String |
Consumer Endpoints Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
Any of the producer endpoints can be used as a consumer endpoint. Consumer endpoints can use Scheduled Poll Consumer Options with a
consumer. prefix to schedule endpoint invocation. Consumer endpoints that return an array or collection will generate one exchange per element, and their routes will be executed once for each exchange.
Message Headers Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
Any URI option can be provided in a message header for producer endpoints with a
CamelGoogleCalendar. prefix.
Message Body Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
All result message bodies utilize objects provided by the underlying APIs used by the GoogleCalendarComponent. Producer endpoints can specify the option name for incoming message body in the
inBody endpoint URI parameter. For endpoints that return an array or collection, a consumer endpoint will map every element to distinct messages.