base.interfaces
Interface IConnection


public interface IConnection

Manages connections & requests with a server.


Method Summary
 void connect()
          Connects to the host with the already-defined host & port.
 void connect(java.lang.String host)
          Connects to the given host with the default port.
 void connect(java.lang.String host, int port)
          Connects to the given host at the given port.
 base.connection.Response request(java.lang.String method, java.lang.String path, java.util.Map<java.lang.String,java.lang.String> headers, java.util.Map<java.lang.String,java.lang.String> params, java.lang.Object data)
          Makes a request to this connection.
 

Method Detail

connect

void connect()
Connects to the host with the already-defined host & port.


connect

void connect(java.lang.String host)
Connects to the given host with the default port.

Parameters:
host - is the host to connect to

connect

void connect(java.lang.String host,
             int port)
Connects to the given host at the given port.

Parameters:
host - is the host to connect to
port - is the host's port to connect to

request

base.connection.Response request(java.lang.String method,
                                 java.lang.String path,
                                 java.util.Map<java.lang.String,java.lang.String> headers,
                                 java.util.Map<java.lang.String,java.lang.String> params,
                                 java.lang.Object data)
Makes a request to this connection.

Parameters:
method - defines the operation to perform (i.e. GET, DELETE, PUT, POST)
path - is the path to the resource (e.g. /john.doe/images/1)
headers - are the headers to include with the request
params - are the parameters to include with the request
data - is the body data to include with the request
Returns:
Response represents the server's response to this request