001/**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.camel.model;
018
019import javax.xml.bind.annotation.XmlAccessType;
020import javax.xml.bind.annotation.XmlAccessorType;
021import javax.xml.bind.annotation.XmlAttribute;
022import javax.xml.bind.annotation.XmlRootElement;
023
024import org.apache.camel.CamelContext;
025import org.apache.camel.LoggingLevel;
026import org.apache.camel.processor.RedeliveryPolicy;
027import org.apache.camel.spi.Metadata;
028import org.apache.camel.util.CamelContextHelper;
029import org.apache.camel.util.ObjectHelper;
030
031/**
032 * To configure re-delivery for error handling
033 *
034 * @version 
035 */
036@Metadata(label = "configuration")
037@XmlRootElement(name = "redeliveryPolicy")
038@XmlAccessorType(XmlAccessType.FIELD)
039public class RedeliveryPolicyDefinition {
040    @XmlAttribute
041    private String maximumRedeliveries;
042    @XmlAttribute
043    private String redeliveryDelay;
044    @XmlAttribute
045    private String asyncDelayedRedelivery;
046    @XmlAttribute
047    private String backOffMultiplier;
048    @XmlAttribute
049    private String useExponentialBackOff;
050    @XmlAttribute
051    private String collisionAvoidanceFactor;
052    @XmlAttribute
053    private String useCollisionAvoidance;
054    @XmlAttribute
055    private String maximumRedeliveryDelay;
056    @XmlAttribute
057    private LoggingLevel retriesExhaustedLogLevel;
058    @XmlAttribute
059    private LoggingLevel retryAttemptedLogLevel;
060    @XmlAttribute
061    private String retryAttemptedLogInterval;
062    @XmlAttribute
063    private String logRetryAttempted;
064    @XmlAttribute
065    private String logStackTrace;
066    @XmlAttribute
067    private String logRetryStackTrace;
068    @XmlAttribute
069    private String logHandled;
070    @XmlAttribute
071    private String logNewException;
072    @XmlAttribute
073    private String logContinued;
074    @XmlAttribute
075    private String logExhausted;
076    @XmlAttribute
077    private String logExhaustedMessageHistory;
078    @XmlAttribute
079    private String logExhaustedMessageBody;
080    @XmlAttribute
081    private String disableRedelivery;
082    @XmlAttribute
083    private String delayPattern;
084    @XmlAttribute
085    private String allowRedeliveryWhileStopping;
086    @XmlAttribute
087    private String exchangeFormatterRef;
088
089    public RedeliveryPolicy createRedeliveryPolicy(CamelContext context, RedeliveryPolicy parentPolicy) {
090
091        RedeliveryPolicy answer;
092        if (parentPolicy != null) {
093            answer = parentPolicy.copy();
094        } else {
095            answer = new RedeliveryPolicy();
096        }
097
098        try {
099
100            // copy across the properties - if they are set
101            if (maximumRedeliveries != null) {
102                answer.setMaximumRedeliveries(CamelContextHelper.parseInteger(context, maximumRedeliveries));
103            }
104            if (redeliveryDelay != null) {
105                answer.setRedeliveryDelay(CamelContextHelper.parseLong(context, redeliveryDelay));
106            }
107            if (asyncDelayedRedelivery != null) {
108                if (CamelContextHelper.parseBoolean(context, asyncDelayedRedelivery)) {
109                    answer.asyncDelayedRedelivery();
110                }
111            }
112            if (retriesExhaustedLogLevel != null) {
113                answer.setRetriesExhaustedLogLevel(retriesExhaustedLogLevel);
114            }
115            if (retryAttemptedLogLevel != null) {
116                answer.setRetryAttemptedLogLevel(retryAttemptedLogLevel);
117            }
118            if (retryAttemptedLogInterval != null) {
119                answer.setRetryAttemptedLogInterval(CamelContextHelper.parseInteger(context, retryAttemptedLogInterval));
120            }
121            if (backOffMultiplier != null) {
122                answer.setBackOffMultiplier(CamelContextHelper.parseDouble(context, backOffMultiplier));
123            }
124            if (useExponentialBackOff != null) {
125                answer.setUseExponentialBackOff(CamelContextHelper.parseBoolean(context, useExponentialBackOff));
126            }
127            if (collisionAvoidanceFactor != null) {
128                answer.setCollisionAvoidanceFactor(CamelContextHelper.parseDouble(context, collisionAvoidanceFactor));
129            }
130            if (useCollisionAvoidance != null) {
131                answer.setUseCollisionAvoidance(CamelContextHelper.parseBoolean(context, useCollisionAvoidance));
132            }
133            if (maximumRedeliveryDelay != null) {
134                answer.setMaximumRedeliveryDelay(CamelContextHelper.parseLong(context, maximumRedeliveryDelay));
135            }
136            if (logStackTrace != null) {
137                answer.setLogStackTrace(CamelContextHelper.parseBoolean(context, logStackTrace));
138            }
139            if (logRetryStackTrace != null) {
140                answer.setLogRetryStackTrace(CamelContextHelper.parseBoolean(context, logRetryStackTrace));
141            }
142            if (logHandled != null) {
143                answer.setLogHandled(CamelContextHelper.parseBoolean(context, logHandled));
144            }
145            if (logNewException != null) {
146                answer.setLogNewException(CamelContextHelper.parseBoolean(context, logNewException));
147            }
148            if (logContinued != null) {
149                answer.setLogContinued(CamelContextHelper.parseBoolean(context, logContinued));
150            }
151            if (logRetryAttempted != null) {
152                answer.setLogRetryAttempted(CamelContextHelper.parseBoolean(context, logRetryAttempted));
153            }
154            if (logExhausted != null) {
155                answer.setLogExhausted(CamelContextHelper.parseBoolean(context, logExhausted));
156            }
157            if (logExhaustedMessageHistory != null) {
158                answer.setLogExhaustedMessageHistory(CamelContextHelper.parseBoolean(context, logExhaustedMessageHistory));
159            }
160            if (logExhaustedMessageBody != null) {
161                answer.setLogExhaustedMessageBody(CamelContextHelper.parseBoolean(context, logExhaustedMessageBody));
162            }
163            if (disableRedelivery != null) {
164                if (CamelContextHelper.parseBoolean(context, disableRedelivery)) {
165                    answer.setMaximumRedeliveries(0);
166                }
167            }
168            if (delayPattern != null) {
169                answer.setDelayPattern(CamelContextHelper.parseText(context, delayPattern));
170            }
171            if (allowRedeliveryWhileStopping != null) {
172                answer.setAllowRedeliveryWhileStopping(CamelContextHelper.parseBoolean(context, allowRedeliveryWhileStopping));
173            }
174            if (exchangeFormatterRef != null) {
175                answer.setExchangeFormatterRef(CamelContextHelper.parseText(context, exchangeFormatterRef));
176            }
177        } catch (Exception e) {
178            throw ObjectHelper.wrapRuntimeCamelException(e);
179        }
180
181        return answer;
182    }
183
184    @Override
185    public String toString() {
186        return "RedeliveryPolicy[maximumRedeliveries: " + maximumRedeliveries + "]";
187    }
188    
189    // Fluent API
190    //-------------------------------------------------------------------------
191
192    /**
193     * Allow synchronous delayed redelivery. The route, in particular the consumer's component,
194     * must support the Asynchronous Routing Engine (e.g. seda).
195     *
196     * @return the builder
197     */
198    public RedeliveryPolicyDefinition asyncDelayedRedelivery() {
199        setAsyncDelayedRedelivery("true");
200        return this;
201    }
202
203    /**
204     * Controls whether to allow redelivery while stopping/shutting down a route that uses error handling.
205     *
206     * @param allowRedeliveryWhileStopping <tt>true</tt> to allow redelivery, <tt>false</tt> to reject redeliveries
207     * @return the builder
208     */
209    public RedeliveryPolicyDefinition allowRedeliveryWhileStopping(boolean allowRedeliveryWhileStopping) {
210        return allowRedeliveryWhileStopping(Boolean.toString(allowRedeliveryWhileStopping));
211    }
212
213    /**
214     * Controls whether to allow redelivery while stopping/shutting down a route that uses error handling.
215     *
216     * @param allowRedeliveryWhileStopping <tt>true</tt> to allow redelivery, <tt>false</tt> to reject redeliveries
217     * @return the builder
218     */
219    public RedeliveryPolicyDefinition allowRedeliveryWhileStopping(String allowRedeliveryWhileStopping) {
220        setAllowRedeliveryWhileStopping(allowRedeliveryWhileStopping);
221        return this;
222    }
223
224    /**
225     * Sets the back off multiplier
226     *
227     * @param backOffMultiplier  the back off multiplier
228     * @return the builder
229     */
230    public RedeliveryPolicyDefinition backOffMultiplier(double backOffMultiplier) {
231        return backOffMultiplier(Double.toString(backOffMultiplier));
232    }
233
234    /**
235     * Sets the back off multiplier (supports property placeholders)
236     *
237     * @param backOffMultiplier  the back off multiplier
238     * @return the builder
239     */
240    public RedeliveryPolicyDefinition backOffMultiplier(String backOffMultiplier) {
241        setBackOffMultiplier(backOffMultiplier);
242        return this;
243    }
244
245    /**
246     * Sets the collision avoidance percentage
247     *
248     * @param collisionAvoidancePercent  the percentage
249     * @return the builder
250     */
251    public RedeliveryPolicyDefinition collisionAvoidancePercent(double collisionAvoidancePercent) {
252        setCollisionAvoidanceFactor(Double.toString(collisionAvoidancePercent * 0.01d));
253        return this;
254    }
255
256    /**
257     * Sets the collision avoidance factor
258     *
259     * @param collisionAvoidanceFactor  the factor
260     * @return the builder
261     */
262    public RedeliveryPolicyDefinition collisionAvoidanceFactor(double collisionAvoidanceFactor) {
263        return collisionAvoidanceFactor(Double.toString(collisionAvoidanceFactor));
264    }
265
266    /**
267     * Sets the collision avoidance factor (supports property placeholders)
268     *
269     * @param collisionAvoidanceFactor  the factor
270     * @return the builder
271     */
272    public RedeliveryPolicyDefinition collisionAvoidanceFactor(String collisionAvoidanceFactor) {
273        setCollisionAvoidanceFactor(collisionAvoidanceFactor);
274        return this;
275    }
276
277    /**
278     * Sets the initial redelivery delay
279     *
280     * @param delay  delay in millis
281     * @return the builder
282     */
283    public RedeliveryPolicyDefinition redeliveryDelay(long delay) {
284        return redeliveryDelay(Long.toString(delay));
285    }
286
287    /**
288     * Sets the initial redelivery delay (supports property placeholders)
289     *
290     * @param delay  delay in millis
291     * @return the builder
292     */
293    public RedeliveryPolicyDefinition redeliveryDelay(String delay) {
294        setRedeliveryDelay(delay);
295        return this;
296    }
297
298    /**
299     * Sets the logging level to use when retries has exhausted
300     *
301     * @param retriesExhaustedLogLevel  the logging level
302     * @return the builder
303     */
304    public RedeliveryPolicyDefinition retriesExhaustedLogLevel(LoggingLevel retriesExhaustedLogLevel) {
305        setRetriesExhaustedLogLevel(retriesExhaustedLogLevel);
306        return this;
307    }    
308    
309    /**
310     * Sets the logging level to use for logging retry attempts
311     *
312     * @param retryAttemptedLogLevel  the logging level
313     * @return the builder
314     */
315    public RedeliveryPolicyDefinition retryAttemptedLogLevel(LoggingLevel retryAttemptedLogLevel) {
316        setRetryAttemptedLogLevel(retryAttemptedLogLevel);
317        return this;
318    }
319
320    /**
321     * Sets the interval to use for logging retry attempts
322     *
323     * @param retryAttemptedLogInterval  the retry logging interval
324     * @return the builder
325     */
326    public RedeliveryPolicyDefinition retryAttemptedLogInterval(String retryAttemptedLogInterval) {
327        setRetryAttemptedLogInterval(retryAttemptedLogInterval);
328        return this;
329    }
330
331    /**
332     * Sets whether stack traces should be logged.
333     * Can be used to include or reduce verbose.
334     *
335     * @param logStackTrace  whether stack traces should be logged or not
336     * @return the builder
337     */
338    public RedeliveryPolicyDefinition logStackTrace(boolean logStackTrace) {
339        return logStackTrace(Boolean.toString(logStackTrace));
340    }
341
342    /**
343     * Sets whether stack traces should be logged (supports property placeholders)
344     * Can be used to include or reduce verbose.
345     *
346     * @param logStackTrace  whether stack traces should be logged or not
347     * @return the builder
348     */
349    public RedeliveryPolicyDefinition logStackTrace(String logStackTrace) {
350        setLogStackTrace(logStackTrace);
351        return this;
352    }
353
354    /**
355     * Sets whether stack traces should be logged when an retry attempt failed.
356     * Can be used to include or reduce verbose.
357     *
358     * @param logRetryStackTrace  whether stack traces should be logged or not
359     * @return the builder
360     */
361    public RedeliveryPolicyDefinition logRetryStackTrace(boolean logRetryStackTrace) {
362        return logRetryStackTrace(Boolean.toString(logRetryStackTrace));
363    }
364
365    /**
366     * Sets whether stack traces should be logged when an retry attempt failed (supports property placeholders).
367     * Can be used to include or reduce verbose.
368     *
369     * @param logRetryStackTrace  whether stack traces should be logged or not
370     * @return the builder
371     */
372    public RedeliveryPolicyDefinition logRetryStackTrace(String logRetryStackTrace) {
373        setLogRetryStackTrace(logRetryStackTrace);
374        return this;
375    }
376
377    /**
378     * Sets whether retry attempts should be logged or not.
379     * Can be used to include or reduce verbose.
380     *
381     * @param logRetryAttempted  whether retry attempts should be logged or not
382     * @return the builder
383     */
384    public RedeliveryPolicyDefinition logRetryAttempted(boolean logRetryAttempted) {
385        return logRetryAttempted(Boolean.toString(logRetryAttempted));
386    }
387
388    /**
389     * Sets whether retry attempts should be logged or not (supports property placeholders).
390     * Can be used to include or reduce verbose.
391     *
392     * @param logRetryAttempted  whether retry attempts should be logged or not
393     * @return the builder
394     */
395    public RedeliveryPolicyDefinition logRetryAttempted(String logRetryAttempted) {
396        setLogRetryAttempted(logRetryAttempted);
397        return this;
398    }
399
400    /**
401     * Sets whether handled exceptions should be logged or not.
402     * Can be used to include or reduce verbose.
403     *
404     * @param logHandled  whether handled exceptions should be logged or not
405     * @return the builder
406     */
407    public RedeliveryPolicyDefinition logHandled(boolean logHandled) {
408        return logHandled(Boolean.toString(logHandled));
409    }
410
411    /**
412     * Sets whether handled exceptions should be logged or not (supports property placeholders).
413     * Can be used to include or reduce verbose.
414     *
415     * @param logHandled  whether handled exceptions should be logged or not
416     * @return the builder
417     */
418    public RedeliveryPolicyDefinition logHandled(String logHandled) {
419        setLogHandled(logHandled);
420        return this;
421    }
422
423    /**
424     * Sets whether new exceptions should be logged or not.
425     * Can be used to include or reduce verbose.
426     * <p/>
427     * A new exception is an exception that was thrown while handling a previous exception.
428     *
429     * @param logNewException  whether new exceptions should be logged or not
430     * @return the builder
431     */
432    public RedeliveryPolicyDefinition logNewException(boolean logNewException) {
433        return logNewException(Boolean.toString(logNewException));
434    }
435
436    /**
437     * Sets whether new exceptions should be logged or not (supports property placeholders).
438     * Can be used to include or reduce verbose.
439     * <p/>
440     * A new exception is an exception that was thrown while handling a previous exception.
441     *
442     * @param logNewException  whether new exceptions should be logged or not
443     * @return the builder
444     */
445    public RedeliveryPolicyDefinition logNewException(String logNewException) {
446        setLogNewException(logNewException);
447        return this;
448    }
449
450    /**
451     * Sets whether continued exceptions should be logged or not.
452     * Can be used to include or reduce verbose.
453     *
454     * @param logContinued  whether continued exceptions should be logged or not
455     * @return the builder
456     */
457    public RedeliveryPolicyDefinition logContinued(boolean logContinued) {
458        return logContinued(Boolean.toString(logContinued));
459    }
460
461    /**
462     * Sets whether continued exceptions should be logged or not (supports property placeholders).
463     * Can be used to include or reduce verbose.
464     *
465     * @param logContinued  whether continued exceptions should be logged or not
466     * @return the builder
467     */
468    public RedeliveryPolicyDefinition logContinued(String logContinued) {
469        setLogContinued(logContinued);
470        return this;
471    }
472
473    /**
474     * Sets whether exhausted exceptions should be logged or not.
475     * Can be used to include or reduce verbose.
476     *
477     * @param logExhausted  whether exhausted exceptions should be logged or not
478     * @return the builder
479     */
480    public RedeliveryPolicyDefinition logExhausted(boolean logExhausted) {
481        return logExhausted(Boolean.toString(logExhausted));
482    }
483
484    /**
485     * Sets whether exhausted exceptions should be logged or not (supports property placeholders).
486     * Can be used to include or reduce verbose.
487     *
488     * @param logExhausted  whether exhausted exceptions should be logged or not
489     * @return the builder
490     */
491    public RedeliveryPolicyDefinition logExhausted(String logExhausted) {
492        setLogExhausted(logExhausted);
493        return this;
494    }
495
496    /**
497     * Sets whether exhausted exceptions should be logged including message history or not (supports property placeholders).
498     * Can be used to include or reduce verbose.
499     *
500     * @param logExhaustedMessageHistory  whether exhausted exceptions should be logged with message history
501     * @return the builder
502     */
503    public RedeliveryPolicyDefinition logExhaustedMessageHistory(boolean logExhaustedMessageHistory) {
504        setLogExhaustedMessageHistory(Boolean.toString(logExhaustedMessageHistory));
505        return this;
506    }
507
508    /**
509     * Sets whether exhausted exceptions should be logged including message history or not (supports property placeholders).
510     * Can be used to include or reduce verbose.
511     *
512     * @param logExhaustedMessageHistory  whether exhausted exceptions should be logged with message history
513     * @return the builder
514     */
515    public RedeliveryPolicyDefinition logExhaustedMessageHistory(String logExhaustedMessageHistory) {
516        setLogExhaustedMessageHistory(logExhaustedMessageHistory);
517        return this;
518    }
519
520    /**
521     * Sets whether exhausted message body should be logged including message history or not (supports property placeholders).
522     * Can be used to include or reduce verbose. Requires <tt>logExhaustedMessageHistory</tt> to be enabled.
523     *
524     * @param logExhaustedMessageBody  whether exhausted message body should be logged with message history
525     * @return the builder
526     */
527    public RedeliveryPolicyDefinition logExhaustedMessageBody(boolean logExhaustedMessageBody) {
528        setLogExhaustedMessageBody(Boolean.toString(logExhaustedMessageBody));
529        return this;
530    }
531
532    /**
533     * Sets whether exhausted message body should be logged including message history or not (supports property placeholders).
534     * Can be used to include or reduce verbose. Requires <tt>logExhaustedMessageHistory</tt> to be enabled.
535     *
536     * @param logExhaustedMessageBody  whether exhausted message body should be logged with message history
537     * @return the builder
538     */
539    public RedeliveryPolicyDefinition logExhaustedMessageBody(String logExhaustedMessageBody) {
540        setLogExhaustedMessageBody(logExhaustedMessageBody);
541        return this;
542    }
543
544    /**
545     * Sets the maximum redeliveries
546     * <ul>
547     *   <li>x = redeliver at most x times</li>
548     *   <li>0 = no redeliveries</li>
549     *   <li>-1 = redeliver forever</li>
550     * </ul>
551     *
552     * @param maximumRedeliveries  the value
553     * @return the builder
554     */
555    public RedeliveryPolicyDefinition maximumRedeliveries(int maximumRedeliveries) {
556        return maximumRedeliveries(Integer.toString(maximumRedeliveries));
557    }
558
559    /**
560     * Sets the maximum redeliveries (supports property placeholders)
561     * <ul>
562     *   <li>x = redeliver at most x times</li>
563     *   <li>0 = no redeliveries</li>
564     *   <li>-1 = redeliver forever</li>
565     * </ul>
566     *
567     * @param maximumRedeliveries  the value
568     * @return the builder
569     */
570    public RedeliveryPolicyDefinition maximumRedeliveries(String maximumRedeliveries) {
571        setMaximumRedeliveries(maximumRedeliveries);
572        return this;
573    }
574
575    /**
576     * Turn on collision avoidance.
577     *
578     * @return the builder
579     */
580    public RedeliveryPolicyDefinition useCollisionAvoidance() {
581        setUseCollisionAvoidance("true");
582        return this;
583    }
584
585    /**
586     * Turn on exponential backk off
587     *
588     * @return the builder
589     */
590    public RedeliveryPolicyDefinition useExponentialBackOff() {
591        setUseExponentialBackOff("true");
592        return this;
593    }
594
595    /**
596     * Sets the maximum delay between redelivery
597     *
598     * @param maximumRedeliveryDelay  the delay in millis
599     * @return the builder
600     */
601    public RedeliveryPolicyDefinition maximumRedeliveryDelay(long maximumRedeliveryDelay) {
602        return maximumRedeliveryDelay(Long.toString(maximumRedeliveryDelay));
603    }
604
605    /**
606     * Sets the maximum delay between redelivery (supports property placeholders)
607     *
608     * @param maximumRedeliveryDelay  the delay in millis
609     * @return the builder
610     */
611    public RedeliveryPolicyDefinition maximumRedeliveryDelay(String maximumRedeliveryDelay) {
612        setMaximumRedeliveryDelay(maximumRedeliveryDelay);
613        return this;
614    }
615
616    /**
617     * Sets the delay pattern with delay intervals.
618     *
619     * @param delayPattern the delay pattern
620     * @return the builder
621     */
622    public RedeliveryPolicyDefinition delayPattern(String delayPattern) {
623        setDelayPattern(delayPattern);
624        return this;
625    }
626    
627    /**
628     * Sets the reference of the instance of {@link org.apache.camel.spi.ExchangeFormatter} to generate the log message from exchange.
629     *
630     * @param exchangeFormatterRef name of the instance of {@link org.apache.camel.spi.ExchangeFormatter}
631     * @return the builder
632     */
633    public RedeliveryPolicyDefinition exchangeFormatterRef(String exchangeFormatterRef) {
634        setExchangeFormatterRef(exchangeFormatterRef);
635        return this;
636    }
637
638    // Properties
639    //-------------------------------------------------------------------------
640
641    public String getMaximumRedeliveries() {
642        return maximumRedeliveries;
643    }
644
645    public void setMaximumRedeliveries(String maximumRedeliveries) {
646        this.maximumRedeliveries = maximumRedeliveries;
647    }
648
649    public String getRedeliveryDelay() {
650        return redeliveryDelay;
651    }
652
653    public void setRedeliveryDelay(String redeliveryDelay) {
654        this.redeliveryDelay = redeliveryDelay;
655    }
656
657    public String getAsyncDelayedRedelivery() {
658        return asyncDelayedRedelivery;
659    }
660
661    public boolean isAsyncDelayedRedelivery(CamelContext context) {
662        if (getAsyncDelayedRedelivery() == null) {
663            return false;
664        }
665
666        try {
667            return CamelContextHelper.parseBoolean(context, getAsyncDelayedRedelivery());
668        } catch (Exception e) {
669            throw ObjectHelper.wrapRuntimeCamelException(e);
670        }
671    }
672
673    public void setAsyncDelayedRedelivery(String asyncDelayedRedelivery) {
674        this.asyncDelayedRedelivery = asyncDelayedRedelivery;
675    }
676
677    public String getBackOffMultiplier() {
678        return backOffMultiplier;
679    }
680
681    public void setBackOffMultiplier(String backOffMultiplier) {
682        this.backOffMultiplier = backOffMultiplier;
683    }
684
685    public String getUseExponentialBackOff() {
686        return useExponentialBackOff;
687    }
688
689    public void setUseExponentialBackOff(String useExponentialBackOff) {
690        this.useExponentialBackOff = useExponentialBackOff;
691    }
692
693    public String getCollisionAvoidanceFactor() {
694        return collisionAvoidanceFactor;
695    }
696
697    public void setCollisionAvoidanceFactor(String collisionAvoidanceFactor) {
698        this.collisionAvoidanceFactor = collisionAvoidanceFactor;
699    }
700
701    public String getUseCollisionAvoidance() {
702        return useCollisionAvoidance;
703    }
704
705    public void setUseCollisionAvoidance(String useCollisionAvoidance) {
706        this.useCollisionAvoidance = useCollisionAvoidance;
707    }
708
709    public String getMaximumRedeliveryDelay() {
710        return maximumRedeliveryDelay;
711    }
712
713    public void setMaximumRedeliveryDelay(String maximumRedeliveryDelay) {
714        this.maximumRedeliveryDelay = maximumRedeliveryDelay;
715    }
716
717    public LoggingLevel getRetriesExhaustedLogLevel() {
718        return retriesExhaustedLogLevel;
719    }
720
721    public void setRetriesExhaustedLogLevel(LoggingLevel retriesExhaustedLogLevel) {
722        this.retriesExhaustedLogLevel = retriesExhaustedLogLevel;
723    }
724
725    public LoggingLevel getRetryAttemptedLogLevel() {
726        return retryAttemptedLogLevel;
727    }
728
729    public void setRetryAttemptedLogLevel(LoggingLevel retryAttemptedLogLevel) {
730        this.retryAttemptedLogLevel = retryAttemptedLogLevel;
731    }
732
733    public String getRetryAttemptedLogInterval() {
734        return retryAttemptedLogInterval;
735    }
736
737    public void setRetryAttemptedLogInterval(String retryAttemptedLogInterval) {
738        this.retryAttemptedLogInterval = retryAttemptedLogInterval;
739    }
740
741    public String getLogRetryAttempted() {
742        return logRetryAttempted;
743    }
744
745    public void setLogRetryAttempted(String logRetryAttempted) {
746        this.logRetryAttempted = logRetryAttempted;
747    }
748
749    public String getLogStackTrace() {
750        return logStackTrace;
751    }
752
753    public void setLogStackTrace(String logStackTrace) {
754        this.logStackTrace = logStackTrace;
755    }
756
757    public String getLogRetryStackTrace() {
758        return logRetryStackTrace;
759    }
760
761    public void setLogRetryStackTrace(String logRetryStackTrace) {
762        this.logRetryStackTrace = logRetryStackTrace;
763    }
764
765    public String getLogHandled() {
766        return logHandled;
767    }
768
769    public void setLogHandled(String logHandled) {
770        this.logHandled = logHandled;
771    }
772
773    public String getLogNewException() {
774        return logNewException;
775    }
776
777    public void setLogNewException(String logNewException) {
778        this.logNewException = logNewException;
779    }
780
781    public String getLogContinued() {
782        return logContinued;
783    }
784
785    public void setLogContinued(String logContinued) {
786        this.logContinued = logContinued;
787    }
788
789    public String getLogExhausted() {
790        return logExhausted;
791    }
792
793    public void setLogExhausted(String logExhausted) {
794        this.logExhausted = logExhausted;
795    }
796
797    public String getLogExhaustedMessageHistory() {
798        return logExhaustedMessageHistory;
799    }
800
801    public void setLogExhaustedMessageHistory(String logExhaustedMessageHistory) {
802        this.logExhaustedMessageHistory = logExhaustedMessageHistory;
803    }
804
805    public String getLogExhaustedMessageBody() {
806        return logExhaustedMessageBody;
807    }
808
809    public void setLogExhaustedMessageBody(String logExhaustedMessageBody) {
810        this.logExhaustedMessageBody = logExhaustedMessageBody;
811    }
812
813    public String getDisableRedelivery() {
814        return disableRedelivery;
815    }
816
817    /**
818     * Disables redelivery (same as setting maximum redeliveries to 0)
819     */
820    public void setDisableRedelivery(String disableRedelivery) {
821        this.disableRedelivery = disableRedelivery;
822    }
823
824    public String getDelayPattern() {
825        return delayPattern;
826    }
827
828    public void setDelayPattern(String delayPattern) {
829        this.delayPattern = delayPattern;
830    }
831
832    public String getAllowRedeliveryWhileStopping() {
833        return allowRedeliveryWhileStopping;
834    }
835
836    public void setAllowRedeliveryWhileStopping(String allowRedeliveryWhileStopping) {
837        this.allowRedeliveryWhileStopping = allowRedeliveryWhileStopping;
838    }
839    
840    public String getExchangeFormatterRef() {
841        return exchangeFormatterRef;
842    }
843    
844    public void setExchangeFormatterRef(String exchangeFormatterRef) {
845        this.exchangeFormatterRef = exchangeFormatterRef;
846    }
847    
848    
849}