Repository: camel Updated Branches: refs/heads/master 3075e55e3 -> 6cc35dbb4
Component docs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6cc35dbb Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6cc35dbb Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6cc35dbb Branch: refs/heads/master Commit: 6cc35dbb4c134aa25ef3bda424531503f5feabb9 Parents: 3075e55 Author: Claus Ibsen <davscl...@apache.org> Authored: Fri May 8 16:31:20 2015 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Fri May 8 16:31:20 2015 +0200 ---------------------------------------------------------------------- .../util/component/AbstractApiEndpoint.java | 2 +- .../calendar/GoogleCalendarComponent.java | 19 +++++++++++- .../calendar/GoogleCalendarConfiguration.java | 32 ++++++++++++++++++-- 3 files changed, 48 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/6cc35dbb/camel-core/src/main/java/org/apache/camel/util/component/AbstractApiEndpoint.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/util/component/AbstractApiEndpoint.java b/camel-core/src/main/java/org/apache/camel/util/component/AbstractApiEndpoint.java index 3e4514e..89e8e41 100644 --- a/camel-core/src/main/java/org/apache/camel/util/component/AbstractApiEndpoint.java +++ b/camel-core/src/main/java/org/apache/camel/util/component/AbstractApiEndpoint.java @@ -62,7 +62,7 @@ public abstract class AbstractApiEndpoint<E extends ApiName, T> protected final T configuration; // property name for Exchange 'In' message body - @UriParam + @UriParam(description = "Sets the name of a parameter to be passed in the exchange In Body") protected String inBody; // candidate methods based on method name and endpoint configuration http://git-wip-us.apache.org/repos/asf/camel/blob/6cc35dbb/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarComponent.java b/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarComponent.java index 7fb2ca2..7a101aa 100644 --- a/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarComponent.java +++ b/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarComponent.java @@ -59,7 +59,24 @@ public class GoogleCalendarComponent extends AbstractApiComponent<GoogleCalendar } return clientFactory; } - + + @Override + public GoogleCalendarConfiguration getConfiguration() { + return super.getConfiguration(); + } + + /** + * To use the shared configuration + */ + @Override + public void setConfiguration(GoogleCalendarConfiguration configuration) { + super.setConfiguration(configuration); + } + + /** + * To use the GoogleCalendarClientFactory as factory for creating the client. + * Will by default use {@link BatchGoogleCalendarClientFactory} + */ public void setClientFactory(GoogleCalendarClientFactory clientFactory) { this.clientFactory = clientFactory; } http://git-wip-us.apache.org/repos/asf/camel/blob/6cc35dbb/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarConfiguration.java b/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarConfiguration.java index a527a41..0a2ce91 100644 --- a/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarConfiguration.java +++ b/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarConfiguration.java @@ -21,6 +21,7 @@ import java.util.List; import com.google.api.services.calendar.CalendarScopes; import org.apache.camel.component.google.calendar.internal.GoogleCalendarApiName; +import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriParam; import org.apache.camel.spi.UriParams; import org.apache.camel.spi.UriPath; @@ -32,13 +33,14 @@ import org.apache.camel.spi.UriPath; public class GoogleCalendarConfiguration { private static final List<String> DEFAULT_SCOPES = Arrays.asList(CalendarScopes.CALENDAR); - @UriPath + @UriPath @Metadata(required = "true") private GoogleCalendarApiName apiName; - @UriPath + @UriPath(enums = "calendarId,calendarImport,clear,content,contentChannel,delete,destination,eventId,get,insert,instances,list,move,patch,query,quickAdd,ruleId,setting,stop,text,update,watch") + @Metadata(required = "true") private String methodName; - @UriParam + @UriParam(defaultValue = CalendarScopes.CALENDAR) private List<String> scopes = DEFAULT_SCOPES; @UriParam @@ -60,6 +62,9 @@ public class GoogleCalendarConfiguration { return apiName; } + /** + * What kind of operation to perform + */ public void setApiName(GoogleCalendarApiName apiName) { this.apiName = apiName; } @@ -68,6 +73,9 @@ public class GoogleCalendarConfiguration { return methodName; } + /** + * What sub operation to use for the selected operation + */ public void setMethodName(String methodName) { this.methodName = methodName; } @@ -76,6 +84,9 @@ public class GoogleCalendarConfiguration { return clientId; } + /** + * Client ID of the calendar application + */ public void setClientId(String clientId) { this.clientId = clientId; } @@ -84,6 +95,9 @@ public class GoogleCalendarConfiguration { return clientSecret; } + /** + * Client secret of the calendar application + */ public void setClientSecret(String clientSecret) { this.clientSecret = clientSecret; } @@ -92,6 +106,9 @@ public class GoogleCalendarConfiguration { return accessToken; } + /** + * OAuth 2 access token. This typically expires after an hour so refreshToken is recommended for long term usage. + */ public void setAccessToken(String accessToken) { this.accessToken = accessToken; } @@ -100,6 +117,9 @@ public class GoogleCalendarConfiguration { return refreshToken; } + /** + * 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. + */ public void setRefreshToken(String refreshToken) { this.refreshToken = refreshToken; } @@ -108,6 +128,9 @@ public class GoogleCalendarConfiguration { return applicationName; } + /** + * Google calendar application name. Example would be "camel-google-calendar/1.0" + */ public void setApplicationName(String applicationName) { this.applicationName = applicationName; } @@ -116,6 +139,9 @@ public class GoogleCalendarConfiguration { return scopes; } + /** + * 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. + */ public void setScopes(List<String> scopes) { this.scopes = scopes; }