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

lv.ctco.cukes.rabbitmq.facade.SetupFacade Maven / Gradle / Ivy

There is a newer version: 1.0.10
Show newest version
package lv.ctco.cukes.rabbitmq.facade;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import lv.ctco.cukes.rabbitmq.internal.ConnectionService;
import lv.ctco.cukes.rabbitmq.internal.ExchangeService;
import lv.ctco.cukes.rabbitmq.internal.QueueService;

import java.util.Optional;

@Singleton
public class SetupFacade {

    @Inject
    ConnectionService connectionService;
    @Inject
    ExchangeService exchangeService;
    @Inject
    QueueService queueService;

    public void setHost(String host) {
        connectionService.setHost(host);
    }

    public void setPort(int port) {
        connectionService.setPort(port);
    }

    public void setUsername(String username) {
        connectionService.setUsername(username);
    }

    public void setPassword(String password) {
        connectionService.setPassword(password);
    }

    public void setVirtualHost(String virtualHost) {
        connectionService.setVirtualHost(virtualHost);
    }

    public void setSsl(boolean ssl) {
        connectionService.setSsl(ssl);
    }

    public void declareExchange(String name, String type, boolean durable) {
        exchangeService.declareExchange(name, type, durable);
    }

    public void setDefaultExchange(String exchange) {
        exchangeService.setDefaultExchange(exchange);
    }

    public void declareQueue(String queueName, Optional exchange, String routingKey) {
        queueService.declareQueue(queueName, exchange.orElse(exchangeService.getDefaultExchange()), routingKey);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy