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

quickfix.Connector Maven / Gradle / Ivy

There is a newer version: 2.3.1
Show newest version
/*******************************************************************************
 * Copyright (c) quickfixengine.org  All rights reserved.
 *
 * This file is part of the QuickFIX FIX Engine
 *
 * This file may be distributed under the terms of the quickfixengine.org
 * license as defined by quickfixengine.org and appearing in the file
 * LICENSE included in the packaging of this file.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
 * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A
 * PARTICULAR PURPOSE.
 *
 * See http://www.quickfixengine.org/LICENSE for licensing information.
 *
 * Contact [email protected] if any conditions of this licensing
 * are not clear to you.
 ******************************************************************************/

package quickfix;

import java.util.ArrayList;

/**
 * Common base interface for acceptors and initiators.
 */
public interface Connector {

    /**
     * Start accepting connections. Returns immediately. See implementations of
     * this interface potential threading issues.
     * This method must not be called by several threads concurrently.
     * 
     * @throws ConfigError Problem with acceptor configuration.
     * @throws RuntimeError Other unspecified error
     */
    void start() throws ConfigError, RuntimeError;

    /**
     * Logout existing sessions, close their connections, and stop accepting new
     * connections.
     * This method must not be called by several threads concurrently.
     */
    void stop();

    /**
     * Stops all sessions, optionally waiting for logout completion.
     * This method must not be called by several threads concurrently.
     *
     * @param force don't wait for logout before disconnect.
     */
    void stop(boolean force);

    /**
     * Start accepting connections. This method blocks until stop is called from
     * another thread.
     * This method must not be called by several threads concurrently.
     * @deprecated Use start() instead.
     * @throws ConfigError Problem with acceptor configuration.
     * @throws RuntimeError Other unspecified error
     */
    @Deprecated
    void block() throws ConfigError, RuntimeError;

    /**
     * Checks the logged on status of the session.
     *
     * @return true is any session is logged on, false otherwise.
     */
    boolean isLoggedOn();

    /**
     * Returns the sessions managed by this acceptor.
     *
     * @return the sessions associated with this acceptor
     */
    ArrayList getSessions();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy