Interface GatewayNetworkManager

All Superinterfaces:
com.inductiveautomation.metro.api.CentralManager

public interface GatewayNetworkManager extends com.inductiveautomation.metro.api.CentralManager
Created by colby.clegg on 3/23/2015.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     

    Fields inherited from interface com.inductiveautomation.metro.api.CentralManager

    FAULT_COUNTER, INCOMING_BYTES_PER_SECOND, INCOMING_MESSAGES_PER_SECOND, INCOMING_MSGS_SEC_BASE, INCOMING_MSGS_SEC_FORMAT, MDC_REMOTE_CONNECTION_ID, MDC_REMOTE_GATEWAY_NAME, METRIC_ACTIVE_ALL, METRIC_FAULT, METRIC_INCOMING_BYTES_SEC_ALL, METRIC_INCOMING_BYTES_SEC_BASE, METRIC_INCOMING_BYTES_SEC_FORMAT, METRIC_INCOMING_MSGS_SEC_ALL, METRIC_OUTGOING_BYTES_SEC_ALL, METRIC_OUTGOING_BYTES_SEC_BASE, METRIC_OUTGOING_BYTES_SEC_FORMAT, METRIC_OUTGOING_MSGS_SEC_ALL, METRIC_PENDING_ALL, METRIC_PENDING_DOWNLOADS, METRIC_PENDING_DOWNLOADS_MAX, METRIC_PENDING_UPLOAD, METRIC_PENDING_UPLOADS_MAX, METRIC_PENDINGACKSEXPIRED, METRIC_PENDINGMESSAGESEXPIRED, METRIC_PROXY_MSGS_SEC, METRIC_WAITING_PROCESSING, METRIC_WAITING_PROCESSING_MAX, METRO_METRIC_PREFIX, OUTGOING_BYTES_PER_SECOND, OUTGOING_MESSAGES_PER_SECOND, OUTGOING_MSGS_SEC_BASE, OUTGOING_MSGS_SEC_FORMAT, PROXY_RPC_TASK, PROXY_RPC_TASK_DESCR, REGISTRY_PATH, SERVICE_INVOCATION_BASE, SERVICE_INVOCATION_FORMAT
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a GAN connection only if there is no existing GAN connection with the host and port specified in the passed setup.
    void
    addRouteChangeListener(com.inductiveautomation.metro.api.RouteChangeListener listener)
    Add a listener to the internal routing manager that will fire whenever routes change.
    fromWSSettingsRecord(long settingsId)
    Returns a WSConnectionSettings record as a GanSetupItem object.
    boolean
    ganConnectionExists(String host, int port, boolean isSsl)
    Checks whether a GAN connection exists with the same host, port and SSL settings.
    Collection<com.inductiveautomation.metro.impl.ConnectionWatcher>
    Retrieves all known GAN connection objects.
    Optional<com.inductiveautomation.metro.impl.ConnectionWatcher>
    getConnection(com.inductiveautomation.metro.api.RemoteSystemId connectionId)
    Returns a ConnectionWatcher object for the specified connectionId within an Optional.
    Collection<com.inductiveautomation.metro.impl.ConnectionWatcher>
    Retrieves all known GAN connection objects that represent inbound connections.
    getLastCommTime(com.inductiveautomation.metro.api.ServerId serverAddress)
    Returns a Optional containing a date, which indicates the last time a ping was received from the remote machine.
    com.inductiveautomation.metro.api.ServerId
    Returns a ServerId for a server whose WSConnectionSettings id matches the passed connId.
    void
    Unregisters all inbound connections from the metro system.
    void
    removeRouteChangeListener(com.inductiveautomation.metro.api.RouteChangeListener listener)
    Removes a listener for the internal routing layer.

    Methods inherited from interface com.inductiveautomation.metro.api.CentralManager

    addServerListener, addServerListener, getConnectionForServer, getKnownServers, getRedundancyActivityLevel, getServer, getServerAddress, getServerIfKnown, getServerNameForConnection, getServerState, getServerStatus, getServiceManager, registerConnection, registerIntent, removeServerListener, removeServerListener, retrieveIntent, unregisterConnection, unregisterIntent
  • Field Details

  • Method Details

    • ganConnectionExists

      boolean ganConnectionExists(String host, int port, boolean isSsl)
      Checks whether a GAN connection exists with the same host, port and SSL settings. Use this to avoid using addGanConnection() as much as possible, as addGanConnection() will update the underlying record and restart the connection.
    • addGanConnection

      void addGanConnection(GanSetupItem ganSetup)
      Adds a GAN connection only if there is no existing GAN connection with the host and port specified in the passed setup. Otherwise, the existing GAN connection is updated. Either way, the connection is restarted when it is saved.
    • getAvailableConnections

      Collection<com.inductiveautomation.metro.impl.ConnectionWatcher> getAvailableConnections()
      Retrieves all known GAN connection objects.
    • getInboundConnections

      Collection<com.inductiveautomation.metro.impl.ConnectionWatcher> getInboundConnections()
      Retrieves all known GAN connection objects that represent inbound connections.
    • removeInboundConnections

      void removeInboundConnections()
      Unregisters all inbound connections from the metro system. Remote systems will need to reconnect to this machine to re-establish the inbound connections.
    • fromWSSettingsRecord

      GanSetupItem fromWSSettingsRecord(long settingsId) throws Exception
      Returns a WSConnectionSettings record as a GanSetupItem object. Used to externally save a GAN connection so it can be recreated later, such as during a gateway restoration.
      Throws:
      Exception
    • getServerNameForConnection

      com.inductiveautomation.metro.api.ServerId getServerNameForConnection(Long connId)
      Returns a ServerId for a server whose WSConnectionSettings id matches the passed connId. If the server is not found, null is returned. Used to locate a server from a WSConnectionSettings record, as the server name is dynamic and is not in the record.
    • getConnection

      Optional<com.inductiveautomation.metro.impl.ConnectionWatcher> getConnection(com.inductiveautomation.metro.api.RemoteSystemId connectionId)
      Returns a ConnectionWatcher object for the specified connectionId within an Optional.
    • addRouteChangeListener

      void addRouteChangeListener(com.inductiveautomation.metro.api.RouteChangeListener listener)
      Add a listener to the internal routing manager that will fire whenever routes change. Useful if some data needs to be sent if something like a route endpoint name changes.
    • removeRouteChangeListener

      void removeRouteChangeListener(com.inductiveautomation.metro.api.RouteChangeListener listener)
      Removes a listener for the internal routing layer.
    • getLastCommTime

      Optional<Date> getLastCommTime(com.inductiveautomation.metro.api.ServerId serverAddress)
      Returns a Optional containing a date, which indicates the last time a ping was received from the remote machine. If the Optional is empty, it means that a ping was never received from the remote machine, or the remote machine does not exist.