public interface NMLConnectionInterface
| Modifier and Type | Method and Description |
|---|---|
int |
closeSingleVarLog(int var_log_number)
Stop collecting data on a single variable setup in setupSingleVarLog().
|
int |
connect()
Connect or reconnect to the sockets as appropriate.
|
int |
connectNoThrow()
Connect as connect() but simply print a message to strderr and return -1
in case of an error rather than throwing an exception.
|
void |
disconnect()
Disconnect closing all sockets.
|
java.lang.String |
get_buffer_name()
Get the buffer name.
|
int |
get_buffer_number()
Get the buffer_number for this buffer.
|
java.lang.String |
get_configuration_file()
Get the name of the NML configuration file being used.
|
long |
get_connect_time()
Get the time in milliseconds when the last connect() was attempted.
|
long |
get_disconnect_time()
Get the time in milliseconds when the last disconnect() was attempted.
|
java.lang.String |
get_host()
Get the host name where the buffer is supposed to be located.
|
java.lang.String |
get_last_exception_string()
Get the message string associated with the last exception thrown including
those printed but caught internally by NoThrow functions.
|
int |
get_last_id_read()
Each message has an id used to determine if it is new.
|
int |
get_msg_count()
Get the number of messages that have been successfully written to the buffer,
including messages written by other processes/systems.
|
int |
get_msg_type()
Get the type of message in the currently in the buffer.
|
int |
get_port()
Return the TCP or UDP port number associated with this connection.
|
java.lang.String |
get_process_name()
Get the process name.
|
java.lang.String |
get_returned_buffer_name()
When the NMLConnection performs a verify bufname (which it normally
does in the constructor) it requests the buffername from
the server that corresponds to the selected port and buffer number.
|
int |
getAllocation_size_max() |
java.lang.String |
getBufferLine()
Get the buffer line from the configuration file.
|
int |
getNoThrowErrorCount()
Get the number of times a NoThrow fuction returned -1 for this object.
|
NMLSingleVarLog |
getSingleVarLog(int var_log_number)
Get a NMLSingleVaLog object associated with the var_log_number that should have been
returned by setupSingleVarLog()
|
boolean |
is_connected()
Get the value of the connected property.
|
java.lang.String |
peekDataStringNoThrow()
Peek a message and convert it to a comma delimeted string.
|
java.lang.String |
read_errlog_string() |
java.lang.String |
readDataStringNoThrow()
Read a message and convert it to a comma delimeted string.
|
void |
ReadNMLConfigurationFileNoThrow()
Reread the NML Configuration and reconnect.
|
void |
set_buffer_name(java.lang.String _buffer_name)
Set the buffer name.
|
void |
set_buffer_number(int _buffer_number)
Set the buffer_number for this buffer.
|
void |
set_configuration_file(java.lang.String _configuration_file)
Set the name of the NML configuration file.
|
void |
set_host(java.lang.String s)
Set the host name where the buffer is supposed to be located which
will be used for the next connection attempt.
|
void |
set_last_id_read(int _id)
Set the id which will be compared with messages recieved to determine if
the message is new.
|
void |
set_port(int _port)
Set the TCP or UDP port to be used for the next time a connect() is performed.
|
void |
set_process_name(java.lang.String _process_name)
Set the process name.
|
void |
setAllocation_size_max(int allocation_size_max) |
void |
SetFormatConvertErrCallback(NMLFormatConvertErrCallbackInterface new_nfceci)
Set an interface that will have its member functions called for various errors.
|
void |
SetMessageDictionary(NMLMessageDictionary new_dict)
Set the message dictionary.
|
int |
setupSingleVarLog(java.lang.String varname,
int maxlogsize,
double period,
int type)
Setup a single variable log.
|
boolean |
verify_bufname()
When the NMLConnection performs a verify bufname (which it normally
does in the constructor) it requests the buffername from
the server that corresponds to the selected port and buffer number.
|
int |
writeDataString(java.lang.String s)
Convert the string into an NMLmsg and send it to this channel.
|
int |
writeDataStringNoThrow(java.lang.String s)
Convert the string into an NMLmsg and send it to this channel.
|
long get_connect_time()
long get_disconnect_time()
java.lang.String get_returned_buffer_name()
boolean verify_bufname()
java.lang.String get_host()
void set_host(java.lang.String s)
s - new hostnameint get_port()
void set_port(int _port)
_port - new port numberint get_buffer_number()
void set_buffer_number(int _buffer_number)
_buffer_number - new buffer numberjava.lang.String get_configuration_file()
void set_configuration_file(java.lang.String _configuration_file)
_configuration_file - new configuration filejava.lang.String get_buffer_name()
void set_buffer_name(java.lang.String _buffer_name)
_buffer_name - new buffer namejava.lang.String get_process_name()
void set_process_name(java.lang.String _process_name)
_process_name - new process namevoid disconnect()
int connectNoThrow()
int connect()
throws java.lang.Exception
java.lang.Exception - when connection failsint writeDataString(java.lang.String s)
throws NMLException
s - string to be convertedNMLException - when write failsint writeDataStringNoThrow(java.lang.String s)
s - string to be convertedjava.lang.String readDataStringNoThrow()
java.lang.String peekDataStringNoThrow()
boolean is_connected()
java.lang.String getBufferLine()
int getNoThrowErrorCount()
int get_msg_type()
throws java.lang.Exception
java.lang.Exception - when get_msg_type failsint get_msg_count()
throws java.lang.Exception
java.lang.Exception - when get_msg_count failsint get_last_id_read()
void set_last_id_read(int _id)
_id - new value for idvoid ReadNMLConfigurationFileNoThrow()
void SetMessageDictionary(NMLMessageDictionary new_dict)
new_dict - new dictionary objectvoid SetFormatConvertErrCallback(NMLFormatConvertErrCallbackInterface new_nfceci)
new_nfceci - new callback objectint setupSingleVarLog(java.lang.String varname,
int maxlogsize,
double period,
int type)
varname - name of the variable to logmaxlogsize - maximum number of variable updates to storeperiod - time in seconds between checks to see if the variable changed.type - type of expected message, no data is logged when other message types are in the buffer.NMLSingleVarLog getSingleVarLog(int var_log_number)
var_log_number - number assoctiated with var_logint closeSingleVarLog(int var_log_number)
var_log_number - number associated with var logjava.lang.String get_last_exception_string()
int getAllocation_size_max()
void setAllocation_size_max(int allocation_size_max)
java.lang.String read_errlog_string()
throws NMLException
NMLException