MFAdmin (3.14.0 310 API)
Date: 2018-05-30

com.marketfactory.zerogc.api

## Class MFAdmin

- java.lang.Object
- - com.marketfactory.zerogc.api.MFClient
  - - com.marketfactory.zerogc.api.MFAdmin

-     public class MFAdmin
      extends MFClient

  An API admin which contains a MFClient for function forwarding

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.marketfactory.zerogc.api.MFClient

      `MFClient.TimeStats`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MFAdmin(MFString _username, MFString _password, MFString _hostname1, int _port1)` Create a new admin object.
    `MFAdmin(MFString _username, MFString _password, MFString _hostname1, int _port1, MFString _hostname2, int _port2)` Create a new admin object (with failover).

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static MFAdmin` | `open(MFString user, MFString pass, MFString host, int port)` A convenience method which creates a new client object, attempts to connect to Whisperer, and cleans up and throws an exception if we could not connect.
    `static MFAdmin` | `open(MFString user, MFString pass, MFString _hostname1, int _port1, MFString _hostname2, int _port2)` A convenience method which creates a new client object, attempts to connect to Whisperer, and cleans up and throws an exception if we could not connect.
    `APIResult` | `run(MFAdminHandler handler)` Run a loop that will continuously dispatch incoming messages to a _handler implementation.
    `APIResult` | `run(MFHandler _handler)` Run a loop that will continuously dispatch incoming messages to a _handler implementation.

    - ### Methods inherited from class com.marketfactory.zerogc.api.MFClient

      `allowClientsToConnect, cancelAll, cancelAll, cancelOrder, cancelOrder, cancelOrder, close, connect, enableDebugMetrics, getCurrentBatchID, getCurrentBatchMarkets, getFeedByID, getFeedByName, getFeeds, getHostname, getLastPingTimes, getMarketByID, getMarketByName, getPort, getSequenceID, getSignature, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, isConnected, isRunning, join, lockUser, modifyOrder, open, open, processEvents, registerMarketComb, replay, requestSnapshot, setDebug, setStickySubscriptions, setStickySubscriptions, setUseHeartbeat, stop, submitOrder, submitOrder, submitOrder, submitOrder, subscribeAllMD, subscribeMD, subscribeMD, subscribeOF, subscribeOF, unregisterMarketComb, unsubscribeAll, unsubscribeMD, unsubscribeMD, unsubscribeOF, unsubscribeOF`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MFAdmin

          public MFAdmin(MFString _username,
                         MFString _password,
                         MFString _hostname1,
                         int _port1)

      Create a new admin object. A new client still needs to be connected (see connect()).
      Parameters:
        `_username` - -- the username
        `_password` - -- the password
        `_hostname1` - -- primary hostname
        `_port1` - -- primary port

    - #### MFAdmin

          public MFAdmin(MFString _username,
                         MFString _password,
                         MFString _hostname1,
                         int _port1,
                         MFString _hostname2,
                         int _port2)

      Create a new admin object (with failover). A new client still needs to be connected (see connect()).
      Parameters:
        `_username` - -- the username
        `_password` - -- the password
        `_hostname1` - -- primary hostname
        `_port1` - -- primary port
        `_hostname2` - -- secondary hostname
        `_port2` - -- secondary port

  - ### Method Detail

    - #### run

          public APIResult run(MFHandler _handler)

      Description copied from class: `MFClient`
      Run a loop that will continuously dispatch incoming messages to a _handler implementation.
      Overrides:
        `run` in class `MFClient`
      Parameters:
        `_handler` - -- the handler to be run
      Returns:
        This method returns some time after a request to stop is made using stop(), or if an error occurs (e.g. the connection is broken). A zero return value indicates a normal exit via a stop request. If the connection is broken and the client succesfully fails over to a secondary server, this dispatcher does not return; onDisconnect() and onConnect() are invoked to let the handler know that this occurred. If the reconnection attempt is not successful, the dispatcher will return an error code. Every call to run() must be preceded by a successful connect() -- this call is made for you, but only once, when a client is obtained via open(). Note: this should not be invoked by _handler.

    - #### run

          public APIResult run(MFAdminHandler handler)

      Run a loop that will continuously dispatch incoming messages to a _handler implementation.
      Parameters:
        `handler` - to be run Note: this should not be invoked by _handler.
      Returns:
        This method returns some time after a request to stop is made using stop(), or if an error occurs (e.g. the connection is broken). A zero return value indicates a normal exit via a stop request. If the connection is broken and the client succesfully fails over to a secondary server, this dispatcher does not return; onDisconnect() and onConnect() are invoked to let the handler know that this occurred. If the reconnection attempt is not successful, the dispatcher will return an error code. Every call to run() must be preceded by a successful connect() -- this call is made for you, but only once, when a client is obtained via open().

    - #### open

          public static MFAdmin open(MFString user,
                                     MFString pass,
                                     MFString host,
                                     int port)
                              throws java.io.IOException

      A convenience method which creates a new client object, attempts to connect to Whisperer, and cleans up and throws an exception if we could not connect. Otherwise the new client object is returned;
      Parameters:
        `user` - -- username
        `pass` - -- password
        `host` - -- hostname or ip
        `port` - -- tcp port number
      Returns:
        opened MFAdmin instance
      Throws:
        `java.io.IOException` - if the connection attempt fails

    - #### open

          public static MFAdmin open(MFString user,
                                     MFString pass,
                                     MFString _hostname1,
                                     int _port1,
                                     MFString _hostname2,
                                     int _port2)
                              throws java.io.IOException

      A convenience method which creates a new client object, attempts to connect to Whisperer, and cleans up and throws an exception if we could not connect. Otherwise the new client object is returned;
      Parameters:
        `user` - -- username
        `pass` - -- password
        `_hostname1` - -- the primary host
        `_port1` - -- the primary port
        `_hostname2` - -- the secondary host
        `_port2` - -- the secondary port
      Returns:
        MFAdmin instance
      Throws:
        `java.io.IOException` - if the connection attempt fails