// Path: src/main/java/org/zeromq/api/BinaryStarReactor.java
// public interface BinaryStarReactor {
//     /**
//      * We send state information this often. If peer doesn't respond in two heartbeats, it is 'dead'.
//      */
//     long BSTAR_HEARTBEAT = 1000;
// 
//     /**
//      * Startup modes.
//      */
//     enum Mode {
//         /**
//          * Primary node.
//          */
//         PRIMARY,
//         /**
//          * Backup node.
//          */
//         BACKUP
//     }
// 
//     /**
//      * States we can be in at any point in time.
//      */
//     enum State {
//         /**
//          * Primary, waiting for peer to connect.
//          */
//         PRIMARY_CONNECTING,
//         /**
//          * Backup, waiting for peer to connect.
//          */
//         BACKUP_CONNECTING,
//         /**
//          * Active - accepting connections.
//          */
//         ACTIVE,
//         /**
//          * Passive - Not accepting connections.
//          */
//         PASSIVE
//     }
// 
//     /**
//      * Events, which start with the states our peer can be in.
//      */
//     enum Event {
//         /**
//          * HA peer is pending primary.
//          */
//         PEER_PRIMARY,
//         /**
//          * HA peer is pending backup.
//          */
//         PEER_BACKUP,
//         /**
//          * HA peer is active.
//          */
//         PEER_ACTIVE,
//         /**
//          * HA peer is passive.
//          */
//         PEER_PASSIVE,
//         /**
//          * Client makes request.
//          */
//         CLIENT_REQUEST
//     }
// 
//     /**
//      * Start the underlying Reactor.
//      */
//     void start();
// 
//     /**
//      * Stop the underlying Reactor.
//      */
//     void stop();
// 
//     /**
//      * Register a client voter socket. Only one socket can be registered.
//      *
//      * @param socket The client socket
//      */
//     void registerVoterSocket(Socket socket);
// 
//     /**
//      * Register a voter handler to be called each time the application receives a message.
//      *
//      * @param handler The handler for client events
//      */
//     void setVoterHandler(LoopHandler handler);
// 
//     /**
//      * Register a handler to be called each time there's a state change.
//      *
//      * @param handler The handler for state change events
//      */
//     void setActiveHandler(LoopHandler handler);
// 
//     /**
//      * Register a handler to be called each time there's a state change.
//      *
//      * @param handler The handler for state change events
//      */
//     void setPassiveHandler(LoopHandler handler);
// 
//     /**
//      * Get the underlying {@link Reactor}.
//      * 
//      * @return The underlying Reactor
//      */
//     Reactor getReactor();
// 
//     /**
//      * Set the heartbeat interval used to detect peer outage.
//      * 
//      * @param heartbeatInterval The heartbeat interval, in milliseconds
//      */
//     void setHeartbeatInterval(long heartbeatInterval);
// }


import org.zeromq.Patterns;
import org.zeromq.api.BinaryStarReactor;
package org.zeromq.client;


public class CloneServerMain {
    /**
     * @param args
     */
    public static void main(String[] args) {
        assert (args.length == 1);

        BinaryStarReactor.Mode mode = (args[0].equals("--primary"))
            ? BinaryStarReactor.Mode.PRIMARY
// Path: src/main/java/org/zeromq/api/BinaryStarReactor.java
// public interface BinaryStarReactor {
//     /**
//      * We send state information this often. If peer doesn't respond in two heartbeats, it is 'dead'.
//      */
//     long BSTAR_HEARTBEAT = 1000;
// 
//     /**
//      * Startup modes.
//      */
//     enum Mode {
//         /**
//          * Primary node.
//          */
//         PRIMARY,
//         /**
//          * Backup node.
//          */
//         BACKUP
//     }
// 
//     /**
//      * States we can be in at any point in time.
//      */
//     enum State {
//         /**
//          * Primary, waiting for peer to connect.
//          */
//         PRIMARY_CONNECTING,
//         /**
//          * Backup, waiting for peer to connect.
//          */
//         BACKUP_CONNECTING,
//         /**
//          * Active - accepting connections.
//          */
//         ACTIVE,
//         /**
//          * Passive - Not accepting connections.
//          */
//         PASSIVE
//     }
// 
//     /**
//      * Events, which start with the states our peer can be in.
//      */
//     enum Event {
//         /**
//          * HA peer is pending primary.
//          */
//         PEER_PRIMARY,
//         /**
//          * HA peer is pending backup.
//          */
//         PEER_BACKUP,
//         /**
//          * HA peer is active.
//          */
//         PEER_ACTIVE,
//         /**
//          * HA peer is passive.
//          */
//         PEER_PASSIVE,
//         /**
//          * Client makes request.
//          */
//         CLIENT_REQUEST
//     }
// 
//     /**
//      * Start the underlying Reactor.
//      */
//     void start();
// 
//     /**
//      * Stop the underlying Reactor.
//      */
//     void stop();
// 
//     /**
//      * Register a client voter socket. Only one socket can be registered.
//      *
//      * @param socket The client socket
//      */
//     void registerVoterSocket(Socket socket);
// 
//     /**
//      * Register a voter handler to be called each time the application receives a message.
//      *
//      * @param handler The handler for client events
//      */
//     void setVoterHandler(LoopHandler handler);
// 
//     /**
//      * Register a handler to be called each time there's a state change.
//      *
//      * @param handler The handler for state change events
//      */
//     void setActiveHandler(LoopHandler handler);
// 
//     /**
//      * Register a handler to be called each time there's a state change.
//      *
//      * @param handler The handler for state change events
//      */
//     void setPassiveHandler(LoopHandler handler);
// 
//     /**
//      * Get the underlying {@link Reactor}.
//      * 
//      * @return The underlying Reactor
//      */
//     Reactor getReactor();
// 
//     /**
//      * Set the heartbeat interval used to detect peer outage.
//      * 
//      * @param heartbeatInterval The heartbeat interval, in milliseconds
//      */
//     void setHeartbeatInterval(long heartbeatInterval);
// }


// Path: src/test/java/org/zeromq/client/CloneServerMain.java
import org.zeromq.Patterns;
import org.zeromq.api.BinaryStarReactor;

package org.zeromq.client;


public class CloneServerMain {
    /**
     * @param args
     */
    public static void main(String[] args) {
        assert (args.length == 1);

        BinaryStarReactor.Mode mode = (args[0].equals("--primary"))
            ? BinaryStarReactor.Mode.PRIMARY
            : BinaryStarReactor.Mode.BACKUP;