com.antiaction.dns.transport
Interface DNSConnector


public interface DNSConnector

DNS message connection interface, abstract class for DNS connections.

Version:
2.00
Author:
Nicholas Clarke

Method Summary
 boolean Connect()
          Attempt to connect to the first server available in the pool of servers.
 void Disconnect()
          Close the connection.
 boolean hasNext()
          Returns true if the iteration has more elements.
 java.lang.Object next()
          Returns the next element in the interation.
 byte[] receiveMessage()
          Receive a over the connection.
 void reset()
          Puts the iterator in its initial state.
 boolean sendMessage(byte[] pDat)
          Send a message over the connection.
 java.lang.String toString()
          Returns a string representation of the internal state, mostly for debugging purposes.
 

Method Detail

reset

public void reset()
Puts the iterator in its initial state.

hasNext

public boolean hasNext()
Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)
Returns:
true if the iterator has more elements.

next

public java.lang.Object next()
                      throws java.util.NoSuchElementException
Returns the next element in the interation.
Returns:
the next element in the iteration.

Connect

public boolean Connect()
                throws java.lang.IllegalStateException
Attempt to connect to the first server available in the pool of servers. Returns a boolean indicating whether a connection was succesful.
Returns:
boolean indicating if a connection was made.
See Also:
Disconnect()

Disconnect

public void Disconnect()
                throws java.lang.IllegalStateException
Close the connection.
See Also:
Connect()

sendMessage

public boolean sendMessage(byte[] pDat)
                    throws java.lang.IllegalStateException
Send a message over the connection. Returns a boolean indicating success or failure.
Returns:
boolean indicating whether the message was transfer was successful.
See Also:
receiveMessage()

receiveMessage

public byte[] receiveMessage()
                      throws java.lang.IllegalStateException
Receive a over the connection. Returns the message or null depending on wheter the transfer was a success.
Returns:
array of bytes containing the message or null if a failure was encountered.
See Also:
sendMessage(byte[])

toString

public java.lang.String toString()
Returns a string representation of the internal state, mostly for debugging purposes.
Overrides:
toString in class java.lang.Object
Returns:
debug string.