org.jgroups.stack

## Class RouterStub

- java.lang.Object
- - org.jgroups.stack.RouterStub

    public class RouterStub
    extends java.lang.Object

Client stub that talks to a remote GossipRouter

Author:
  Bela Ban

### Nested Class Summary

Nested Classes
`static interface` `RouterStub.ConnectionListener`
`static class` `RouterStub.ConnectionStatus`

### Constructor Summary

Constructors
Constructor and Description
`RouterStub(java.lang.String routerHost, int routerPort, java.net.InetAddress bindAddress, RouterStub.ConnectionListener l)` Creates a stub for a remote Router object.

### Method Summary

Methods
`void` `checkConnection()` Checks whether the connection is open
`void` `connect(java.lang.String group, Address addr, java.lang.String logical_name, java.util.List<PhysicalAddress> phys_addrs)` Register this process with the router under `group`.
`void` `destroy()`
`void` `disconnect(java.lang.String group, Address addr)`
`void` `doConnect()`
`RouterStub.ConnectionStatus` `getConnectionStatus()`
`java.net.InetSocketAddress` `getGossipRouterAddress()`
`java.io.DataInputStream` `getInputStream()`
`java.util.List<PingData>` `getMembers(java.lang.String group)`
`TUNNEL.StubReceiver` `getReceiver()`
`java.net.Socket` `getSocket()`
`int` `getSocketConnectionTimeout()`
`int` `getSocketReadTimeout()`
`void` `interrupt()`
`boolean` `isConnected()`
`boolean` `isTcpNoDelay()`
`void` `join(long wait)`
`void` `sendToAllMembers(java.lang.String group, byte[] data, int offset, int length)`
`void` `sendToMember(java.lang.String group, Address dest, byte[] data, int offset, int length)`
`void` `setReceiver(TUNNEL.StubReceiver receiver)`
`void` `setSocketConnectionTimeout(int sock_conn_timeout)`
`void` `setSocketReadTimeout(int sock_read_timeout)`
`void` `setTcpNoDelay(boolean tcp_nodelay)`
`java.lang.String` `toString()`

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

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

### Constructor Detail

#### RouterStub

    public RouterStub(java.lang.String routerHost,
              int routerPort,
              java.net.InetAddress bindAddress,
              RouterStub.ConnectionListener l)

Creates a stub for a remote Router object.

Parameters:
  `routerHost` - The name of the router's host
  `routerPort` - The router's port
Throws:
  `java.net.SocketException`

### Method Detail

#### setReceiver

    public void setReceiver(TUNNEL.StubReceiver receiver)

#### getReceiver

    public TUNNEL.StubReceiver getReceiver()

#### isTcpNoDelay

    public boolean isTcpNoDelay()

#### setTcpNoDelay

    public void setTcpNoDelay(boolean tcp_nodelay)

#### interrupt

    public void interrupt()

#### join

    public void join(long wait)
              throws java.lang.InterruptedException

Throws:
  `java.lang.InterruptedException`

#### getSocketConnectionTimeout

    public int getSocketConnectionTimeout()

#### setSocketConnectionTimeout

    public void setSocketConnectionTimeout(int sock_conn_timeout)

#### getSocketReadTimeout

    public int getSocketReadTimeout()

#### setSocketReadTimeout

    public void setSocketReadTimeout(int sock_read_timeout)

#### isConnected

    public boolean isConnected()

#### getConnectionStatus

    public RouterStub.ConnectionStatus getConnectionStatus()

#### connect

    public void connect(java.lang.String group,
               Address addr,
               java.lang.String logical_name,
               java.util.List<PhysicalAddress> phys_addrs)
                 throws java.lang.Exception

Register this process with the router under `group`.

Parameters:
  `group` - The name of the group under which to register
Throws:
  `java.lang.Exception`

#### doConnect

    public void doConnect()
                   throws java.lang.Exception

Throws:
  `java.lang.Exception`

#### checkConnection

    public void checkConnection()

Checks whether the connection is open

#### disconnect

    public void disconnect(java.lang.String group,
                  Address addr)

#### destroy

    public void destroy()

#### getSocket

    public java.net.Socket getSocket()

#### getMembers

    public java.util.List<PingData> getMembers(java.lang.String group)
                                        throws java.lang.Exception

Throws:
  `java.lang.Exception`

#### getGossipRouterAddress

    public java.net.InetSocketAddress getGossipRouterAddress()

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### sendToAllMembers

    public void sendToAllMembers(java.lang.String group,
                        byte[] data,
                        int offset,
                        int length)
                          throws java.lang.Exception

Throws:
  `java.lang.Exception`

#### sendToMember

    public void sendToMember(java.lang.String group,
                    Address dest,
                    byte[] data,
                    int offset,
                    int length)
                      throws java.lang.Exception

Throws:
  `java.lang.Exception`

#### getInputStream

    public java.io.DataInputStream getInputStream()