This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 4623bdf9b422d222b39d8cddd68b6df28ef45c10 Author: Andrea Cosentino <[email protected]> AuthorDate: Tue Jun 8 14:20:19 2021 +0200 CAMEL-16519 - Remove Camel-APNS --- .../component/dsl/ApnsComponentBuilderFactory.java | 160 ---- .../endpoint/dsl/ApnsEndpointBuilderFactory.java | 917 --------------------- .../modules/ROOT/pages/apns-component.adoc | 325 -------- 3 files changed, 1402 deletions(-) diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ApnsComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ApnsComponentBuilderFactory.java deleted file mode 100644 index 44366c8..0000000 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ApnsComponentBuilderFactory.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.builder.component.dsl; - -import javax.annotation.Generated; -import org.apache.camel.Component; -import org.apache.camel.builder.component.AbstractComponentBuilder; -import org.apache.camel.builder.component.ComponentBuilder; -import org.apache.camel.component.apns.ApnsComponent; - -/** - * Send notifications to Apple iOS devices. - * - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@Generated("org.apache.camel.maven.packaging.ComponentDslMojo") -public interface ApnsComponentBuilderFactory { - - /** - * APNS (camel-apns) - * Send notifications to Apple iOS devices. - * - * Category: eventbus,mobile - * Since: 2.8 - * Maven coordinates: org.apache.camel:camel-apns - * - * @return the dsl builder - */ - @Deprecated - static ApnsComponentBuilder apns() { - return new ApnsComponentBuilderImpl(); - } - - /** - * Builder for the APNS component. - */ - interface ApnsComponentBuilder extends ComponentBuilder<ApnsComponent> { - /** - * The ApnsService to use. The - * org.apache.camel.component.apns.factory.ApnsServiceFactory can be - * used to build a ApnsService. - * - * The option is a: - * <code>com.notnoop.apns.ApnsService</code> type. - * - * Group: common - * - * @param apnsService the value to set - * @return the dsl builder - */ - default ApnsComponentBuilder apnsService( - com.notnoop.apns.ApnsService apnsService) { - doSetProperty("apnsService", apnsService); - return this; - } - /** - * 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 - * message and handled by the routing Error Handler. 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. - * - * The option is a: <code>boolean</code> type. - * - * Default: false - * Group: consumer - * - * @param bridgeErrorHandler the value to set - * @return the dsl builder - */ - default ApnsComponentBuilder bridgeErrorHandler( - boolean bridgeErrorHandler) { - doSetProperty("bridgeErrorHandler", bridgeErrorHandler); - return this; - } - /** - * 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. - * - * The option is a: <code>boolean</code> type. - * - * Default: false - * Group: producer - * - * @param lazyStartProducer the value to set - * @return the dsl builder - */ - default ApnsComponentBuilder lazyStartProducer(boolean lazyStartProducer) { - doSetProperty("lazyStartProducer", lazyStartProducer); - return this; - } - /** - * Whether autowiring is enabled. This is used for automatic autowiring - * options (the option must be marked as autowired) by looking up in the - * registry to find if there is a single instance of matching type, - * which then gets configured on the component. This can be used for - * automatic configuring JDBC data sources, JMS connection factories, - * AWS Clients, etc. - * - * The option is a: <code>boolean</code> type. - * - * Default: true - * Group: advanced - * - * @param autowiredEnabled the value to set - * @return the dsl builder - */ - default ApnsComponentBuilder autowiredEnabled(boolean autowiredEnabled) { - doSetProperty("autowiredEnabled", autowiredEnabled); - return this; - } - } - - class ApnsComponentBuilderImpl - extends - AbstractComponentBuilder<ApnsComponent> - implements - ApnsComponentBuilder { - @Override - protected ApnsComponent buildConcreteComponent() { - return new ApnsComponent(); - } - @Override - protected boolean setPropertyOnComponent( - Component component, - String name, - Object value) { - switch (name) { - case "apnsService": ((ApnsComponent) component).setApnsService((com.notnoop.apns.ApnsService) value); return true; - case "bridgeErrorHandler": ((ApnsComponent) component).setBridgeErrorHandler((boolean) value); return true; - case "lazyStartProducer": ((ApnsComponent) component).setLazyStartProducer((boolean) value); return true; - case "autowiredEnabled": ((ApnsComponent) component).setAutowiredEnabled((boolean) value); return true; - default: return false; - } - } - } -} \ No newline at end of file diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ApnsEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ApnsEndpointBuilderFactory.java deleted file mode 100644 index 1d7c1a2..0000000 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ApnsEndpointBuilderFactory.java +++ /dev/null @@ -1,917 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.builder.endpoint.dsl; - -import java.util.Map; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; -import org.apache.camel.ExchangePattern; -import org.apache.camel.LoggingLevel; -import org.apache.camel.builder.EndpointConsumerBuilder; -import org.apache.camel.builder.EndpointProducerBuilder; -import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; -import org.apache.camel.spi.ExceptionHandler; -import org.apache.camel.spi.PollingConsumerPollStrategy; - -/** - * Send notifications to Apple iOS devices. - * - * Generated by camel build tools - do NOT edit this file! - */ -@Generated("org.apache.camel.maven.packaging.EndpointDslMojo") -public interface ApnsEndpointBuilderFactory { - - - /** - * Builder for endpoint consumers for the APNS component. - */ - public interface ApnsEndpointConsumerBuilder - extends - EndpointConsumerBuilder { - default AdvancedApnsEndpointConsumerBuilder advanced() { - return (AdvancedApnsEndpointConsumerBuilder) this; - } - /** - * Configure this property in case you want to statically declare tokens - * related to devices you want to notify. Tokens are separated by comma. - * - * The option is a: <code>java.lang.String</code> type. - * - * Group: common - * - * @param tokens the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder tokens(String tokens) { - doSetProperty("tokens", tokens); - return this; - } - /** - * 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 - * message and handled by the routing Error Handler. 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. - * - * The option is a: <code>boolean</code> type. - * - * Default: false - * Group: consumer - * - * @param bridgeErrorHandler the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder bridgeErrorHandler( - boolean bridgeErrorHandler) { - doSetProperty("bridgeErrorHandler", bridgeErrorHandler); - return this; - } - /** - * 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 - * message and handled by the routing Error Handler. 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. - * - * The option will be converted to a <code>boolean</code> - * type. - * - * Default: false - * Group: consumer - * - * @param bridgeErrorHandler the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder bridgeErrorHandler( - String bridgeErrorHandler) { - doSetProperty("bridgeErrorHandler", bridgeErrorHandler); - 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: <code>boolean</code> type. - * - * Default: false - * Group: consumer - * - * @param sendEmptyMessageWhenIdle the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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 <code>boolean</code> - * type. - * - * Default: false - * Group: consumer - * - * @param sendEmptyMessageWhenIdle the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder sendEmptyMessageWhenIdle( - String sendEmptyMessageWhenIdle) { - doSetProperty("sendEmptyMessageWhenIdle", sendEmptyMessageWhenIdle); - 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: <code>int</code> type. - * - * Group: scheduler - * - * @param backoffErrorThreshold the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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 <code>int</code> type. - * - * Group: scheduler - * - * @param backoffErrorThreshold the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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: <code>int</code> type. - * - * Group: scheduler - * - * @param backoffIdleThreshold the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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 <code>int</code> type. - * - * Group: scheduler - * - * @param backoffIdleThreshold the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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: <code>int</code> type. - * - * Group: scheduler - * - * @param backoffMultiplier the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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 <code>int</code> type. - * - * Group: scheduler - * - * @param backoffMultiplier the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder backoffMultiplier( - String backoffMultiplier) { - doSetProperty("backoffMultiplier", backoffMultiplier); - return this; - } - /** - * Milliseconds before the next poll. - * - * The option is a: <code>long</code> type. - * - * Default: 500 - * Group: scheduler - * - * @param delay the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder delay(long delay) { - doSetProperty("delay", delay); - return this; - } - /** - * Milliseconds before the next poll. - * - * The option will be converted to a <code>long</code> type. - * - * Default: 500 - * Group: scheduler - * - * @param delay the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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: <code>boolean</code> type. - * - * Default: false - * Group: scheduler - * - * @param greedy the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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 <code>boolean</code> - * type. - * - * Default: false - * Group: scheduler - * - * @param greedy the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder greedy(String greedy) { - doSetProperty("greedy", greedy); - return this; - } - /** - * Milliseconds before the first poll starts. - * - * The option is a: <code>long</code> type. - * - * Default: 1000 - * Group: scheduler - * - * @param initialDelay the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder initialDelay(long initialDelay) { - doSetProperty("initialDelay", initialDelay); - return this; - } - /** - * Milliseconds before the first poll starts. - * - * The option will be converted to a <code>long</code> type. - * - * Default: 1000 - * Group: scheduler - * - * @param initialDelay the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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: <code>long</code> type. - * - * Default: 0 - * Group: scheduler - * - * @param repeatCount the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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 <code>long</code> type. - * - * Default: 0 - * Group: scheduler - * - * @param repeatCount the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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: - * <code>org.apache.camel.LoggingLevel</code> type. - * - * Default: TRACE - * Group: scheduler - * - * @param runLoggingLevel the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder runLoggingLevel( - 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 - * <code>org.apache.camel.LoggingLevel</code> type. - * - * Default: TRACE - * Group: scheduler - * - * @param runLoggingLevel the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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: - * <code>java.util.concurrent.ScheduledExecutorService</code> type. - * - * Group: scheduler - * - * @param scheduledExecutorService the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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 - * <code>java.util.concurrent.ScheduledExecutorService</code> type. - * - * Group: scheduler - * - * @param scheduledExecutorService the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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: <code>java.lang.Object</code> type. - * - * Default: none - * Group: scheduler - * - * @param scheduler the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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 - * <code>java.lang.Object</code> type. - * - * Default: none - * Group: scheduler - * - * @param scheduler the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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: <code>java.util.Map&lt;java.lang.String, - * java.lang.Object&gt;</code> 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 ApnsEndpointConsumerBuilder 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: <code>java.util.Map&lt;java.lang.String, - * java.lang.Object&gt;</code> 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 ApnsEndpointConsumerBuilder schedulerProperties(Map values) { - doSetMultiValueProperties("schedulerProperties", "scheduler.", values); - return this; - } - /** - * Whether the scheduler should be auto started. - * - * The option is a: <code>boolean</code> type. - * - * Default: true - * Group: scheduler - * - * @param startScheduler the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder startScheduler( - boolean startScheduler) { - doSetProperty("startScheduler", startScheduler); - return this; - } - /** - * Whether the scheduler should be auto started. - * - * The option will be converted to a <code>boolean</code> - * type. - * - * Default: true - * Group: scheduler - * - * @param startScheduler the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder startScheduler(String startScheduler) { - doSetProperty("startScheduler", startScheduler); - return this; - } - /** - * Time unit for initialDelay and delay options. - * - * The option is a: - * <code>java.util.concurrent.TimeUnit</code> type. - * - * Default: MILLISECONDS - * Group: scheduler - * - * @param timeUnit the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder timeUnit(TimeUnit timeUnit) { - doSetProperty("timeUnit", timeUnit); - return this; - } - /** - * Time unit for initialDelay and delay options. - * - * The option will be converted to a - * <code>java.util.concurrent.TimeUnit</code> type. - * - * Default: MILLISECONDS - * Group: scheduler - * - * @param timeUnit the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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: <code>boolean</code> type. - * - * Default: true - * Group: scheduler - * - * @param useFixedDelay the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder 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 <code>boolean</code> - * type. - * - * Default: true - * Group: scheduler - * - * @param useFixedDelay the value to set - * @return the dsl builder - */ - default ApnsEndpointConsumerBuilder useFixedDelay(String useFixedDelay) { - doSetProperty("useFixedDelay", useFixedDelay); - return this; - } - } - - /** - * Advanced builder for endpoint consumers for the APNS component. - */ - public interface AdvancedApnsEndpointConsumerBuilder - extends - EndpointConsumerBuilder { - default ApnsEndpointConsumerBuilder basic() { - return (ApnsEndpointConsumerBuilder) this; - } - /** - * 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. - * - * The option is a: - * <code>org.apache.camel.spi.ExceptionHandler</code> type. - * - * Group: consumer (advanced) - * - * @param exceptionHandler the value to set - * @return the dsl builder - */ - default AdvancedApnsEndpointConsumerBuilder exceptionHandler( - ExceptionHandler exceptionHandler) { - doSetProperty("exceptionHandler", exceptionHandler); - return this; - } - /** - * 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. - * - * The option will be converted to a - * <code>org.apache.camel.spi.ExceptionHandler</code> type. - * - * Group: consumer (advanced) - * - * @param exceptionHandler the value to set - * @return the dsl builder - */ - default AdvancedApnsEndpointConsumerBuilder exceptionHandler( - String exceptionHandler) { - doSetProperty("exceptionHandler", exceptionHandler); - return this; - } - /** - * Sets the exchange pattern when the consumer creates an exchange. - * - * The option is a: - * <code>org.apache.camel.ExchangePattern</code> type. - * - * Group: consumer (advanced) - * - * @param exchangePattern the value to set - * @return the dsl builder - */ - default AdvancedApnsEndpointConsumerBuilder exchangePattern( - ExchangePattern exchangePattern) { - doSetProperty("exchangePattern", exchangePattern); - return this; - } - /** - * Sets the exchange pattern when the consumer creates an exchange. - * - * The option will be converted to a - * <code>org.apache.camel.ExchangePattern</code> type. - * - * Group: consumer (advanced) - * - * @param exchangePattern the value to set - * @return the dsl builder - */ - default AdvancedApnsEndpointConsumerBuilder exchangePattern( - String exchangePattern) { - 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: - * <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type. - * - * Group: consumer (advanced) - * - * @param pollStrategy the value to set - * @return the dsl builder - */ - default AdvancedApnsEndpointConsumerBuilder pollStrategy( - 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 - * <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type. - * - * Group: consumer (advanced) - * - * @param pollStrategy the value to set - * @return the dsl builder - */ - default AdvancedApnsEndpointConsumerBuilder pollStrategy( - String pollStrategy) { - doSetProperty("pollStrategy", pollStrategy); - return this; - } - } - - /** - * Builder for endpoint producers for the APNS component. - */ - public interface ApnsEndpointProducerBuilder - extends - EndpointProducerBuilder { - default AdvancedApnsEndpointProducerBuilder advanced() { - return (AdvancedApnsEndpointProducerBuilder) this; - } - /** - * Configure this property in case you want to statically declare tokens - * related to devices you want to notify. Tokens are separated by comma. - * - * The option is a: <code>java.lang.String</code> type. - * - * Group: common - * - * @param tokens the value to set - * @return the dsl builder - */ - default ApnsEndpointProducerBuilder tokens(String tokens) { - doSetProperty("tokens", tokens); - return this; - } - /** - * 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. - * - * The option is a: <code>boolean</code> type. - * - * Default: false - * Group: producer - * - * @param lazyStartProducer the value to set - * @return the dsl builder - */ - default ApnsEndpointProducerBuilder lazyStartProducer( - boolean lazyStartProducer) { - doSetProperty("lazyStartProducer", lazyStartProducer); - return this; - } - /** - * 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. - * - * The option will be converted to a <code>boolean</code> - * type. - * - * Default: false - * Group: producer - * - * @param lazyStartProducer the value to set - * @return the dsl builder - */ - default ApnsEndpointProducerBuilder lazyStartProducer( - String lazyStartProducer) { - doSetProperty("lazyStartProducer", lazyStartProducer); - return this; - } - } - - /** - * Advanced builder for endpoint producers for the APNS component. - */ - public interface AdvancedApnsEndpointProducerBuilder - extends - EndpointProducerBuilder { - default ApnsEndpointProducerBuilder basic() { - return (ApnsEndpointProducerBuilder) this; - } - } - - /** - * Builder for endpoint for the APNS component. - */ - public interface ApnsEndpointBuilder - extends - ApnsEndpointConsumerBuilder, - ApnsEndpointProducerBuilder { - default AdvancedApnsEndpointBuilder advanced() { - return (AdvancedApnsEndpointBuilder) this; - } - /** - * Configure this property in case you want to statically declare tokens - * related to devices you want to notify. Tokens are separated by comma. - * - * The option is a: <code>java.lang.String</code> type. - * - * Group: common - * - * @param tokens the value to set - * @return the dsl builder - */ - default ApnsEndpointBuilder tokens(String tokens) { - doSetProperty("tokens", tokens); - return this; - } - } - - /** - * Advanced builder for endpoint for the APNS component. - */ - public interface AdvancedApnsEndpointBuilder - extends - AdvancedApnsEndpointConsumerBuilder, - AdvancedApnsEndpointProducerBuilder { - default ApnsEndpointBuilder basic() { - return (ApnsEndpointBuilder) this; - } - } - - public interface ApnsBuilders { - /** - * APNS (camel-apns) - * Send notifications to Apple iOS devices. - * - * Category: eventbus,mobile - * Since: 2.8 - * Maven coordinates: org.apache.camel:camel-apns - * - * Syntax: <code>apns:name</code> - * - * Path parameter: name - * Name of the endpoint - * - * @param path name - * @return the dsl builder - */ - @Deprecated - default ApnsEndpointBuilder apns(String path) { - return ApnsEndpointBuilderFactory.endpointBuilder("apns", path); - } - /** - * APNS (camel-apns) - * Send notifications to Apple iOS devices. - * - * Category: eventbus,mobile - * Since: 2.8 - * Maven coordinates: org.apache.camel:camel-apns - * - * Syntax: <code>apns:name</code> - * - * Path parameter: name - * Name of the endpoint - * - * @param componentName to use a custom component name for the endpoint - * instead of the default name - * @param path name - * @return the dsl builder - */ - @Deprecated - default ApnsEndpointBuilder apns(String componentName, String path) { - return ApnsEndpointBuilderFactory.endpointBuilder(componentName, path); - } - } - @Deprecated - static ApnsEndpointBuilder endpointBuilder(String componentName, String path) { - class ApnsEndpointBuilderImpl extends AbstractEndpointBuilder implements ApnsEndpointBuilder, AdvancedApnsEndpointBuilder { - public ApnsEndpointBuilderImpl(String path) { - super(componentName, path); - } - } - return new ApnsEndpointBuilderImpl(path); - } -} \ No newline at end of file diff --git a/docs/components/modules/ROOT/pages/apns-component.adoc b/docs/components/modules/ROOT/pages/apns-component.adoc deleted file mode 100644 index 62c1825..0000000 --- a/docs/components/modules/ROOT/pages/apns-component.adoc +++ /dev/null @@ -1,325 +0,0 @@ -[[apns-component]] -= APNS Component (deprecated) -//THIS FILE IS COPIED: EDIT THE SOURCE FILE: -:page-source: components/camel-apns/src/main/docs/apns-component.adoc -:docTitle: APNS -:artifactId: camel-apns -:description: Send notifications to Apple iOS devices. -:since: 2.8 -:supportLevel: Stable-deprecated -:deprecated: *deprecated* -:component-header: Both producer and consumer are supported -include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/apns.adoc[opts=optional] - -*Since Camel {since}* - -*{component-header}* - -The APNS component is used for sending notifications to iOS devices. -The APNS components use https://github.com/notnoop/java-apns[javapns] -library. + - The component supports sending notifications to Apple Push Notification -Servers (APNS) and consuming feedback from the servers. - -The consumer is configured with 3600 seconds for polling by default -because it is a best practice to consume feedback stream from Apple Push -Notification Servers only from time to time. For example: every 1 hour -to avoid flooding the servers. - -The feedback stream gives informations about inactive devices. You only -need to get this informations every some hours if your mobile -application is not a heavily used one. - -Maven users will need to add the following dependency to their `pom.xml` -for this component: - -[source,xml] ------------------------------------------------------------- -<dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-apns</artifactId> - <version>x.x.x</version> - <!-- use the same version as your Camel core version --> -</dependency> ------------------------------------------------------------- - -== URI format - -To send notifications: - -[source,java] ---------------------- -apns:notify[?options] ---------------------- - -To consume feedback: - -[source,java] ------------------------ -apns:consumer[?options] ------------------------ - -== Options - - - -// component options: START -The APNS component supports 4 options, which are listed below. - - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *apnsService* (common) | *Required* The ApnsService to use. The org.apache.camel.component.apns.factory.ApnsServiceFactory can be used to build a ApnsService | | ApnsService -| *bridgeErrorHandler* (consumer) | 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 message and handled by the routing Error Handler. 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. | false | boolean -| *lazyStartProducer* (producer) | 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 [...] -| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean -|=== -// component options: END - - - - -// endpoint options: START -The APNS endpoint is configured using URI syntax: - ----- -apns:name ----- - -with the following path and query parameters: - -=== Path Parameters (1 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *name* | Name of the endpoint | | String -|=== - - -=== Query Parameters (21 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *tokens* (common) | Configure this property in case you want to statically declare tokens related to devices you want to notify. Tokens are separated by comma. | | String -| *bridgeErrorHandler* (consumer) | 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 message and handled by the routing Error Handler. 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. | false | boolean -| *sendEmptyMessageWhenIdle* (consumer) | If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. | false | boolean -| *exceptionHandler* (consumer) | 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. | | ExceptionHandler -| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. There are 3 enums and the value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern -| *pollStrategy* (consumer) | 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. | | PollingConsumerPollStrategy -| *lazyStartProducer* (producer) | 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 [...] -| *backoffErrorThreshold* (scheduler) | The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in. | | int -| *backoffIdleThreshold* (scheduler) | The number of subsequent idle polls that should happen before the backoffMultipler should kick-in. | | int -| *backoffMultiplier* (scheduler) | 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. | | int -| *delay* (scheduler) | Milliseconds before the next poll. | 500 | long -| *greedy* (scheduler) | If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages. | false | boolean -| *initialDelay* (scheduler) | Milliseconds before the first poll starts. | 1000 | long -| *repeatCount* (scheduler) | 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. | 0 | long -| *runLoggingLevel* (scheduler) | The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that. There are 6 enums and the value can be one of: TRACE, DEBUG, INFO, WARN, ERROR, OFF | TRACE | LoggingLevel -| *scheduledExecutorService* (scheduler) | Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool. | | ScheduledExecutorService -| *scheduler* (scheduler) | To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler | none | Object -| *schedulerProperties* (scheduler) | To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler. | | Map -| *startScheduler* (scheduler) | Whether the scheduler should be auto started. | true | boolean -| *timeUnit* (scheduler) | Time unit for initialDelay and delay options. There are 7 enums and the value can be one of: NANOSECONDS, MICROSECONDS, MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS | MILLISECONDS | TimeUnit -| *useFixedDelay* (scheduler) | Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details. | true | boolean -|=== -// endpoint options: END - - - -You can append query options to the URI in the following format, -`?option=value&option=value&...` - -=== Component - -The `ApnsComponent` must be configured with a -`com.notnoop.apns.ApnsService`. The service can be created and -configured using the -`org.apache.camel.component.apns.factory.ApnsServiceFactory`. See -further below for an example. And as well in the -https://github.com/apache/camel/tree/main/components/camel-apns[test -source code]. - -==== SSL Setting -In order to use secure connection, an instance of `org.apache.camel.support.jsse.SSLContextParameters` - should be injected to `org.apache.camel.component.apns.factory.ApnsServiceFactory` which is - used to configure the component. See the test resources for an example. - https://github.com/apache/camel/blob/main/components/camel-apns/src/test/resources/org/apache/camel/component/apns/spring/SpringApnsConsumerTest-context.xml[ssl example] - -== Exchange data format - -When Camel will fetch feedback data corresponding to inactive devices, -it will retrieve a List of InactiveDevice objects. Each InactiveDevice -object of the retrieved list will be setted as the In body, and then -processed by the consumer endpoint. - -== Message Headers - -Camel Apns uses these headers. - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Property |Default |Description -|`CamelApnsTokens` | |Empty by default. -|`CamelApnsMessageType` |`STRING, PAYLOAD, APNS_NOTIFICATION` |In case you choose PAYLOAD for the message type, then the message will -be considered as a APNS payload and sent as is. In case you choose -STRING, message will be converted as a APNS payload. From *Camel 2.16* -onwards APNS_NOTIFICATION is used for sending message body as -com.notnoop.apns.ApnsNotification types. -|======================================================================= - -== ApnsServiceFactory builder callback - -`ApnsServiceFactory` comes with the empty callback method that could be -used to configure (or even replace) the default `ApnsServiceBuilder` -instance. The signature of the method could look as follows: - -[source,java] ----------------------------------------------------------------------------------------- -protected ApnsServiceBuilder configureServiceBuilder(ApnsServiceBuilder serviceBuilder); ----------------------------------------------------------------------------------------- - -And could be used like as follows: - -[source,java] -------------------------------------------------------------------------------------------- -ApnsServiceFactory proxiedApnsServiceFactory = new ApnsServiceFactory(){ - - @Override - protected ApnsServiceBuilder configureServiceBuilder(ApnsServiceBuilder serviceBuilder) { - return serviceBuilder.withSocksProxy("my.proxy.com", 6666); - } - -}; -------------------------------------------------------------------------------------------- - -== Samples - -=== Camel Xml route - -[source,xml] --------------------------------------------------------------------------------------------------------------------------------------------------------------------- -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:camel="http://camel.apache.org/schema/spring" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - <!-- Replace by desired values --> - <bean id="apnsServiceFactory" class="org.apache.camel.component.apns.factory.ApnsServiceFactory"> - - <!-- Optional configuration of feedback host and port --> - <!-- <property name="feedbackHost" value="localhost" /> --> - <!-- <property name="feedbackPort" value="7843" /> --> - - <!-- Optional configuration of gateway host and port --> - <!-- <property name="gatewayHost" value="localhost" /> --> - <!-- <property name="gatewayPort" value="7654" /> --> - - <!-- Declaration of certificate used --> - <!-- from Camel 2.11 onwards you can use prefix: classpath:, file: to refer to load the certificate from classpath or file. Default it classpath --> - <property name="certificatePath" value="certificate.p12" /> - <property name="certificatePassword" value="MyCertPassword" /> - - <!-- Optional connection strategy - By Default: No need to configure --> - <!-- Possible options: NON_BLOCKING, QUEUE, POOL or Nothing --> - <!-- <property name="connectionStrategy" value="POOL" /> --> - <!-- Optional pool size --> - <!-- <property name="poolSize" value="15" /> --> - - <!-- Optional connection strategy - By Default: No need to configure --> - <!-- Possible options: EVERY_HALF_HOUR, EVERY_NOTIFICATION or Nothing (Corresponds to NEVER javapns option) --> - <!-- <property name="reconnectionPolicy" value="EVERY_HALF_HOUR" /> --> - </bean> - - <bean id="apnsService" factory-bean="apnsServiceFactory" factory-method="getApnsService" /> - - <!-- Replace this declaration by wanted configuration --> - <bean id="apns" class="org.apache.camel.component.apns.ApnsComponent"> - <property name="apnsService" ref="apnsService" /> - </bean> - - <camelContext id="camel-apns-test" xmlns="http://camel.apache.org/schema/spring"> - <route id="apns-test"> - <from uri="apns:consumer?initialDelay=10&delay=3600&timeUnit=SECONDS" /> - <to uri="log:org.apache.camel.component.apns?showAll=true&multiline=true" /> - <to uri="mock:result" /> - </route> - </camelContext> - -</beans> --------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -=== Camel Java route - -[[APNS-Createcamelcontextanddeclareapnscomponentprogrammatically]] -Create camel context and declare apns component programmatically - -[source,java] ----------------------------------------------------------------------------------- - protected CamelContext createCamelContext() throws Exception { - CamelContext camelContext = super.createCamelContext(); - - ApnsServiceFactory apnsServiceFactory = new ApnsServiceFactory(); - apnsServiceFactory.setCertificatePath("classpath:/certificate.p12"); - apnsServiceFactory.setCertificatePassword("MyCertPassword"); - - ApnsService apnsService = apnsServiceFactory.getApnsService(camelContext); - - ApnsComponent apnsComponent = new ApnsComponent(apnsService); - camelContext.addComponent("apns", apnsComponent); - - return camelContext; - } ----------------------------------------------------------------------------------- - -[[APNS-ApnsProducer-iOStargetdevicedynamicallyconfiguredviaheader:CamelApnsTokens]] -ApnsProducer - iOS target device dynamically configured via header: -`"CamelApnsTokens"` - -[source,java] ---------------------------------------------------------------------------------------- - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - public void configure() throws Exception { - from("direct:test") - .setHeader(ApnsConstants.HEADER_TOKENS, constant(IOS_DEVICE_TOKEN)) - .to("apns:notify"); - } - } - } ---------------------------------------------------------------------------------------- - -[[APNS-ApnsProducer-iOStargetdevicestaticallyconfiguredviauri]] -ApnsProducer - iOS target device statically configured via uri - -[source,java] ------------------------------------------------------------------- - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - public void configure() throws Exception { - from("direct:test"). - to("apns:notify?tokens=" + IOS_DEVICE_TOKEN); - } - }; - } ------------------------------------------------------------------- - -[[APNS-ApnsConsumer]] -ApnsConsumer - -[source,java] --------------------------------------------------------------------------- -from("apns:consumer?initialDelay=10&delay=3600&timeUnit=SECONDS") - .to("log:com.apache.camel.component.apns?showAll=true&multiline=true") - .to("mock:result"); --------------------------------------------------------------------------- - - -include::{page-component-version}@camel-spring-boot::page$apns-starter.adoc[]
