Component docs
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d7b7d369 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d7b7d369 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d7b7d369 Branch: refs/heads/master Commit: d7b7d369e2daace85ff509aa236eb3e6498a6320 Parents: c748374 Author: Claus Ibsen <[email protected]> Authored: Fri May 8 17:05:21 2015 +0200 Committer: Claus Ibsen <[email protected]> Committed: Fri May 8 17:05:21 2015 +0200 ---------------------------------------------------------------------- .../google/mail/GoogleMailComponent.java | 12 ++++++++ .../google/mail/GoogleMailConfiguration.java | 30 ++++++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/d7b7d369/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java b/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java index ba78eba..71401e9 100644 --- a/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java +++ b/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java @@ -60,6 +60,18 @@ public class GoogleMailComponent extends AbstractApiComponent<GoogleMailApiName, return clientFactory; } + /** + * To use the shared configuration + */ + @Override + public void setConfiguration(GoogleMailConfiguration configuration) { + super.setConfiguration(configuration); + } + + /** + * To use the GoogleCalendarClientFactory as factory for creating the client. + * Will by default use {@link BatchGoogleMailClientFactory} + */ public void setClientFactory(GoogleMailClientFactory clientFactory) { this.clientFactory = clientFactory; } http://git-wip-us.apache.org/repos/asf/camel/blob/d7b7d369/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailConfiguration.java b/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailConfiguration.java index 913a9cc..96b2b76 100644 --- a/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailConfiguration.java +++ b/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailConfiguration.java @@ -21,6 +21,7 @@ import java.util.List; import com.google.api.services.gmail.GmailScopes; import org.apache.camel.component.google.mail.internal.GoogleMailApiName; +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,10 +33,11 @@ import org.apache.camel.spi.UriPath; public class GoogleMailConfiguration { private static final List<String> DEFAULT_SCOPES = Arrays.asList(GmailScopes.GMAIL_COMPOSE, GmailScopes.GMAIL_MODIFY, GmailScopes.MAIL_GOOGLE_COM); - @UriPath + @UriPath @Metadata(required = "true") private GoogleMailApiName apiName; - @UriPath + @UriPath(enums = "create,delete,get,getProfile,gmailImport,insert,list,modify,patch,send,trash,untrash,update") + @Metadata(required = "true") private String methodName; @UriParam @@ -60,6 +62,9 @@ public class GoogleMailConfiguration { return apiName; } + /** + * What kind of operation to perform + */ public void setApiName(GoogleMailApiName apiName) { this.apiName = apiName; } @@ -68,6 +73,9 @@ public class GoogleMailConfiguration { 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 GoogleMailConfiguration { return clientId; } + /** + * Client ID of the mail application + */ public void setClientId(String clientId) { this.clientId = clientId; } @@ -84,6 +95,9 @@ public class GoogleMailConfiguration { return clientSecret; } + /** + * Client secret of the mail application + */ public void setClientSecret(String clientSecret) { this.clientSecret = clientSecret; } @@ -92,6 +106,9 @@ public class GoogleMailConfiguration { 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 GoogleMailConfiguration { 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 GoogleMailConfiguration { return applicationName; } + /** + * Google mail application name. Example would be "camel-google-mail/1.0" + */ public void setApplicationName(String applicationName) { this.applicationName = applicationName; } @@ -116,6 +139,9 @@ public class GoogleMailConfiguration { return scopes; } + /** + * Specifies the level of permissions you want a mail application to have to a user account. See https://developers.google.com/gmail/api/auth/scopes for more info. + */ public void setScopes(List<String> scopes) { this.scopes = scopes; }
