001package edu.wpi.first.wpilibj.networktables2.connection; 002 003import java.io.*; 004 005import edu.wpi.first.wpilibj.networktables2.*; 006 007/** 008 * Handles logic specific to the type of a node 009 * 010 * @author mwills 011 * 012 */ 013public interface ConnectionAdapter extends IncomingEntryReceiver{ 014 /** 015 * Called when the connection receives a keep alive message 016 * @throws IOException 017 */ 018 public void keepAlive() throws IOException; 019 020 /** 021 * Called when the connection receives a client hello message 022 * @param protocolRevision 023 * @throws IOException 024 */ 025 public void clientHello(char protocolRevision) throws IOException; 026 027 /** 028 * Called when the connection receives a protocol unsupported message 029 * @param protocolRevision the protocol version the server reported it supports 030 * @throws IOException 031 */ 032 public void protocolVersionUnsupported(char protocolRevision) throws IOException; 033 034 public void serverHelloComplete() throws IOException; 035 036 037 /** 038 * get an entry (used by a connection when filling an update entry 039 * @param id 040 * @return the entry or null if the entry does not exist 041 */ 042 public NetworkTableEntry getEntry(char id); 043 044 /** 045 * called if a bad message exception is thrown 046 * @param e 047 */ 048 public void badMessage(BadMessageException e); 049 050 /** 051 * called if an io exception is thrown 052 * @param e 053 */ 054 public void ioException(IOException e); 055 056}