/*
 * Copyright 2014-2017 Groupon, Inc
 * Copyright 2014-2017 The Billing Project, LLC
 *
 * The Billing Project 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.killbill.billing.invoice.plugin.api;

import java.util.Arrays;
import java.util.List;

import org.joda.time.Period;

public class InvoicePluginApiRetryException extends RuntimeException {

    public static final List<Period> DEFAULT_RETRY_SCHEDULE = Arrays.asList(Period.minutes(5),
                                                                            Period.minutes(15),
                                                                            Period.hours(1),
                                                                            Period.hours(6),
                                                                            Period.hours(24));

    private final List<Period> retrySchedule;

    public InvoicePluginApiRetryException() {
        this(null, null);
    }

    public InvoicePluginApiRetryException(final Exception e) {
        this(e, null);
    }

    public InvoicePluginApiRetryException(final List<Period> retrySchedule) {
        this(null, retrySchedule);
    }

    public InvoicePluginApiRetryException(final Exception e, final List<Period> retrySchedule) {
        super(e);
        this.retrySchedule = retrySchedule != null ? retrySchedule : DEFAULT_RETRY_SCHEDULE;
    }

    public List<Period> getRetrySchedule() {
        return retrySchedule;
    }

    @Override
    public String toString() {
        return String.format("%s (retrySchedule: %s)", super.toString(), retrySchedule);
    }
}

@@ -743,1399 +743,134 @@
 ort 
-java.util.Arrays;%0Aimport java.util.List;%0A%0Aimport org.joda.time.Period;%0A%0Apublic class InvoicePluginApiRetryException extends RuntimeException %7B%0A%0A    public static final List%3CPeriod%3E DEFAULT_RETRY_SCHEDULE = Arrays.asList(Period.minutes(5),%0A                                                                            Period.minutes(15),%0A                                                                            Period.hours(1),%0A                                                                            Period.hours(6),%0A                                                                            Period.hours(24));%0A%0A    private final List%3CPeriod%3E retrySchedule;%0A%0A    public InvoicePluginApiRetryException() %7B%0A        this(null, null);%0A    %7D%0A%0A    public InvoicePluginApiRetryException(final Exception e) %7B%0A        this(e, null);%0A    %7D%0A%0A    public InvoicePluginApiRetryException(final List%3CPeriod%3E retrySchedule) %7B%0A        this(null, retrySchedule);%0A    %7D%0A%0A    public InvoicePluginApiRetryException(final Exception e, final List%3CPeriod%3E retrySchedule) %7B%0A        super(e);%0A        this.retrySchedule = retrySchedule != null ? retrySchedule : DEFAULT_RETRY_SCHEDULE;%0A    %7D%0A%0A    public List%3CPeriod%3E getRetrySchedule() %7B%0A        return retrySchedule;%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return String.format(%22%25s (retrySchedule: %25s)%22, super.toString(), retrySchedule);%0A    %7D
+org.killbill.billing.util.queue.QueueRetryException;%0A%0Apublic class InvoicePluginApiRetryException extends QueueRetryException %7B
 %0A%7D%0A

make InvoicePluginApiRetryException extend QueueRetryException