You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/06/19 12:54:03 UTC

[camel] 02/21: (chores) camel-google-calendar: removed unused code

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 80c3160813699d596b23391d497cae653d751504
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Sun Jun 19 11:05:19 2022 +0200

    (chores) camel-google-calendar: removed unused code
---
 .../google/calendar/GoogleCalendarEndpointConfigurer.java         | 2 +-
 .../apache/camel/component/google/calendar/google-calendar.json   | 4 ++--
 .../component/google/calendar/stream/google-calendar-stream.json  | 2 +-
 .../google/calendar/BatchGoogleCalendarClientFactory.java         | 8 ++------
 4 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/components/camel-google/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/GoogleCalendarEndpointConfigurer.java b/components/camel-google/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/GoogleCalendarEndpointConfigurer.java
index 963391ef856..9386a170d5d 100644
--- a/components/camel-google/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/GoogleCalendarEndpointConfigurer.java
+++ b/components/camel-google/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/GoogleCalendarEndpointConfigurer.java
@@ -27,8 +27,8 @@ public class GoogleCalendarEndpointConfigurer extends PropertyConfigurerSupport
         map.put("delegate", java.lang.String.class);
         map.put("inBody", java.lang.String.class);
         map.put("scopes", java.util.List.class);
-        map.put("sendEmptyMessageWhenIdle", boolean.class);
         map.put("bridgeErrorHandler", boolean.class);
+        map.put("sendEmptyMessageWhenIdle", boolean.class);
         map.put("exceptionHandler", org.apache.camel.spi.ExceptionHandler.class);
         map.put("exchangePattern", org.apache.camel.ExchangePattern.class);
         map.put("pollStrategy", org.apache.camel.spi.PollingConsumerPollStrategy.class);
diff --git a/components/camel-google/camel-google-calendar/src/generated/resources/org/apache/camel/component/google/calendar/google-calendar.json b/components/camel-google/camel-google-calendar/src/generated/resources/org/apache/camel/component/google/calendar/google-calendar.json
index e1323d914b0..3a30ea0b2dd 100644
--- a/components/camel-google/camel-google-calendar/src/generated/resources/org/apache/camel/component/google/calendar/google-calendar.json
+++ b/components/camel-google/camel-google-calendar/src/generated/resources/org/apache/camel/component/google/calendar/google-calendar.json
@@ -48,12 +48,12 @@
     "delegate": { "kind": "parameter", "displayName": "Delegate", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.GoogleCalendarConfiguration", "configurationField": "configuration", "description": "Delegate for wide-domain service account" },
     "inBody": { "kind": "parameter", "displayName": "In Body", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of a parameter to be passed in the exchange In Body" },
     "scopes": { "kind": "parameter", "displayName": "Scopes", "group": "common", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "https:\/\/www.googleapis.com\/auth\/calendar", "configurationClass": "org.apache.camel.component.google.calendar.GoogleCalendarConfiguration", "configurationField": "configuration", "description": "Specifies the level of permissions you wa [...]
+    "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
     "sendEmptyMessageWhenIdle": { "kind": "parameter", "displayName": "Send Empty Message When Idle", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead." },
-    "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now [...]
     "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
     "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
     "pollStrategy": { "kind": "parameter", "displayName": "Poll Strategy", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.PollingConsumerPollStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation  [...]
-    "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may other [...]
+    "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...]
     "backoffErrorThreshold": { "kind": "parameter", "displayName": "Backoff Error Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in." },
     "backoffIdleThreshold": { "kind": "parameter", "displayName": "Backoff Idle Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent idle polls that should happen before the backoffMultipler should kick-in." },
     "backoffMultiplier": { "kind": "parameter", "displayName": "Backoff Multiplier", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "To let the scheduled polling consumer backoff if there has been a number of subsequent idles\/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening agai [...]
diff --git a/components/camel-google/camel-google-calendar/src/generated/resources/org/apache/camel/component/google/calendar/stream/google-calendar-stream.json b/components/camel-google/camel-google-calendar/src/generated/resources/org/apache/camel/component/google/calendar/stream/google-calendar-stream.json
index b297b3360f0..df5901a5fc7 100644
--- a/components/camel-google/camel-google-calendar/src/generated/resources/org/apache/camel/component/google/calendar/stream/google-calendar-stream.json
+++ b/components/camel-google/camel-google-calendar/src/generated/resources/org/apache/camel/component/google/calendar/stream/google-calendar-stream.json
@@ -50,6 +50,7 @@
   "properties": {
     "index": { "kind": "path", "displayName": "Index", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Specifies an index for the endpoint" },
     "applicationName": { "kind": "parameter", "displayName": "Application Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Google Calendar application name. Example would be camel-google-calendar\/1.0" },
+    "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
     "calendarId": { "kind": "parameter", "displayName": "Calendar Id", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "primary", "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "The calendarId to be used" },
     "clientId": { "kind": "parameter", "displayName": "Client Id", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Client ID of the calendar application" },
     "considerLastUpdate": { "kind": "parameter", "displayName": "Consider Last Update", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Take into account the lastUpdate of the last event polled as sta [...]
@@ -60,7 +61,6 @@
     "scopes": { "kind": "parameter", "displayName": "Scopes", "group": "consumer", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Specifies the level of permissions you want a calendar application to have to a user accou [...]
     "sendEmptyMessageWhenIdle": { "kind": "parameter", "displayName": "Send Empty Message When Idle", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead." },
     "syncFlow": { "kind": "parameter", "displayName": "Sync Flow", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Sync events, see https:\/\/developers.google.com\/calendar\/v3\/sync Note: not compat [...]
-    "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now [...]
     "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
     "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
     "pollStrategy": { "kind": "parameter", "displayName": "Poll Strategy", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.PollingConsumerPollStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation  [...]
diff --git a/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/BatchGoogleCalendarClientFactory.java b/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/BatchGoogleCalendarClientFactory.java
index 784c33fed40..6490afcc74c 100644
--- a/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/BatchGoogleCalendarClientFactory.java
+++ b/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/BatchGoogleCalendarClientFactory.java
@@ -30,12 +30,8 @@ import com.google.api.services.calendar.Calendar;
 import org.apache.camel.CamelContext;
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.support.ResourceHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class BatchGoogleCalendarClientFactory implements GoogleCalendarClientFactory {
-
-    private static final Logger LOG = LoggerFactory.getLogger(BatchGoogleCalendarClientFactory.class);
     private NetHttpTransport transport;
     private JacksonFactory jsonFactory;
 
@@ -64,7 +60,7 @@ public class BatchGoogleCalendarClientFactory implements GoogleCalendarClientFac
             if (serviceAccount) {
                 credential = authorizeServiceAccount(emailAddress, p12FileName, scopes, user);
             } else {
-                credential = authorize(clientId, clientSecret, scopes);
+                credential = authorize(clientId, clientSecret);
                 if (refreshToken != null && !"".equals(refreshToken)) {
                     credential.setRefreshToken(refreshToken);
                 }
@@ -79,7 +75,7 @@ public class BatchGoogleCalendarClientFactory implements GoogleCalendarClientFac
     }
 
     // Authorizes the installed application to access user's protected data.
-    private Credential authorize(String clientId, String clientSecret, Collection<String> scopes) {
+    private Credential authorize(String clientId, String clientSecret) {
         // authorize
         return new GoogleCredential.Builder()
                 .setJsonFactory(jsonFactory)