All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bazaarvoice.emodb.queue.client.DedupQueueServiceHealthCheck Maven / Gradle / Ivy

There is a newer version: 6.5.190
Show newest version
package com.bazaarvoice.emodb.queue.client;

import com.bazaarvoice.emodb.queue.api.AuthQueueService;
import com.bazaarvoice.emodb.queue.api.QueueService;
import com.bazaarvoice.ostrich.dropwizard.healthcheck.ContainsHealthyEndPointCheck;
import com.bazaarvoice.ostrich.pool.ServicePoolProxies;

/**
 * Dropwizard health check.
 */
public class DedupQueueServiceHealthCheck {
    public static ContainsHealthyEndPointCheck create(QueueService queueService) {
        return ContainsHealthyEndPointCheck.forPool(ServicePoolProxies.getPool(toServicePoolProxy(queueService)));
    }

    public static ContainsHealthyEndPointCheck create(AuthQueueService authQueueService) {
        return ContainsHealthyEndPointCheck.forPool(ServicePoolProxies.getPool(authQueueService));
    }

    private static Object toServicePoolProxy(QueueService queueService) {
        if (queueService instanceof DedupQueueServiceAuthenticatorProxy) {
            return ((DedupQueueServiceAuthenticatorProxy) queueService).getProxiedInstance();
        }
        return queueService;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy