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 java.lang.String GAN_SETUP_PROP_KEY  
      static java.lang.String SYSTAG_AVAILABLE  
      static java.lang.String SYSTAG_LAST_COMM  
      • Fields inherited from interface com.inductiveautomation.metro.api.CentralManager

        INCOMING_METER_BASE, INCOMING_METER_FORMAT, INTENT_METER_BASE, INTENT_METER_FORMAT, INTENT_SENDING_SERVER, MDC_REMOTE_CONNECTION_ID, MDC_REMOTE_GATEWAY_NAME, METRIC_FAULT, METRIC_PENDING_DOWNLOADS, METRIC_PENDING_DOWNLOADS_MAX, METRIC_PENDING_UPLOAD, METRIC_PENDING_UPLOADS_MAX, METRIC_WAITING_PROCESSING, METRIC_WAITING_PROCESSING_MAX, METRO_METRIC_PREFIX, OUTGOING_METER_BASE, OUTGOING_METER_FORMAT, PROXY_RPC_TASK, PROXY_RPC_TASK_DESCR
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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.
      void addRouteChangeListener​(com.inductiveautomation.metro.api.RouteChangeListener listener)
      Add a listener to the internal routing manager that will fire whenever routes change.
      GanSetupItem fromWSSettingsRecord​(long settingsId)
      Returns a WSConnectionSettings record as a GanSetupItem object.
      boolean ganConnectionExists​(java.lang.String host, int port, boolean isSsl)
      Checks whether a GAN connection exists with the same host, port and SSL settings.
      java.util.Collection<com.inductiveautomation.metro.impl.ConnectionWatcher> getAvailableConnections()
      Retrieves all known GAN connection objects.
      java.util.Optional<com.inductiveautomation.metro.impl.ConnectionWatcher> getConnection​(com.inductiveautomation.metro.api.RemoteSystemId connectionId)
      Returns a ConnectionWatcher object for the specified connectionId within an Optional.
      java.util.Collection<com.inductiveautomation.metro.impl.ConnectionWatcher> getInboundConnections()
      Retrieves all known GAN connection objects that represent inbound connections.
      java.util.Optional<java.util.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.
      com.inductiveautomation.metro.api.ServerId getServerNameForConnection​(java.lang.Long connId)
      Returns a ServerId for a server whose WSConnectionSettings id matches the passed connId.
      void removeInboundConnections()
      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, installSecurityPlugin, registerConnection, registerIntent, removeSecurityPlugin, removeServerListener, removeServerListener, retrieveIntent, unregisterConnection, unregisterIntent
    • Method Detail

      • ganConnectionExists

        boolean ganConnectionExists​(java.lang.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

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

        java.util.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 java.lang.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:
        java.lang.Exception
      • getServerNameForConnection

        com.inductiveautomation.metro.api.ServerId getServerNameForConnection​(java.lang.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

        java.util.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

        java.util.Optional<java.util.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.