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

com.sportradar.unifiedodds.sdk.impl.MessageReceiver Maven / Gradle / Ivy

/*
 * Copyright (C) Sportradar AG. See LICENSE for full license governing this code
 */

package com.sportradar.unifiedodds.sdk.impl;

import java.io.IOException;
import java.util.List;

/**
 * Defines methods implemented by classes capable of delivering messages from the feed
 */
public interface MessageReceiver {
    /**
     * Opens the current instance so it starts receiving messages
     *
     * @param routingKeys - a {@link List} of requested routing keys
     * @param messageConsumer - a {@link MessageConsumer} instance which will receive messages
     * @throws IOException if the channel failed to open
     */
    void open(List routingKeys, MessageConsumer messageConsumer) throws IOException;

    /**
     * Closes the current instance so it will no longer receive messages
     *
     * @throws IOException if the channel closure encountered a problem
     */
    void close() throws IOException;

    /**
     * Indicates if the current instance is opened and receiving messages
     *
     * @return - true if the instance is opeened; otherwise false
     */
    boolean isOpened();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy