/* * Salamander Transport Layer * * Michael J. Willis (violator@umich.edu) * * $Workfile: SAL.java $ * $Author: rmalan $ * $Date: 1997/07/16 14:20:39 $ * $Revision: 1.5 $ */ package Salamander; /** * Main base class containing static data memebers, etc. */ public class SAL { /** * Default host name */ static String HOST_NAME = "localhost"; /** * UDP port used for initial connections */ static int UDP_PORT = 8086; /** * Maximum size of a UDP message received on the input UDP port */ static int MAX_UDP_MSGSIZE = 1024; /** * This interface version: */ static int THISINTERFACEVERSION = 0x32303030; /** * Default timeout for UDP to TCP port resolution. */ static int DEFAULT_TIMEOUT = 300; /** * Used in a UDP connection to request the TCP port that should be connected to. */ static int QUERY_TCP_PORT = 1; static int OK = 0; static int LOCAL_ERROR = 1; static int SERVER_TIMEOUT = 2; static int HOST_UNKNOWN = 3; static int REMOTE_ERROR = 4; static int ALREADY_CONNECTED= 5; static int PUBLISH_GENERIC = 6; static int SEND_ERROR = 7; static int PROTOCOL_ERROR = 8; static int INVALID_PLIST = 9; static int QUERY_CONNECTIONS= 10; static int REMOVE_CONNECTION= 11; static int EXIT = 12; static int REMOTE_PUBLISH = 13; static int REMOTE_SUBSCRIBE = 14; static String SUBSCRIBE = "QUERY"; static String ALL_SALAMANDER_DATA = "ALL SALAMANDER DATA"; static int getDefaultUDPPort() { return UDP_PORT; } static String getDefaultHostName() { return HOST_NAME; } static int getInterfaceVersion() { return THISINTERFACEVERSION; } static int getDefaultTimeout() { return DEFAULT_TIMEOUT; } static boolean m_bTrace=false; public static void enableTrace() { m_bTrace = true; } public static void disableTrace() { m_bTrace = false; } public static void trace(String s) { if ( m_bTrace ) System.out.println(s); } public static void error(String s) { System.err.println(s); } }