Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.

GoogleCalendar Component


Available as of Camel 2.15

Component Description

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.15.0</version>
    </dependency>
        

URI Format


The GoogleCalendar Component uses the following URI format:

        google-calendar://endpoint-prefix/endpoint?[options]
    

Endpoint prefix can be one of:

  • acl
  • calendars
  • channels
  • colors
  • events
  • freebusy
  • list
  • settings

GoogleCalendarComponent


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.

OptionType 
accessTokenStringOAuth 2 access token. This typically expires after an hour so refreshToken is recommended for long term usage.
applicationNameStringGoogle calendar application name. Example would be "camel-google-calendar/1.0"
clientIdStringClient ID of the calendar application
clientSecretStringClient secret of the calendar application
refreshToken

String

OAuth 2 refresh token. Using this, the Google Calendar component can obtain a new accessToken whenever the current one expires - a necessity if the application is long-lived.
scopesList<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.
emailAddressStringSince Camel 2.16.0, the emailAddress of the Google Service Account.
p12FileNameStringSince Camel 2.16.0, the name of the p12 file which has the private key to use with the Google Service Account.

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 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


The following endpoints can be invoked with the prefix acl as follows:

        google-calendar://acl/endpoint?[options]
    
EndpointShorthand AliasOptionsResult Body Type
delete calendarId, ruleId 
get calendarId, ruleIdcom.google.api.services.calendar.model.AclRule
insert calendarId, contentcom.google.api.services.calendar.model.AclRule
list calendarId
com.google.api.services.calendar.model.Acl
patch calendarId, content, ruleIdcom.google.api.services.calendar.model.AclRule
update calendarId, content, ruleIdcom.google.api.services.calendar.model.AclRule
watch calendarId, contentChannelcom.google.api.services.calendar.model.Channel

URI Options for acl


NameType
calendarIdString
contentcom.google.api.services.calendar.model.AclRule
contentChannelcom.google.api.services.calendar.model.Channel
ruleIdString

2. Endpoint Prefix calendars


The following endpoints can be invoked with the prefix calendars as follows:

        google-calendar://calendars/endpoint?[options]
    
EndpointShorthand AliasOptionsResult 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


NameType
calendarIdString
contentcom.google.api.services.calendar.model.Calendar

3. Endpoint Prefix channels


The following endpoints can be invoked with the prefix channels as follows:

        google-calendar://channels/endpoint?[options]
    
EndpointShorthand AliasOptionsResult Body Type
stop contentChannel 

URI Options for channels


NameType
contentChannelcom.google.api.services.calendar.model.Channel

4. Endpoint Prefix colors


The following endpoints can be invoked with the prefix colors as follows:

        google-calendar://colors/endpoint?[options]
    
EndpointShorthand AliasOptionsResult Body Type
get  
com.google.api.services.calendar.model.Colors

URI Options for colors


NameType

5. Endpoint Prefix events


The following endpoints can be invoked with the prefix events as follows:

        google-calendar://events/endpoint?[options]
    
EndpointShorthand AliasOptionsResult Body Type
calendarImport calendarId, contentcom.google.api.services.calendar.model.Event
delete calendarId, eventId 
get calendarId, eventIdcom.google.api.services.calendar.model.Event
insert calendarId, contentcom.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, eventIdcom.google.api.services.calendar.model.Event
patch calendarId, content, eventIdcom.google.api.services.calendar.model.Event
quickAdd calendarId, textcom.google.api.services.calendar.model.Event
update calendarId, content, eventIdcom.google.api.services.calendar.model.Event
watch calendarId, contentChannelcom.google.api.services.calendar.model.Channel

URI Options for events


NameType
calendarIdString
contentcom.google.api.services.calendar.model.Event
contentChannelcom.google.api.services.calendar.model.Channel
destinationString
eventIdString
textString

6. Endpoint Prefix freebusy


The following endpoints can be invoked with the prefix freebusy as follows:

        google-calendar://freebusy/endpoint?[options]
    
EndpointShorthand AliasOptionsResult Body Type
query contentcom.google.api.services.calendar.model.FreeBusyResponse

URI Options for freebusy


NameType
contentcom.google.api.services.calendar.model.FreeBusyRequest

7. Endpoint Prefix list


The following endpoints can be invoked with the prefix list as follows:

        google-calendar://list/endpoint?[options]
    
EndpointShorthand AliasOptionsResult 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 contentChannelcom.google.api.services.calendar.model.Channel

URI Options for list


NameType
calendarIdString
contentcom.google.api.services.calendar.model.CalendarListEntry
contentChannelcom.google.api.services.calendar.model.Channel

8. Endpoint Prefix settings


The following endpoints can be invoked with the prefix settings as follows:

        google-calendar://settings/endpoint?[options]
    
EndpointShorthand AliasOptionsResult Body Type
get setting
com.google.api.services.calendar.model.Setting
list  
com.google.api.services.calendar.model.Settings
watch contentChannelcom.google.api.services.calendar.model.Channel

URI Options for settings


NameType
contentChannelcom.google.api.services.calendar.model.Channel
settingString

Consumer Endpoints


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


Any URI option can be provided in a message header for producer endpoints with a CamelGoogleCalendar. prefix.

Message Body


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.     

© 2004-2015 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram