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