"

2013 FRC Java API

"

edu.wpi.first.wpilibj.networktables2.client
Class ClientConnectionAdapter

java.lang.Object
  extended by edu.wpi.first.wpilibj.networktables2.client.ClientConnectionAdapter
All Implemented Interfaces:
ConnectionAdapter, FlushableOutgoingEntryReceiver, IncomingEntryReceiver, OutgoingEntryReceiver

public class ClientConnectionAdapter
extends Object
implements ConnectionAdapter, IncomingEntryReceiver, FlushableOutgoingEntryReceiver

Object that adapts messages from a server

Author:
Mitchell

Field Summary
 
Fields inherited from interface edu.wpi.first.wpilibj.networktables2.IncomingEntryReceiver
NULL
 
Constructor Summary
ClientConnectionAdapter(ClientNetworkTableEntryStore entryStore, NTThreadManager threadManager, IOStreamFactory streamFactory, ClientConnectionListenerManager connectionListenerManager, NetworkTableEntryTypeManager typeManager)
          Create a new ClientConnectionAdapter
 
Method Summary
 void badMessage(BadMessageException e)
          called if a bad message exception is thrown
 void clientHello(char protocolRevision)
          Called when the connection receives a client hello message
 void close()
          Close the client connection
 void close(ClientConnectionState newState)
          Close the connection to the server and enter the given state
 void ensureAlive()
           
 void flush()
           
 ClientConnectionState getConnectionState()
           
 NetworkTableEntry getEntry(char id)
          get an entry (used by a connection when filling an update entry
 void ioException(IOException e)
          called if an io exception is thrown
 boolean isConnected()
           
 void keepAlive()
          Called when the connection receives a keep alive message
 void offerIncomingAssignment(NetworkTableEntry entry)
           
 void offerIncomingUpdate(NetworkTableEntry entry, char sequenceNumber, Object value)
           
 void offerOutgoingAssignment(NetworkTableEntry entry)
           
 void offerOutgoingUpdate(NetworkTableEntry entry)
           
 void protocolVersionUnsupported(char protocolRevision)
          Called when the connection receives a protocol unsupported message
 void reconnect()
          Reconnect the client to the server (even if the client is not currently connected)
 void serverHelloComplete()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientConnectionAdapter

public ClientConnectionAdapter(ClientNetworkTableEntryStore entryStore,
                               NTThreadManager threadManager,
                               IOStreamFactory streamFactory,
                               ClientConnectionListenerManager connectionListenerManager,
                               NetworkTableEntryTypeManager typeManager)
Create a new ClientConnectionAdapter

Parameters:
entryStore -
threadManager -
streamFactory -
transactionPool -
connectionListenerManager -
Method Detail

getConnectionState

public ClientConnectionState getConnectionState()
Returns:
the state of the connection

isConnected

public boolean isConnected()
Returns:
if the client is connected to the server

reconnect

public void reconnect()
Reconnect the client to the server (even if the client is not currently connected)


close

public void close()
Close the client connection


close

public void close(ClientConnectionState newState)
Close the connection to the server and enter the given state

Parameters:
newState -

badMessage

public void badMessage(BadMessageException e)
Description copied from interface: ConnectionAdapter
called if a bad message exception is thrown

Specified by:
badMessage in interface ConnectionAdapter

ioException

public void ioException(IOException e)
Description copied from interface: ConnectionAdapter
called if an io exception is thrown

Specified by:
ioException in interface ConnectionAdapter

getEntry

public NetworkTableEntry getEntry(char id)
Description copied from interface: ConnectionAdapter
get an entry (used by a connection when filling an update entry

Specified by:
getEntry in interface ConnectionAdapter
Returns:
the entry or null if the entry does not exist

keepAlive

public void keepAlive()
               throws IOException
Description copied from interface: ConnectionAdapter
Called when the connection receives a keep alive message

Specified by:
keepAlive in interface ConnectionAdapter
Throws:
IOException

clientHello

public void clientHello(char protocolRevision)
                 throws IOException
Description copied from interface: ConnectionAdapter
Called when the connection receives a client hello message

Specified by:
clientHello in interface ConnectionAdapter
Throws:
IOException

protocolVersionUnsupported

public void protocolVersionUnsupported(char protocolRevision)
Description copied from interface: ConnectionAdapter
Called when the connection receives a protocol unsupported message

Specified by:
protocolVersionUnsupported in interface ConnectionAdapter
Parameters:
protocolRevision - the protocol version the server reported it supports

serverHelloComplete

public void serverHelloComplete()
                         throws IOException
Specified by:
serverHelloComplete in interface ConnectionAdapter
Throws:
IOException

offerIncomingAssignment

public void offerIncomingAssignment(NetworkTableEntry entry)
Specified by:
offerIncomingAssignment in interface IncomingEntryReceiver

offerIncomingUpdate

public void offerIncomingUpdate(NetworkTableEntry entry,
                                char sequenceNumber,
                                Object value)
Specified by:
offerIncomingUpdate in interface IncomingEntryReceiver

offerOutgoingAssignment

public void offerOutgoingAssignment(NetworkTableEntry entry)
Specified by:
offerOutgoingAssignment in interface OutgoingEntryReceiver

offerOutgoingUpdate

public void offerOutgoingUpdate(NetworkTableEntry entry)
Specified by:
offerOutgoingUpdate in interface OutgoingEntryReceiver

flush

public void flush()
Specified by:
flush in interface FlushableOutgoingEntryReceiver

ensureAlive

public void ensureAlive()
Specified by:
ensureAlive in interface FlushableOutgoingEntryReceiver

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"