com.autonomy.aci
Class AciConnectionDetails

java.lang.Object
  extended bycom.autonomy.aci.AciConnectionDetails
All Implemented Interfaces:
java.lang.Cloneable

public class AciConnectionDetails
extends java.lang.Object
implements java.lang.Cloneable

Used to define the host, port, retries, timeout and encoding details of a connection to an ACI server.


Field Summary
static java.lang.String DEFAULT_ENCODING
          The default character encoding to use when communicating with ACI servers (utf-8).
static int DEFAULT_RETRIES
          The default number of retries to use when attempting to communicate with ACI servers (5).
static int DEFAULT_TIMEOUT
          The default timeout period to use when attempting to communicate with ACI servers (10000ms).
 
Constructor Summary
AciConnectionDetails()
           
 
Method Summary
 java.lang.Object clone()
          Create a new AciConnectionDetails object with the same connection details as this one.
 java.lang.String getCharacterEncoding()
          Read the character encoding being used when communicating with the ACI server.
 java.lang.String getHost()
          Returns the host name for this connection.
 int getPort()
          Returns the port being used for this connection.
 int getRetries()
          Get the number of times a connection with the server is attempted before abandoning the request.
 java.lang.String getServerName()
          Returns the name of the ACI server.
 int getTimeout()
          Reads the timeout to be used when waiting for a response from the server.
 void setCharacterEncoding(java.lang.String sEncoding)
          Set the character encoding used when communicating with the ACI server.
 void setHost(java.lang.String sHost)
          Set the name of the machine hosting the ACI server.
 void setPort(int nPort)
          Set the port to use when connecting to the ACI port of the ACI server.
 void setRetries(int nRetries)
          Set the number of times a connection with the server is attempted before exiting.
 void setServerName(java.lang.String sServerName)
          Set the name of the ACI server that these connection details point to.
 void setTimeout(int nTimeout)
          Sets the timeout to be used when waiting for a response from the server.
 java.lang.String toString()
          Lists the connection details set on the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_ENCODING

public static final java.lang.String DEFAULT_ENCODING

The default character encoding to use when communicating with ACI servers (utf-8).

See Also:
Constant Field Values

DEFAULT_RETRIES

public static final int DEFAULT_RETRIES

The default number of retries to use when attempting to communicate with ACI servers (5).

See Also:
Constant Field Values

DEFAULT_TIMEOUT

public static final int DEFAULT_TIMEOUT

The default timeout period to use when attempting to communicate with ACI servers (10000ms).

See Also:
Constant Field Values
Constructor Detail

AciConnectionDetails

public AciConnectionDetails()
Method Detail

setServerName

public void setServerName(java.lang.String sServerName)

Set the name of the ACI server that these connection details point to. It is not necessary to set this value but can be useful in debugging (the server name is then used within any exception message relating to this connection).

Parameters:
sServerName - the ACI server name.

setHost

public void setHost(java.lang.String sHost)

Set the name of the machine hosting the ACI server.

Parameters:
sHost - the machine name, either in either IP or host name format.

setPort

public void setPort(int nPort)

Set the port to use when connecting to the ACI port of the ACI server.

Parameters:
nPort - the ACI port number of the ACI server. This must be 0 < nPort < 65536 (2^16).

setRetries

public void setRetries(int nRetries)

Set the number of times a connection with the server is attempted before exiting.

Parameters:
nRetries - the number of times a connection with the server is attempted before abandoning the request.

setTimeout

public void setTimeout(int nTimeout)

Sets the timeout to be used when waiting for a response from the server.

Parameters:
nTimeout - the time in milliseconds. A time of 0 means wait indefinitely.

setCharacterEncoding

public void setCharacterEncoding(java.lang.String sEncoding)

Set the character encoding used when communicating with the ACI server. This affects both the encoding used when URL encoding action parameters and the encoding used by the underlying sockets to convert from strings to byte streams.

Parameters:
sEncoding - the encoding to use.

getServerName

public java.lang.String getServerName()

Returns the name of the ACI server.

Returns:
the name of the ACI server.

getHost

public java.lang.String getHost()

Returns the host name for this connection.

Returns:
the hostname or IP of the ACI server.

getPort

public int getPort()

Returns the port being used for this connection.

Returns:
the port number of the ACI server.

getRetries

public int getRetries()

Get the number of times a connection with the server is attempted before abandoning the request. The default value is 5.

Returns:
the number of retries.

getTimeout

public int getTimeout()

Reads the timeout to be used when waiting for a response from the server. The default value is 10000ms.

Returns:
the timeout period in milliseconds.

getCharacterEncoding

public java.lang.String getCharacterEncoding()

Read the character encoding being used when communicating with the ACI server. The default value is "utf-8".

Returns:
the character encoding.

clone

public java.lang.Object clone()
Create a new AciConnectionDetails object with the same connection details as this one.

Returns:
a copy of this object.

toString

public java.lang.String toString()
Lists the connection details set on the object.

Returns:
the connection details in list form.