package ru.yandex.autotests.directapi.apiclient.config;


import ru.yandex.autotests.direct.utils.config.DirectTestRunProperties;
import ru.yandex.autotests.irt.testutils.allure.LogSteps;
import ru.yandex.qatools.hazelcast.SemaphoreRule;

/**
 * Created by chicos on 15.05.14.
 */
public class Semaphore {

    private static final DirectTestRunProperties properties = DirectTestRunProperties.getInstance();
    private static LogSteps log = LogSteps.getLogger(Semaphore.class);

    public static SemaphoreRule getSemaphore() {
        if (properties.getDirectSemaphorePermits() > 0) {
            return new SemaphoreRule(
                    properties.getDirectAPISemaphoreKey(),
                    properties.getDirectSemaphorePermits());
        } else {
            return null;
        }
    }
}
