// Path: opfpush/src/main/java/org/onepf/opfpush/model/Operation.java
// public enum Operation {
//     REGISTER,
//     UNREGISTER
// }


import android.support.annotation.NonNull;
import org.onepf.opfutils.OPFChecks;
import org.onepf.opfutils.OPFLog;
import org.onepf.opfpush.model.Operation;
/*
 * Copyright 2012-2015 One Platform Foundation
 *
 * Licensed 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.onepf.opfpush.backoff;



/**
 * @author Roman Savin
 * @since 04.02.2015
 */
public final class InfinityExponentialBackoffManager implements BackoffManager {

    private static volatile InfinityExponentialBackoffManager instance;

    @NonNull
    private final BackoffManager registerBackoffAdapter;

    @NonNull
    private final BackoffManager unregisterBackoffAdapter;

    private InfinityExponentialBackoffManager() {
        registerBackoffAdapter = new RegisterBackoffAdapter<>(InfinityExponentialBackoff.class);
        unregisterBackoffAdapter = new UnregisterBackoffAdapter<>(InfinityExponentialBackoff.class);
    }

    @SuppressWarnings("PMD.NonThreadSafeSingleton")
    public static InfinityExponentialBackoffManager getInstance() {
        OPFChecks.checkThread(true);
        if (instance == null) {
            instance = new InfinityExponentialBackoffManager();
        }

        return instance;
    }

    public boolean hasTries(@NonNull final String providerName,
// Path: opfpush/src/main/java/org/onepf/opfpush/model/Operation.java
// public enum Operation {
//     REGISTER,
//     UNREGISTER
// }


// Path: opfpush/src/main/java/org/onepf/opfpush/backoff/InfinityExponentialBackoffManager.java
import android.support.annotation.NonNull;
import org.onepf.opfutils.OPFChecks;
import org.onepf.opfutils.OPFLog;
import org.onepf.opfpush.model.Operation;

/*
 * Copyright 2012-2015 One Platform Foundation
 *
 * Licensed 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.onepf.opfpush.backoff;



/**
 * @author Roman Savin
 * @since 04.02.2015
 */
public final class InfinityExponentialBackoffManager implements BackoffManager {

    private static volatile InfinityExponentialBackoffManager instance;

    @NonNull
    private final BackoffManager registerBackoffAdapter;

    @NonNull
    private final BackoffManager unregisterBackoffAdapter;

    private InfinityExponentialBackoffManager() {
        registerBackoffAdapter = new RegisterBackoffAdapter<>(InfinityExponentialBackoff.class);
        unregisterBackoffAdapter = new UnregisterBackoffAdapter<>(InfinityExponentialBackoff.class);
    }

    @SuppressWarnings("PMD.NonThreadSafeSingleton")
    public static InfinityExponentialBackoffManager getInstance() {
        OPFChecks.checkThread(true);
        if (instance == null) {
            instance = new InfinityExponentialBackoffManager();
        }

        return instance;
    }

    public boolean hasTries(@NonNull final String providerName,
                            @NonNull final Operation operation) {