Java API for Tux Droid
com.tuxisalive.api.TuxHTTPRequest Class Reference
Collaboration diagram for com.tuxisalive.api.TuxHTTPRequest:

Public Member Functions

 TuxHTTPRequest (String host, int port)
 
void setServerAddress (String host, int port)
 
Hashtable< Object, Object > request (String cmd, String method)
 
Hashtable< Object, Object > request (String cmd)
 
Boolean request (String cmd, Hashtable< Object, Object > varStruct, Hashtable< Object, Object > varResult)
 

Private Member Functions

Hashtable< Object, Object > parseXml (InputSource s)
 
void requester (String address, String cmd)
 
Object getValueFromStructure (Hashtable< Object, Object > struct, String valuePath)
 

Private Attributes

String baseUrl
 
SLock mutex
 

Static Private Attributes

static byte buffer [] = new byte[1024 * 64]
 
static int bufferSize = -1
 

Detailed Description

TuxHTTPRequest is a sender of request to a Tuxdroid service server. The resulting xml data is automatically parsed and returned to a data structure.

Author
Remi Jocaille
Version
0.3.0

Constructor & Destructor Documentation

◆ TuxHTTPRequest()

com.tuxisalive.api.TuxHTTPRequest.TuxHTTPRequest ( String  host,
int  port 
)

Constructor of the class.

Parameters
hosthost of the server.
portport of the server.

Member Function Documentation

◆ getValueFromStructure()

Object com.tuxisalive.api.TuxHTTPRequest.getValueFromStructure ( Hashtable< Object, Object >  struct,
String  valuePath 
)
private

◆ parseXml()

Hashtable<Object,Object> com.tuxisalive.api.TuxHTTPRequest.parseXml ( InputSource  s)
private

◆ request() [1/3]

Hashtable<Object,Object> com.tuxisalive.api.TuxHTTPRequest.request ( String  cmd)

Make a request to the server.

Parameters
cmdformated command in an url.
Returns
a data structure.

◆ request() [2/3]

Boolean com.tuxisalive.api.TuxHTTPRequest.request ( String  cmd,
Hashtable< Object, Object >  varStruct,
Hashtable< Object, Object >  varResult 
)

Make a request to the server.

Parameters
cmdformated command in an url.
varStructstructure definition of the requested values.
varResultreturned values in a structure.
Returns
the success of the request.

◆ request() [3/3]

Hashtable<Object,Object> com.tuxisalive.api.TuxHTTPRequest.request ( String  cmd,
String  method 
)

Make a request to the server.

Parameters
cmdformated command in an url.
methodmethod of the request.
Returns
a data structure.

◆ requester()

void com.tuxisalive.api.TuxHTTPRequest.requester ( String  address,
String  cmd 
)
private

◆ setServerAddress()

void com.tuxisalive.api.TuxHTTPRequest.setServerAddress ( String  host,
int  port 
)

Set the targeted server address.

Parameters
hosthost of the server.
portport of the server.

Member Data Documentation

◆ baseUrl

String com.tuxisalive.api.TuxHTTPRequest.baseUrl
private

◆ buffer

byte com.tuxisalive.api.TuxHTTPRequest.buffer[] = new byte[1024 * 64]
staticprivate

◆ bufferSize

int com.tuxisalive.api.TuxHTTPRequest.bufferSize = -1
staticprivate

◆ mutex

SLock com.tuxisalive.api.TuxHTTPRequest.mutex
private

The documentation for this class was generated from the following file: