Class UdpRemoteConnector

  • All Implemented Interfaces:
    RemoteConnector

    public class UdpRemoteConnector
    extends java.lang.Object
    implements RemoteConnector
    EXPERIMENTAL: DO NOT USE AT THE MOMENT
    • Constructor Summary

      Constructors 
      Constructor Description
      UdpRemoteConnector​(java.util.concurrent.ScheduledExecutorService executor, long flushFreq, java.lang.String address, int port, MenuCommandProtocol protocol, short deviceId, boolean sendAsDevice)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Force close a connection when its known to be bad, the connector will try and establish a new connection.
      java.lang.String getConnectionName()
      Gets the name of this connector locally
      boolean isConnected()
      Gets the underlying connection state for this connector.
      void registerConnectionChangeListener​(ConnectionChangeListener listener)
      Register for information about connection state
      void registerConnectorListener​(RemoteConnectorListener listener)
      register a listener that will receive any messages sent by the menu library
      void sendMenuCommand​(MenuCommand msg)
      Sends a command to the menu library running on the embedded hardware.
      void start()
      Starts the communication channel, so it will attempt to connect with the configured device
      void stop()
      Stops the library and attempts to also stop any threads and other resources associated.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UdpRemoteConnector

        public UdpRemoteConnector​(java.util.concurrent.ScheduledExecutorService executor,
                                  long flushFreq,
                                  java.lang.String address,
                                  int port,
                                  MenuCommandProtocol protocol,
                                  short deviceId,
                                  boolean sendAsDevice)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • start

        public void start()
        Description copied from interface: RemoteConnector
        Starts the communication channel, so it will attempt to connect with the configured device
        Specified by:
        start in interface RemoteConnector
      • sendMenuCommand

        public void sendMenuCommand​(MenuCommand msg)
                             throws java.io.IOException
        Description copied from interface: RemoteConnector
        Sends a command to the menu library running on the embedded hardware. If not connected the action is connector dependent.
        Specified by:
        sendMenuCommand in interface RemoteConnector
        Parameters:
        msg - the message to send.
        Throws:
        java.io.IOException
      • stop

        public void stop()
        Description copied from interface: RemoteConnector
        Stops the library and attempts to also stop any threads and other resources associated.
        Specified by:
        stop in interface RemoteConnector
      • isConnected

        public boolean isConnected()
        Description copied from interface: RemoteConnector
        Gets the underlying connection state for this connector.
        Specified by:
        isConnected in interface RemoteConnector
        Returns:
        the underlying connection state.
      • close

        public void close()
        Description copied from interface: RemoteConnector
        Force close a connection when its known to be bad, the connector will try and establish a new connection.
        Specified by:
        close in interface RemoteConnector