From 51f270663f86df4b69dc7158de933d8ed71d735f Mon Sep 17 00:00:00 2001 From: Claus Ibsen Date: Fri, 27 Dec 2024 13:26:53 +0100 Subject: [PATCH] CAMEL-19665: camel-git should be batch poll consumer --- .../apache/camel/catalog/components/git.json | 47 +- .../component/git/GitEndpointConfigurer.java | 96 +++ .../component/git/GitEndpointUriFactory.java | 27 +- .../org/apache/camel/component/git/git.json | 47 +- .../camel/component/git/GitConstants.java | 4 +- .../camel/component/git/GitEndpoint.java | 10 +- .../git/consumer/AbstractGitConsumer.java | 43 +- .../git/consumer/GitBranchConsumer.java | 23 +- .../git/consumer/GitCommitConsumer.java | 21 +- .../git/consumer/GitTagConsumer.java | 23 +- .../dsl/GitEndpointBuilderFactory.java | 565 +++++++++++++++++- 11 files changed, 832 insertions(+), 74 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/git.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/git.json index 269a127a0f7f4..c0acb4752dc22 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/git.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/git.json @@ -41,25 +41,42 @@ "CamelGitAuthorName": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The author name", "constantName": "org.apache.camel.component.git.GitConstants#GIT_COMMIT_AUTHOR_NAME" }, "CamelGitCommiterName": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The committer name", "constantName": "org.apache.camel.component.git.GitConstants#GIT_COMMIT_COMMITTER_NAME" }, "CamelGitCommitTime": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The commit time", "constantName": "org.apache.camel.component.git.GitConstants#GIT_COMMIT_TIME" }, - "CamelGitBranchLeaf": { "index": 10, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The leaf", "constantName": "org.apache.camel.component.git.GitConstants#GIT_BRANCH_LEAF" }, - "CamelGitBranchObjectId": { "index": 11, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The object id", "constantName": "org.apache.camel.component.git.GitConstants#GIT_BRANCH_OBJECT_ID" } + "CamelGitBranchName": { "index": 10, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The branch\/tag name", "constantName": "org.apache.camel.component.git.GitConstants#GIT_BRANCH_NAME" }, + "CamelGitBranchLeaf": { "index": 11, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The leaf", "constantName": "org.apache.camel.component.git.GitConstants#GIT_BRANCH_LEAF" }, + "CamelGitBranchObjectId": { "index": 12, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The object id", "constantName": "org.apache.camel.component.git.GitConstants#GIT_BRANCH_OBJECT_ID" } }, "properties": { "localPath": { "index": 0, "kind": "path", "displayName": "Local Path", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Local repository path" }, "branchName": { "index": 1, "kind": "parameter", "displayName": "Branch Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The branch name to work on" }, - "type": { "index": 2, "kind": "parameter", "displayName": "Type", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.git.consumer.GitType", "enum": [ "commit", "tag", "branch" ], "deprecated": false, "autowired": false, "secret": false, "description": "The consumer type" }, - "bridgeErrorHandler": { "index": 3, "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 (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, - "exceptionHandler": { "index": 4, "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 consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, - "exchangePattern": { "index": 5, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, - "allowEmpty": { "index": 6, "kind": "parameter", "displayName": "Allow Empty", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": true, "description": "The flag to manage empty git commits" }, - "operation": { "index": 7, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "clone", "init", "add", "remove", "commit", "commitAll", "createBranch", "deleteBranch", "createTag", "deleteTag", "status", "log", "push", "pull", "showBranches", "cherryPick", "remoteAdd", "remoteList" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to do on the repository" }, - "password": { "index": 8, "kind": "parameter", "displayName": "Password", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Remote repository password" }, - "remoteName": { "index": 9, "kind": "parameter", "displayName": "Remote Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The remote repository name to use in particular operation like pull" }, - "remotePath": { "index": 10, "kind": "parameter", "displayName": "Remote Path", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The remote repository path" }, - "tagName": { "index": 11, "kind": "parameter", "displayName": "Tag Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The tag name to work on" }, - "targetBranchName": { "index": 12, "kind": "parameter", "displayName": "Target Branch Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "master", "description": "Name of target branch in merge operation. If not supplied will try to use init.defaultBranch git configs. If not configured will use default value" }, - "username": { "index": 13, "kind": "parameter", "displayName": "Username", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Remote repository username" }, + "sendEmptyMessageWhenIdle": { "index": 2, "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." }, + "type": { "index": 3, "kind": "parameter", "displayName": "Type", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.git.consumer.GitType", "enum": [ "commit", "tag", "branch" ], "deprecated": false, "autowired": false, "secret": false, "description": "The consumer type" }, + "bridgeErrorHandler": { "index": 4, "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 (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, + "exceptionHandler": { "index": 5, "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 consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, + "exchangePattern": { "index": 6, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, + "pollStrategy": { "index": 7, "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 before an Exchange have been created and being routed in Camel." }, + "allowEmpty": { "index": 8, "kind": "parameter", "displayName": "Allow Empty", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": true, "description": "The flag to manage empty git commits" }, + "operation": { "index": 9, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "clone", "init", "add", "remove", "commit", "commitAll", "createBranch", "deleteBranch", "createTag", "deleteTag", "status", "log", "push", "pull", "showBranches", "cherryPick", "remoteAdd", "remoteList" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to do on the repository" }, + "remoteName": { "index": 10, "kind": "parameter", "displayName": "Remote Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The remote repository name to use in particular operation like pull" }, + "remotePath": { "index": 11, "kind": "parameter", "displayName": "Remote Path", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The remote repository path" }, + "tagName": { "index": 12, "kind": "parameter", "displayName": "Tag Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The tag name to work on" }, + "targetBranchName": { "index": 13, "kind": "parameter", "displayName": "Target Branch Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "master", "description": "Name of target branch in merge operation. If not supplied will try to use init.defaultBranch git configs. If not configured will use default value" }, "lazyStartProducer": { "index": 14, "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 otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, - "gitConfigFile": { "index": 15, "kind": "parameter", "displayName": "Git Config File", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "A String with path to a .gitconfig file" } + "gitConfigFile": { "index": 15, "kind": "parameter", "displayName": "Git Config File", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "A String with path to a .gitconfig file" }, + "backoffErrorThreshold": { "index": 16, "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": { "index": 17, "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": { "index": 18, "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 again. When this option is in use then backoffIdleThreshold and\/or backoffErrorThreshold must also be configured." }, + "delay": { "index": 19, "kind": "parameter", "displayName": "Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "description": "Milliseconds before the next poll." }, + "greedy": { "index": 20, "kind": "parameter", "displayName": "Greedy", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages." }, + "initialDelay": { "index": 21, "kind": "parameter", "displayName": "Initial Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Milliseconds before the first poll starts." }, + "repeatCount": { "index": 22, "kind": "parameter", "displayName": "Repeat Count", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 0, "description": "Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever." }, + "runLoggingLevel": { "index": 23, "kind": "parameter", "displayName": "Run Logging Level", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TRACE", "description": "The consumer logs a start\/complete log line when it polls. This option allows you to configure the logging level for that." }, + "scheduledExecutorService": { "index": 24, "kind": "parameter", "displayName": "Scheduled Executor Service", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.ScheduledExecutorService", "deprecated": false, "autowired": false, "secret": false, "description": "Allows for configuring a custom\/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool." }, + "scheduler": { "index": 25, "kind": "parameter", "displayName": "Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "none", "description": "To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler" }, + "schedulerProperties": { "index": 26, "kind": "parameter", "displayName": "Scheduler Properties", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.Map", "prefix": "scheduler.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler." }, + "startScheduler": { "index": 27, "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the scheduler should be auto started." }, + "timeUnit": { "index": 28, "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." }, + "useFixedDelay": { "index": 29, "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." }, + "password": { "index": 30, "kind": "parameter", "displayName": "Password", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "Remote repository password" }, + "username": { "index": 31, "kind": "parameter", "displayName": "Username", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "Remote repository username" } } } diff --git a/components/camel-git/src/generated/java/org/apache/camel/component/git/GitEndpointConfigurer.java b/components/camel-git/src/generated/java/org/apache/camel/component/git/GitEndpointConfigurer.java index a29a1e2b5b82b..40684aba086c1 100644 --- a/components/camel-git/src/generated/java/org/apache/camel/component/git/GitEndpointConfigurer.java +++ b/components/camel-git/src/generated/java/org/apache/camel/component/git/GitEndpointConfigurer.java @@ -25,29 +25,58 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj switch (ignoreCase ? name.toLowerCase() : name) { case "allowempty": case "allowEmpty": target.setAllowEmpty(property(camelContext, boolean.class, value)); return true; + case "backofferrorthreshold": + case "backoffErrorThreshold": target.setBackoffErrorThreshold(property(camelContext, int.class, value)); return true; + case "backoffidlethreshold": + case "backoffIdleThreshold": target.setBackoffIdleThreshold(property(camelContext, int.class, value)); return true; + case "backoffmultiplier": + case "backoffMultiplier": target.setBackoffMultiplier(property(camelContext, int.class, value)); return true; case "branchname": case "branchName": target.setBranchName(property(camelContext, java.lang.String.class, value)); return true; case "bridgeerrorhandler": case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true; + case "delay": target.setDelay(property(camelContext, long.class, value)); return true; case "exceptionhandler": case "exceptionHandler": target.setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true; case "exchangepattern": case "exchangePattern": target.setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true; case "gitconfigfile": case "gitConfigFile": target.setGitConfigFile(property(camelContext, java.lang.String.class, value)); return true; + case "greedy": target.setGreedy(property(camelContext, boolean.class, value)); return true; + case "initialdelay": + case "initialDelay": target.setInitialDelay(property(camelContext, long.class, value)); return true; case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; case "operation": target.setOperation(property(camelContext, java.lang.String.class, value)); return true; case "password": target.setPassword(property(camelContext, java.lang.String.class, value)); return true; + case "pollstrategy": + case "pollStrategy": target.setPollStrategy(property(camelContext, org.apache.camel.spi.PollingConsumerPollStrategy.class, value)); return true; case "remotename": case "remoteName": target.setRemoteName(property(camelContext, java.lang.String.class, value)); return true; case "remotepath": case "remotePath": target.setRemotePath(property(camelContext, java.lang.String.class, value)); return true; + case "repeatcount": + case "repeatCount": target.setRepeatCount(property(camelContext, long.class, value)); return true; + case "runlogginglevel": + case "runLoggingLevel": target.setRunLoggingLevel(property(camelContext, org.apache.camel.LoggingLevel.class, value)); return true; + case "scheduledexecutorservice": + case "scheduledExecutorService": target.setScheduledExecutorService(property(camelContext, java.util.concurrent.ScheduledExecutorService.class, value)); return true; + case "scheduler": target.setScheduler(property(camelContext, java.lang.Object.class, value)); return true; + case "schedulerproperties": + case "schedulerProperties": target.setSchedulerProperties(property(camelContext, java.util.Map.class, value)); return true; + case "sendemptymessagewhenidle": + case "sendEmptyMessageWhenIdle": target.setSendEmptyMessageWhenIdle(property(camelContext, boolean.class, value)); return true; + case "startscheduler": + case "startScheduler": target.setStartScheduler(property(camelContext, boolean.class, value)); return true; case "tagname": case "tagName": target.setTagName(property(camelContext, java.lang.String.class, value)); return true; case "targetbranchname": case "targetBranchName": target.setTargetBranchName(property(camelContext, java.lang.String.class, value)); return true; + case "timeunit": + case "timeUnit": target.setTimeUnit(property(camelContext, java.util.concurrent.TimeUnit.class, value)); return true; case "type": target.setType(property(camelContext, org.apache.camel.component.git.consumer.GitType.class, value)); return true; + case "usefixeddelay": + case "useFixedDelay": target.setUseFixedDelay(property(camelContext, boolean.class, value)); return true; case "username": target.setUsername(property(camelContext, java.lang.String.class, value)); return true; default: return false; } @@ -58,29 +87,58 @@ public Class getOptionType(String name, boolean ignoreCase) { switch (ignoreCase ? name.toLowerCase() : name) { case "allowempty": case "allowEmpty": return boolean.class; + case "backofferrorthreshold": + case "backoffErrorThreshold": return int.class; + case "backoffidlethreshold": + case "backoffIdleThreshold": return int.class; + case "backoffmultiplier": + case "backoffMultiplier": return int.class; case "branchname": case "branchName": return java.lang.String.class; case "bridgeerrorhandler": case "bridgeErrorHandler": return boolean.class; + case "delay": return long.class; case "exceptionhandler": case "exceptionHandler": return org.apache.camel.spi.ExceptionHandler.class; case "exchangepattern": case "exchangePattern": return org.apache.camel.ExchangePattern.class; case "gitconfigfile": case "gitConfigFile": return java.lang.String.class; + case "greedy": return boolean.class; + case "initialdelay": + case "initialDelay": return long.class; case "lazystartproducer": case "lazyStartProducer": return boolean.class; case "operation": return java.lang.String.class; case "password": return java.lang.String.class; + case "pollstrategy": + case "pollStrategy": return org.apache.camel.spi.PollingConsumerPollStrategy.class; case "remotename": case "remoteName": return java.lang.String.class; case "remotepath": case "remotePath": return java.lang.String.class; + case "repeatcount": + case "repeatCount": return long.class; + case "runlogginglevel": + case "runLoggingLevel": return org.apache.camel.LoggingLevel.class; + case "scheduledexecutorservice": + case "scheduledExecutorService": return java.util.concurrent.ScheduledExecutorService.class; + case "scheduler": return java.lang.Object.class; + case "schedulerproperties": + case "schedulerProperties": return java.util.Map.class; + case "sendemptymessagewhenidle": + case "sendEmptyMessageWhenIdle": return boolean.class; + case "startscheduler": + case "startScheduler": return boolean.class; case "tagname": case "tagName": return java.lang.String.class; case "targetbranchname": case "targetBranchName": return java.lang.String.class; + case "timeunit": + case "timeUnit": return java.util.concurrent.TimeUnit.class; case "type": return org.apache.camel.component.git.consumer.GitType.class; + case "usefixeddelay": + case "useFixedDelay": return boolean.class; case "username": return java.lang.String.class; default: return null; } @@ -92,32 +150,70 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) { switch (ignoreCase ? name.toLowerCase() : name) { case "allowempty": case "allowEmpty": return target.isAllowEmpty(); + case "backofferrorthreshold": + case "backoffErrorThreshold": return target.getBackoffErrorThreshold(); + case "backoffidlethreshold": + case "backoffIdleThreshold": return target.getBackoffIdleThreshold(); + case "backoffmultiplier": + case "backoffMultiplier": return target.getBackoffMultiplier(); case "branchname": case "branchName": return target.getBranchName(); case "bridgeerrorhandler": case "bridgeErrorHandler": return target.isBridgeErrorHandler(); + case "delay": return target.getDelay(); case "exceptionhandler": case "exceptionHandler": return target.getExceptionHandler(); case "exchangepattern": case "exchangePattern": return target.getExchangePattern(); case "gitconfigfile": case "gitConfigFile": return target.getGitConfigFile(); + case "greedy": return target.isGreedy(); + case "initialdelay": + case "initialDelay": return target.getInitialDelay(); case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); case "operation": return target.getOperation(); case "password": return target.getPassword(); + case "pollstrategy": + case "pollStrategy": return target.getPollStrategy(); case "remotename": case "remoteName": return target.getRemoteName(); case "remotepath": case "remotePath": return target.getRemotePath(); + case "repeatcount": + case "repeatCount": return target.getRepeatCount(); + case "runlogginglevel": + case "runLoggingLevel": return target.getRunLoggingLevel(); + case "scheduledexecutorservice": + case "scheduledExecutorService": return target.getScheduledExecutorService(); + case "scheduler": return target.getScheduler(); + case "schedulerproperties": + case "schedulerProperties": return target.getSchedulerProperties(); + case "sendemptymessagewhenidle": + case "sendEmptyMessageWhenIdle": return target.isSendEmptyMessageWhenIdle(); + case "startscheduler": + case "startScheduler": return target.isStartScheduler(); case "tagname": case "tagName": return target.getTagName(); case "targetbranchname": case "targetBranchName": return target.getTargetBranchName(); + case "timeunit": + case "timeUnit": return target.getTimeUnit(); case "type": return target.getType(); + case "usefixeddelay": + case "useFixedDelay": return target.isUseFixedDelay(); case "username": return target.getUsername(); default: return null; } } + + @Override + public Object getCollectionValueType(Object target, String name, boolean ignoreCase) { + switch (ignoreCase ? name.toLowerCase() : name) { + case "schedulerproperties": + case "schedulerProperties": return java.lang.Object.class; + default: return null; + } + } } diff --git a/components/camel-git/src/generated/java/org/apache/camel/component/git/GitEndpointUriFactory.java b/components/camel-git/src/generated/java/org/apache/camel/component/git/GitEndpointUriFactory.java index 3931ae4e449de..8516d584a2f5e 100644 --- a/components/camel-git/src/generated/java/org/apache/camel/component/git/GitEndpointUriFactory.java +++ b/components/camel-git/src/generated/java/org/apache/camel/component/git/GitEndpointUriFactory.java @@ -23,26 +23,47 @@ public class GitEndpointUriFactory extends org.apache.camel.support.component.En private static final Set SECRET_PROPERTY_NAMES; private static final Set MULTI_VALUE_PREFIXES; static { - Set props = new HashSet<>(16); + Set props = new HashSet<>(32); props.add("allowEmpty"); + props.add("backoffErrorThreshold"); + props.add("backoffIdleThreshold"); + props.add("backoffMultiplier"); props.add("branchName"); props.add("bridgeErrorHandler"); + props.add("delay"); props.add("exceptionHandler"); props.add("exchangePattern"); props.add("gitConfigFile"); + props.add("greedy"); + props.add("initialDelay"); props.add("lazyStartProducer"); props.add("localPath"); props.add("operation"); props.add("password"); + props.add("pollStrategy"); props.add("remoteName"); props.add("remotePath"); + props.add("repeatCount"); + props.add("runLoggingLevel"); + props.add("scheduledExecutorService"); + props.add("scheduler"); + props.add("schedulerProperties"); + props.add("sendEmptyMessageWhenIdle"); + props.add("startScheduler"); props.add("tagName"); props.add("targetBranchName"); + props.add("timeUnit"); props.add("type"); + props.add("useFixedDelay"); props.add("username"); PROPERTY_NAMES = Collections.unmodifiableSet(props); - SECRET_PROPERTY_NAMES = Collections.emptySet(); - MULTI_VALUE_PREFIXES = Collections.emptySet(); + Set secretProps = new HashSet<>(2); + secretProps.add("password"); + secretProps.add("username"); + SECRET_PROPERTY_NAMES = Collections.unmodifiableSet(secretProps); + Set prefixes = new HashSet<>(1); + prefixes.add("scheduler."); + MULTI_VALUE_PREFIXES = Collections.unmodifiableSet(prefixes); } @Override diff --git a/components/camel-git/src/generated/resources/META-INF/org/apache/camel/component/git/git.json b/components/camel-git/src/generated/resources/META-INF/org/apache/camel/component/git/git.json index 269a127a0f7f4..c0acb4752dc22 100644 --- a/components/camel-git/src/generated/resources/META-INF/org/apache/camel/component/git/git.json +++ b/components/camel-git/src/generated/resources/META-INF/org/apache/camel/component/git/git.json @@ -41,25 +41,42 @@ "CamelGitAuthorName": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The author name", "constantName": "org.apache.camel.component.git.GitConstants#GIT_COMMIT_AUTHOR_NAME" }, "CamelGitCommiterName": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The committer name", "constantName": "org.apache.camel.component.git.GitConstants#GIT_COMMIT_COMMITTER_NAME" }, "CamelGitCommitTime": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The commit time", "constantName": "org.apache.camel.component.git.GitConstants#GIT_COMMIT_TIME" }, - "CamelGitBranchLeaf": { "index": 10, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The leaf", "constantName": "org.apache.camel.component.git.GitConstants#GIT_BRANCH_LEAF" }, - "CamelGitBranchObjectId": { "index": 11, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The object id", "constantName": "org.apache.camel.component.git.GitConstants#GIT_BRANCH_OBJECT_ID" } + "CamelGitBranchName": { "index": 10, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The branch\/tag name", "constantName": "org.apache.camel.component.git.GitConstants#GIT_BRANCH_NAME" }, + "CamelGitBranchLeaf": { "index": 11, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The leaf", "constantName": "org.apache.camel.component.git.GitConstants#GIT_BRANCH_LEAF" }, + "CamelGitBranchObjectId": { "index": 12, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The object id", "constantName": "org.apache.camel.component.git.GitConstants#GIT_BRANCH_OBJECT_ID" } }, "properties": { "localPath": { "index": 0, "kind": "path", "displayName": "Local Path", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Local repository path" }, "branchName": { "index": 1, "kind": "parameter", "displayName": "Branch Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The branch name to work on" }, - "type": { "index": 2, "kind": "parameter", "displayName": "Type", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.git.consumer.GitType", "enum": [ "commit", "tag", "branch" ], "deprecated": false, "autowired": false, "secret": false, "description": "The consumer type" }, - "bridgeErrorHandler": { "index": 3, "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 (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, - "exceptionHandler": { "index": 4, "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 consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, - "exchangePattern": { "index": 5, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, - "allowEmpty": { "index": 6, "kind": "parameter", "displayName": "Allow Empty", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": true, "description": "The flag to manage empty git commits" }, - "operation": { "index": 7, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "clone", "init", "add", "remove", "commit", "commitAll", "createBranch", "deleteBranch", "createTag", "deleteTag", "status", "log", "push", "pull", "showBranches", "cherryPick", "remoteAdd", "remoteList" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to do on the repository" }, - "password": { "index": 8, "kind": "parameter", "displayName": "Password", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Remote repository password" }, - "remoteName": { "index": 9, "kind": "parameter", "displayName": "Remote Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The remote repository name to use in particular operation like pull" }, - "remotePath": { "index": 10, "kind": "parameter", "displayName": "Remote Path", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The remote repository path" }, - "tagName": { "index": 11, "kind": "parameter", "displayName": "Tag Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The tag name to work on" }, - "targetBranchName": { "index": 12, "kind": "parameter", "displayName": "Target Branch Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "master", "description": "Name of target branch in merge operation. If not supplied will try to use init.defaultBranch git configs. If not configured will use default value" }, - "username": { "index": 13, "kind": "parameter", "displayName": "Username", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Remote repository username" }, + "sendEmptyMessageWhenIdle": { "index": 2, "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." }, + "type": { "index": 3, "kind": "parameter", "displayName": "Type", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.git.consumer.GitType", "enum": [ "commit", "tag", "branch" ], "deprecated": false, "autowired": false, "secret": false, "description": "The consumer type" }, + "bridgeErrorHandler": { "index": 4, "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 (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, + "exceptionHandler": { "index": 5, "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 consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, + "exchangePattern": { "index": 6, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, + "pollStrategy": { "index": 7, "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 before an Exchange have been created and being routed in Camel." }, + "allowEmpty": { "index": 8, "kind": "parameter", "displayName": "Allow Empty", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": true, "description": "The flag to manage empty git commits" }, + "operation": { "index": 9, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "clone", "init", "add", "remove", "commit", "commitAll", "createBranch", "deleteBranch", "createTag", "deleteTag", "status", "log", "push", "pull", "showBranches", "cherryPick", "remoteAdd", "remoteList" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to do on the repository" }, + "remoteName": { "index": 10, "kind": "parameter", "displayName": "Remote Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The remote repository name to use in particular operation like pull" }, + "remotePath": { "index": 11, "kind": "parameter", "displayName": "Remote Path", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The remote repository path" }, + "tagName": { "index": 12, "kind": "parameter", "displayName": "Tag Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The tag name to work on" }, + "targetBranchName": { "index": 13, "kind": "parameter", "displayName": "Target Branch Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "master", "description": "Name of target branch in merge operation. If not supplied will try to use init.defaultBranch git configs. If not configured will use default value" }, "lazyStartProducer": { "index": 14, "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 otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, - "gitConfigFile": { "index": 15, "kind": "parameter", "displayName": "Git Config File", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "A String with path to a .gitconfig file" } + "gitConfigFile": { "index": 15, "kind": "parameter", "displayName": "Git Config File", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "A String with path to a .gitconfig file" }, + "backoffErrorThreshold": { "index": 16, "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": { "index": 17, "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": { "index": 18, "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 again. When this option is in use then backoffIdleThreshold and\/or backoffErrorThreshold must also be configured." }, + "delay": { "index": 19, "kind": "parameter", "displayName": "Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "description": "Milliseconds before the next poll." }, + "greedy": { "index": 20, "kind": "parameter", "displayName": "Greedy", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages." }, + "initialDelay": { "index": 21, "kind": "parameter", "displayName": "Initial Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Milliseconds before the first poll starts." }, + "repeatCount": { "index": 22, "kind": "parameter", "displayName": "Repeat Count", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 0, "description": "Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever." }, + "runLoggingLevel": { "index": 23, "kind": "parameter", "displayName": "Run Logging Level", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TRACE", "description": "The consumer logs a start\/complete log line when it polls. This option allows you to configure the logging level for that." }, + "scheduledExecutorService": { "index": 24, "kind": "parameter", "displayName": "Scheduled Executor Service", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.ScheduledExecutorService", "deprecated": false, "autowired": false, "secret": false, "description": "Allows for configuring a custom\/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool." }, + "scheduler": { "index": 25, "kind": "parameter", "displayName": "Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "none", "description": "To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler" }, + "schedulerProperties": { "index": 26, "kind": "parameter", "displayName": "Scheduler Properties", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.Map", "prefix": "scheduler.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler." }, + "startScheduler": { "index": 27, "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the scheduler should be auto started." }, + "timeUnit": { "index": 28, "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." }, + "useFixedDelay": { "index": 29, "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." }, + "password": { "index": 30, "kind": "parameter", "displayName": "Password", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "Remote repository password" }, + "username": { "index": 31, "kind": "parameter", "displayName": "Username", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "Remote repository username" } } } diff --git a/components/camel-git/src/main/java/org/apache/camel/component/git/GitConstants.java b/components/camel-git/src/main/java/org/apache/camel/component/git/GitConstants.java index 4905bd06cc8be..2247fcf2f3ce3 100644 --- a/components/camel-git/src/main/java/org/apache/camel/component/git/GitConstants.java +++ b/components/camel-git/src/main/java/org/apache/camel/component/git/GitConstants.java @@ -40,10 +40,10 @@ public interface GitConstants { String GIT_COMMIT_COMMITTER_NAME = "CamelGitCommiterName"; @Metadata(label = "consumer", description = "The commit time", javaType = "int") String GIT_COMMIT_TIME = "CamelGitCommitTime"; + @Metadata(label = "consumer", description = "The branch/tag name", javaType = "String") + String GIT_BRANCH_NAME = "CamelGitBranchName"; @Metadata(label = "consumer", description = "The leaf", javaType = "String") String GIT_BRANCH_LEAF = "CamelGitBranchLeaf"; @Metadata(label = "consumer", description = "The object id", javaType = "String") String GIT_BRANCH_OBJECT_ID = "CamelGitBranchObjectId"; - String GIT_TAG_LEAF = "CamelGitTagLeaf"; - String GIT_TAG_OBJECT_ID = "CamelGitTagObjectId"; } diff --git a/components/camel-git/src/main/java/org/apache/camel/component/git/GitEndpoint.java b/components/camel-git/src/main/java/org/apache/camel/component/git/GitEndpoint.java index 165ac92efcd1a..76eb19d6a84c3 100644 --- a/components/camel-git/src/main/java/org/apache/camel/component/git/GitEndpoint.java +++ b/components/camel-git/src/main/java/org/apache/camel/component/git/GitEndpoint.java @@ -29,14 +29,14 @@ import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.spi.UriPath; -import org.apache.camel.support.DefaultEndpoint; +import org.apache.camel.support.ScheduledPollEndpoint; /** * Perform operations on git repositories. */ @UriEndpoint(firstVersion = "2.16.0", scheme = "git", title = "Git", syntax = "git:localPath", category = { Category.FILE }, headersClass = GitConstants.class) -public class GitEndpoint extends DefaultEndpoint { +public class GitEndpoint extends ScheduledPollEndpoint { @UriPath @Metadata(required = true) @@ -56,10 +56,10 @@ public class GitEndpoint extends DefaultEndpoint { @UriParam(enums = "commit,tag,branch", label = "consumer") private GitType type; - @UriParam(label = "producer") + @UriParam(label = "producer,security", secret = true) private String username; - @UriParam(label = "producer") + @UriParam(label = "producer,security", secret = true) private String password; @UriParam(label = "producer") @@ -224,7 +224,7 @@ public void setTargetBranchName(String targetBranchName) { } /** - * A String with path to a .gitconfig file", label = "producer,consumer,advanced + * A String with path to a .gitconfig file */ public String getGitConfigFile() { return this.gitConfigFile; diff --git a/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/AbstractGitConsumer.java b/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/AbstractGitConsumer.java index f5f8bb413bdf8..932943cc33414 100644 --- a/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/AbstractGitConsumer.java +++ b/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/AbstractGitConsumer.java @@ -16,18 +16,25 @@ */ package org.apache.camel.component.git.consumer; +import java.util.Queue; + +import org.apache.camel.Exchange; +import org.apache.camel.ExchangePropertyKey; import org.apache.camel.Processor; import org.apache.camel.component.RepositoryFactory; import org.apache.camel.component.git.GitEndpoint; -import org.apache.camel.support.ScheduledPollConsumer; +import org.apache.camel.support.ScheduledBatchPollingConsumer; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.lib.Repository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -public abstract class AbstractGitConsumer extends ScheduledPollConsumer { - private final GitEndpoint endpoint; +public abstract class AbstractGitConsumer extends ScheduledBatchPollingConsumer { - private Repository repo; + private static final Logger LOG = LoggerFactory.getLogger(AbstractGitConsumer.class); + private final GitEndpoint endpoint; + private Repository repo; private Git git; protected AbstractGitConsumer(GitEndpoint endpoint, Processor processor) { @@ -62,5 +69,31 @@ protected Git getGit() { } @Override - protected abstract int poll() throws Exception; + public int processBatch(Queue exchanges) throws Exception { + int total = exchanges.size(); + int answer = total; + if (this.maxMessagesPerPoll > 0 && total > this.maxMessagesPerPoll) { + LOG.debug("Limiting to maximum messages to poll {} as there were {} messages in this poll.", + this.maxMessagesPerPoll, total); + total = this.maxMessagesPerPoll; + } + + for (int index = 0; index < total && this.isBatchAllowed(); ++index) { + Exchange exchange = (Exchange) exchanges.poll(); + exchange.setProperty(ExchangePropertyKey.BATCH_INDEX, index); + exchange.setProperty(ExchangePropertyKey.BATCH_SIZE, total); + exchange.setProperty(ExchangePropertyKey.BATCH_COMPLETE, index == total - 1); + this.pendingExchanges = total - index - 1; + Object value = onPreProcessed(exchange); + getProcessor().process(exchange); + onProcessed(exchange, value); + } + + return answer; + } + + public abstract Object onPreProcessed(Exchange exchange); + + public abstract void onProcessed(Exchange exchange, Object value); + } diff --git a/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitBranchConsumer.java b/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitBranchConsumer.java index 869ee6431d60c..6fb10ce7cedc7 100644 --- a/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitBranchConsumer.java +++ b/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitBranchConsumer.java @@ -16,8 +16,10 @@ */ package org.apache.camel.component.git.consumer; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.List; +import java.util.Queue; import org.apache.camel.Exchange; import org.apache.camel.Processor; @@ -36,20 +38,31 @@ public GitBranchConsumer(GitEndpoint endpoint, Processor processor) { @Override protected int poll() throws Exception { - int count = 0; + Queue exchanges = new ArrayDeque<>(); List call = getGit().branchList().setListMode(ListMode.ALL).call(); for (Ref ref : call) { if (!branchesConsumed.contains(ref.getName())) { Exchange e = createExchange(true); e.getMessage().setBody(ref.getName()); + e.getMessage().setHeader(GitConstants.GIT_BRANCH_NAME, ref.getName()); e.getMessage().setHeader(GitConstants.GIT_BRANCH_LEAF, ref.getLeaf().getName()); e.getMessage().setHeader(GitConstants.GIT_BRANCH_OBJECT_ID, ref.getObjectId().getName()); - getProcessor().process(e); - branchesConsumed.add(ref.getName()); - count++; + exchanges.add(e); } } - return count; + return processBatch(exchanges); + } + + @Override + public Object onPreProcessed(Exchange exchange) { + return exchange.getMessage().getHeader(GitConstants.GIT_BRANCH_NAME, String.class); + } + + @Override + public void onProcessed(Exchange exchange, Object value) { + if (value != null) { + branchesConsumed.add(value.toString()); + } } } diff --git a/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitCommitConsumer.java b/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitCommitConsumer.java index 9eb85f2c68f17..d1a4449408e59 100644 --- a/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitCommitConsumer.java +++ b/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitCommitConsumer.java @@ -16,8 +16,10 @@ */ package org.apache.camel.component.git.consumer; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.List; +import java.util.Queue; import org.apache.camel.Exchange; import org.apache.camel.Processor; @@ -37,7 +39,8 @@ public GitCommitConsumer(GitEndpoint endpoint, Processor processor) { @Override protected int poll() throws Exception { - int count = 0; + Queue exchanges = new ArrayDeque<>(); + Iterable commits; if (ObjectHelper.isNotEmpty(((GitEndpoint) getEndpoint()).getBranchName())) { commits = getGit().log().add(getGit().getRepository().resolve(((GitEndpoint) getEndpoint()).getBranchName())) @@ -54,11 +57,21 @@ protected int poll() throws Exception { e.getMessage().setHeader(GitConstants.GIT_COMMIT_COMMITTER_NAME, commit.getCommitterIdent().getName()); e.getMessage().setHeader(GitConstants.GIT_COMMIT_TIME, commit.getCommitTime()); getProcessor().process(e); - commitsConsumed.add(commit.getId()); - count++; + exchanges.add(e); } } - return count; + return processBatch(exchanges); + } + + @Override + public Object onPreProcessed(Exchange exchange) { + return exchange.getMessage().getHeader(GitConstants.GIT_COMMIT_ID); } + @Override + public void onProcessed(Exchange exchange, Object value) { + if (value instanceof ObjectId oid) { + commitsConsumed.add(oid); + } + } } diff --git a/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitTagConsumer.java b/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitTagConsumer.java index 5cd972dc364f6..6f9fe0121700e 100644 --- a/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitTagConsumer.java +++ b/components/camel-git/src/main/java/org/apache/camel/component/git/consumer/GitTagConsumer.java @@ -16,8 +16,10 @@ */ package org.apache.camel.component.git.consumer; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.List; +import java.util.Queue; import org.apache.camel.Exchange; import org.apache.camel.Processor; @@ -35,20 +37,31 @@ public GitTagConsumer(GitEndpoint endpoint, Processor processor) { @Override protected int poll() throws Exception { - int count = 0; + Queue exchanges = new ArrayDeque<>(); List call = getGit().tagList().call(); for (Ref ref : call) { if (!tagsConsumed.contains(ref.getName())) { Exchange e = createExchange(true); e.getMessage().setBody(ref.getName()); + e.getMessage().setHeader(GitConstants.GIT_BRANCH_NAME, ref.getName()); e.getMessage().setHeader(GitConstants.GIT_BRANCH_LEAF, ref.getLeaf().getName()); e.getMessage().setHeader(GitConstants.GIT_BRANCH_OBJECT_ID, ref.getObjectId().getName()); - getProcessor().process(e); - tagsConsumed.add(ref.getName()); - count++; + exchanges.add(e); } } - return count; + return processBatch(exchanges); + } + + @Override + public Object onPreProcessed(Exchange exchange) { + return exchange.getMessage().getHeader(GitConstants.GIT_BRANCH_NAME, String.class); + } + + @Override + public void onProcessed(Exchange exchange, Object value) { + if (value != null) { + tagsConsumed.add(value.toString()); + } } } diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GitEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GitEndpointBuilderFactory.java index 8c7fdba3e7341..fe94aff0e0709 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GitEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GitEndpointBuilderFactory.java @@ -57,6 +57,38 @@ default GitEndpointConsumerBuilder branchName(String branchName) { doSetProperty("branchName", branchName); return this; } + /** + * If the polling consumer did not poll any files, you can enable this + * option to send an empty message (no body) instead. + * + * The option is a: boolean type. + * + * Default: false + * Group: consumer + * + * @param sendEmptyMessageWhenIdle the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder sendEmptyMessageWhenIdle(boolean sendEmptyMessageWhenIdle) { + doSetProperty("sendEmptyMessageWhenIdle", sendEmptyMessageWhenIdle); + return this; + } + /** + * If the polling consumer did not poll any files, you can enable this + * option to send an empty message (no body) instead. + * + * The option will be converted to a boolean type. + * + * Default: false + * Group: consumer + * + * @param sendEmptyMessageWhenIdle the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder sendEmptyMessageWhenIdle(String sendEmptyMessageWhenIdle) { + doSetProperty("sendEmptyMessageWhenIdle", sendEmptyMessageWhenIdle); + return this; + } /** * The consumer type. * @@ -87,6 +119,461 @@ default GitEndpointConsumerBuilder type(String type) { doSetProperty("type", type); return this; } + /** + * The number of subsequent error polls (failed due some error) that + * should happen before the backoffMultipler should kick-in. + * + * The option is a: int type. + * + * Group: scheduler + * + * @param backoffErrorThreshold the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder backoffErrorThreshold(int backoffErrorThreshold) { + doSetProperty("backoffErrorThreshold", backoffErrorThreshold); + return this; + } + /** + * The number of subsequent error polls (failed due some error) that + * should happen before the backoffMultipler should kick-in. + * + * The option will be converted to a int type. + * + * Group: scheduler + * + * @param backoffErrorThreshold the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder backoffErrorThreshold(String backoffErrorThreshold) { + doSetProperty("backoffErrorThreshold", backoffErrorThreshold); + return this; + } + /** + * The number of subsequent idle polls that should happen before the + * backoffMultipler should kick-in. + * + * The option is a: int type. + * + * Group: scheduler + * + * @param backoffIdleThreshold the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder backoffIdleThreshold(int backoffIdleThreshold) { + doSetProperty("backoffIdleThreshold", backoffIdleThreshold); + return this; + } + /** + * The number of subsequent idle polls that should happen before the + * backoffMultipler should kick-in. + * + * The option will be converted to a int type. + * + * Group: scheduler + * + * @param backoffIdleThreshold the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder backoffIdleThreshold(String backoffIdleThreshold) { + doSetProperty("backoffIdleThreshold", backoffIdleThreshold); + return this; + } + /** + * 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 again. When this option is in use then + * backoffIdleThreshold and/or backoffErrorThreshold must also be + * configured. + * + * The option is a: int type. + * + * Group: scheduler + * + * @param backoffMultiplier the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder backoffMultiplier(int backoffMultiplier) { + doSetProperty("backoffMultiplier", backoffMultiplier); + return this; + } + /** + * 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 again. When this option is in use then + * backoffIdleThreshold and/or backoffErrorThreshold must also be + * configured. + * + * The option will be converted to a int type. + * + * Group: scheduler + * + * @param backoffMultiplier the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder backoffMultiplier(String backoffMultiplier) { + doSetProperty("backoffMultiplier", backoffMultiplier); + return this; + } + /** + * Milliseconds before the next poll. + * + * The option is a: long type. + * + * Default: 500 + * Group: scheduler + * + * @param delay the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder delay(long delay) { + doSetProperty("delay", delay); + return this; + } + /** + * Milliseconds before the next poll. + * + * The option will be converted to a long type. + * + * Default: 500 + * Group: scheduler + * + * @param delay the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder delay(String delay) { + doSetProperty("delay", delay); + return this; + } + /** + * If greedy is enabled, then the ScheduledPollConsumer will run + * immediately again, if the previous run polled 1 or more messages. + * + * The option is a: boolean type. + * + * Default: false + * Group: scheduler + * + * @param greedy the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder greedy(boolean greedy) { + doSetProperty("greedy", greedy); + return this; + } + /** + * If greedy is enabled, then the ScheduledPollConsumer will run + * immediately again, if the previous run polled 1 or more messages. + * + * The option will be converted to a boolean type. + * + * Default: false + * Group: scheduler + * + * @param greedy the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder greedy(String greedy) { + doSetProperty("greedy", greedy); + return this; + } + /** + * Milliseconds before the first poll starts. + * + * The option is a: long type. + * + * Default: 1000 + * Group: scheduler + * + * @param initialDelay the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder initialDelay(long initialDelay) { + doSetProperty("initialDelay", initialDelay); + return this; + } + /** + * Milliseconds before the first poll starts. + * + * The option will be converted to a long type. + * + * Default: 1000 + * Group: scheduler + * + * @param initialDelay the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder initialDelay(String initialDelay) { + doSetProperty("initialDelay", initialDelay); + return this; + } + /** + * Specifies a maximum limit of number of fires. So if you set it to 1, + * the scheduler will only fire once. If you set it to 5, it will only + * fire five times. A value of zero or negative means fire forever. + * + * The option is a: long type. + * + * Default: 0 + * Group: scheduler + * + * @param repeatCount the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder repeatCount(long repeatCount) { + doSetProperty("repeatCount", repeatCount); + return this; + } + /** + * Specifies a maximum limit of number of fires. So if you set it to 1, + * the scheduler will only fire once. If you set it to 5, it will only + * fire five times. A value of zero or negative means fire forever. + * + * The option will be converted to a long type. + * + * Default: 0 + * Group: scheduler + * + * @param repeatCount the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder repeatCount(String repeatCount) { + doSetProperty("repeatCount", repeatCount); + return this; + } + /** + * The consumer logs a start/complete log line when it polls. This + * option allows you to configure the logging level for that. + * + * The option is a: org.apache.camel.LoggingLevel type. + * + * Default: TRACE + * Group: scheduler + * + * @param runLoggingLevel the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder runLoggingLevel(org.apache.camel.LoggingLevel runLoggingLevel) { + doSetProperty("runLoggingLevel", runLoggingLevel); + return this; + } + /** + * The consumer logs a start/complete log line when it polls. This + * option allows you to configure the logging level for that. + * + * The option will be converted to a + * org.apache.camel.LoggingLevel type. + * + * Default: TRACE + * Group: scheduler + * + * @param runLoggingLevel the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder runLoggingLevel(String runLoggingLevel) { + doSetProperty("runLoggingLevel", runLoggingLevel); + return this; + } + /** + * Allows for configuring a custom/shared thread pool to use for the + * consumer. By default each consumer has its own single threaded thread + * pool. + * + * The option is a: + * java.util.concurrent.ScheduledExecutorService type. + * + * Group: scheduler + * + * @param scheduledExecutorService the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder scheduledExecutorService(ScheduledExecutorService scheduledExecutorService) { + doSetProperty("scheduledExecutorService", scheduledExecutorService); + return this; + } + /** + * Allows for configuring a custom/shared thread pool to use for the + * consumer. By default each consumer has its own single threaded thread + * pool. + * + * The option will be converted to a + * java.util.concurrent.ScheduledExecutorService type. + * + * Group: scheduler + * + * @param scheduledExecutorService the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder scheduledExecutorService(String scheduledExecutorService) { + doSetProperty("scheduledExecutorService", scheduledExecutorService); + return this; + } + /** + * To use a cron scheduler from either camel-spring or camel-quartz + * component. Use value spring or quartz for built in scheduler. + * + * The option is a: java.lang.Object type. + * + * Default: none + * Group: scheduler + * + * @param scheduler the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder scheduler(Object scheduler) { + doSetProperty("scheduler", scheduler); + return this; + } + /** + * To use a cron scheduler from either camel-spring or camel-quartz + * component. Use value spring or quartz for built in scheduler. + * + * The option will be converted to a java.lang.Object type. + * + * Default: none + * Group: scheduler + * + * @param scheduler the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder scheduler(String scheduler) { + doSetProperty("scheduler", scheduler); + return this; + } + /** + * To configure additional properties when using a custom scheduler or + * any of the Quartz, Spring based scheduler. + * + * The option is a: java.util.Map<java.lang.String, + * java.lang.Object> type. + * The option is multivalued, and you can use the + * schedulerProperties(String, Object) method to add a value (call the + * method multiple times to set more values). + * + * Group: scheduler + * + * @param key the option key + * @param value the option value + * @return the dsl builder + */ + default GitEndpointConsumerBuilder schedulerProperties(String key, Object value) { + doSetMultiValueProperty("schedulerProperties", "scheduler." + key, value); + return this; + } + /** + * To configure additional properties when using a custom scheduler or + * any of the Quartz, Spring based scheduler. + * + * The option is a: java.util.Map<java.lang.String, + * java.lang.Object> type. + * The option is multivalued, and you can use the + * schedulerProperties(String, Object) method to add a value (call the + * method multiple times to set more values). + * + * Group: scheduler + * + * @param values the values + * @return the dsl builder + */ + default GitEndpointConsumerBuilder schedulerProperties(Map values) { + doSetMultiValueProperties("schedulerProperties", "scheduler.", values); + return this; + } + /** + * Whether the scheduler should be auto started. + * + * The option is a: boolean type. + * + * Default: true + * Group: scheduler + * + * @param startScheduler the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder startScheduler(boolean startScheduler) { + doSetProperty("startScheduler", startScheduler); + return this; + } + /** + * Whether the scheduler should be auto started. + * + * The option will be converted to a boolean type. + * + * Default: true + * Group: scheduler + * + * @param startScheduler the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder startScheduler(String startScheduler) { + doSetProperty("startScheduler", startScheduler); + return this; + } + /** + * Time unit for initialDelay and delay options. + * + * The option is a: java.util.concurrent.TimeUnit type. + * + * Default: MILLISECONDS + * Group: scheduler + * + * @param timeUnit the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder timeUnit(TimeUnit timeUnit) { + doSetProperty("timeUnit", timeUnit); + return this; + } + /** + * Time unit for initialDelay and delay options. + * + * The option will be converted to a + * java.util.concurrent.TimeUnit type. + * + * Default: MILLISECONDS + * Group: scheduler + * + * @param timeUnit the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder timeUnit(String timeUnit) { + doSetProperty("timeUnit", timeUnit); + return this; + } + /** + * Controls if fixed delay or fixed rate is used. See + * ScheduledExecutorService in JDK for details. + * + * The option is a: boolean type. + * + * Default: true + * Group: scheduler + * + * @param useFixedDelay the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder useFixedDelay(boolean useFixedDelay) { + doSetProperty("useFixedDelay", useFixedDelay); + return this; + } + /** + * Controls if fixed delay or fixed rate is used. See + * ScheduledExecutorService in JDK for details. + * + * The option will be converted to a boolean type. + * + * Default: true + * Group: scheduler + * + * @param useFixedDelay the value to set + * @return the dsl builder + */ + default GitEndpointConsumerBuilder useFixedDelay(String useFixedDelay) { + doSetProperty("useFixedDelay", useFixedDelay); + return this; + } } /** @@ -215,6 +702,42 @@ default AdvancedGitEndpointConsumerBuilder exchangePattern(String exchangePatter doSetProperty("exchangePattern", exchangePattern); return this; } + /** + * A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing + * you to provide your custom implementation to control error handling + * usually occurred during the poll operation before an Exchange have + * been created and being routed in Camel. + * + * The option is a: + * org.apache.camel.spi.PollingConsumerPollStrategy type. + * + * Group: consumer (advanced) + * + * @param pollStrategy the value to set + * @return the dsl builder + */ + default AdvancedGitEndpointConsumerBuilder pollStrategy(org.apache.camel.spi.PollingConsumerPollStrategy pollStrategy) { + doSetProperty("pollStrategy", pollStrategy); + return this; + } + /** + * A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing + * you to provide your custom implementation to control error handling + * usually occurred during the poll operation before an Exchange have + * been created and being routed in Camel. + * + * The option will be converted to a + * org.apache.camel.spi.PollingConsumerPollStrategy type. + * + * Group: consumer (advanced) + * + * @param pollStrategy the value to set + * @return the dsl builder + */ + default AdvancedGitEndpointConsumerBuilder pollStrategy(String pollStrategy) { + doSetProperty("pollStrategy", pollStrategy); + return this; + } /** * A String with path to a .gitconfig file. * @@ -299,20 +822,6 @@ default GitEndpointProducerBuilder operation(String operation) { doSetProperty("operation", operation); return this; } - /** - * Remote repository password. - * - * The option is a: java.lang.String type. - * - * Group: producer - * - * @param password the value to set - * @return the dsl builder - */ - default GitEndpointProducerBuilder password(String password) { - doSetProperty("password", password); - return this; - } /** * The remote repository name to use in particular operation like pull. * @@ -372,12 +881,26 @@ default GitEndpointProducerBuilder targetBranchName(String targetBranchName) { doSetProperty("targetBranchName", targetBranchName); return this; } + /** + * Remote repository password. + * + * The option is a: java.lang.String type. + * + * Group: security + * + * @param password the value to set + * @return the dsl builder + */ + default GitEndpointProducerBuilder password(String password) { + doSetProperty("password", password); + return this; + } /** * Remote repository username. * * The option is a: java.lang.String type. * - * Group: producer + * Group: security * * @param username the value to set * @return the dsl builder @@ -699,6 +1222,18 @@ public String gitCommiterName() { public String gitCommitTime() { return "CamelGitCommitTime"; } + /** + * The branch/tag name. + * + * The option is a: {@code String} type. + * + * Group: consumer + * + * @return the name of the header {@code GitBranchName}. + */ + public String gitBranchName() { + return "CamelGitBranchName"; + } /** * The leaf. *