Class RouterStub


  • public class RouterStub
    extends java.lang.Object
    Client stub that talks to a remote GossipRouter
    Version:
    $Id: RouterStub.java,v 1.30.4.3 2009/02/06 16:41:55 vlada Exp $
    Author:
    Bela Ban
    • Constructor Detail

      • RouterStub

        public RouterStub​(java.lang.String routerHost,
                          int routerPort,
                          java.net.InetAddress bindAddress)
        Creates a stub for a remote Router object.
        Parameters:
        routerHost - The name of the router's host
        routerPort - The router's port
    • Method Detail

      • isConnected

        public boolean isConnected()
      • getLocalAddress

        public Address getLocalAddress()
                                throws java.net.SocketException
        Throws:
        java.net.SocketException
      • connect

        public void connect​(java.lang.String groupname)
                     throws java.lang.Exception
        Register this process with the router under groupname.
        Parameters:
        groupname - The name of the group under which to register
        Throws:
        java.lang.Exception
      • disconnect

        public void disconnect()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • sendToAllMembers

        public void sendToAllMembers​(byte[] data,
                                     int offset,
                                     int length)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • sendToSingleMember

        public void sendToSingleMember​(Address dest,
                                       byte[] data,
                                       int offset,
                                       int length)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getInputStream

        public java.io.DataInputStream getInputStream()
                                               throws java.io.IOException
        Throws:
        java.io.IOException