AUSSLib API for Java

This document is to describe the use of the AUSS.Connection class.

The main class which is used in most of the AUSS API calls is the AUSS::Connection object. The AUSS::Connection object contains all the information about the connection you want to make. It will be used to generate a XML header for AUSS as well.

A connection contains fields:

These can be set using getter and setter methods

Not all of these features are supported.

To initalize a connection (please don't fill in a connection yourself until this is done) the "auss_make_conn" function is used:

			AUSS.Connection connection = new AUSS.Connection();
			connection.setName("Name");
	

Once a connection object is created you can set values in it like the name.

Then one would want to connect this connection to preferrablly a connector. to connect one simply calls:

			connection.connect(host,port,true,true);
			connection.connect(socket); 
			connection.connect(inputStream); connection.connect(outputStream);
	
This simply means use the aussconn object and connect to the remotehost host with the port number port, the host is a connector and send the header too. You can do the same thing with a pipe except a pipe is unidirectional so sometimes you can send a header (e.g. STDIN). Once connected you can read and write from the connection as you wish much like unix read and write commands.
			connection.write(stringOut);
			connection.write(byteArray,offset,size);
			connection.write(byteArray,size);
			connection.writeLEShort(byteArray,size);
			connection.writeLEShort(byteArray,offset,size);
			connection.writeLEShort(shortArray,size);
			connection.writeLEShort(shortArray,offset,size)

			connection.read(stringOut);
			connection.read(byteArray,size);
			connection.read(byteArray,offset,size);
			connection.readLEShort(shortArray,size);

	
All of these methods throw IOException if there is a problem.

Once you're done reading and writing one can simply disconnect from AUSS with:

		connection.disconnect();