GLLib: HTTP Class Reference

GLLib

HTTP Class Reference
[HTTP (used by XPlayer and License)]

Inherits Runnable.

List of all members.


Public Member Functions

void cancel ()
 Cancels the ongoing transaction.
void cleanup ()
 Frees any resources used by this class.
boolean isErrorOccurred ()
 Tells wether an error occured during the transaction.
boolean isInProgress ()
 Provides information wether this class' instance is currently doing a transfer or not.
void run ()
 The main thread handling the HTTP request.
void sendByGet (String sUrl, String sQuery)
 The entry point.

Public Attributes

boolean m_bError = false
 Tells wether an error occured during the HTTP transaction.
String m_response
 The received message buffer.
byte[] m_responseByteArray
 The received message buffer in byte array.

Static Public Attributes

static String CarrierDeviceId = null
 Stores the emulated value of the CarrierDeviceId when running on an emulator.
static String clientId = null
 Stores the emulated value of the ClientId when running on an emulator.
static String upsubid = null
 Stores the emulated value of the UPSUBID when running on an emulator.
static String userAgent = null
 The User-Agent to be used.
static String x_up_calling_line_id = null
 Stores the emulated value of the x_up_calling_line_id when running on an emulator.
static String x_up_subno = null
 Stores the emulated value of the x_up_subno when running on an emulator.

Member Function Documentation

void cancel (  ) 

Cancels the ongoing transaction.

It is safe to call at any time, but keep in mind that the request may have already reached the server, triggering any changes it implied. Those changes will not be discarded by the server and will be saved.

void cleanup (  ) 

Frees any resources used by this class.

It is OK to call at any time, but it should be called after using any data returned from the server as it also deletes m_response.

Side effect:
It will cancel the current transaction, if any.
See also:
m_response

boolean isErrorOccurred (  ) 

Tells wether an error occured during the transaction.

Returns:
true if an error has been encountered, false otherwise.

boolean isInProgress (  ) 

Provides information wether this class' instance is currently doing a transfer or not.

Returns:
true if a call is in progress, false otherwise.

void run (  ) 

The main thread handling the HTTP request.

It is started by the sendByGet(String, String) function.

See also:
sendByGet(String, String)

void sendByGet ( String  sUrl,
String  sQuery 
)

The entry point.

It starts a HTTP request.

Parameters:
sUrl URL of the server
sQuery The query to be sent to the server


Member Data Documentation

String CarrierDeviceId = null [static]

Stores the emulated value of the CarrierDeviceId when running on an emulator.

Each Cingular Orange Network phone comes with a factory preset unique CarrierDeviceId. This is not true for the emulator though, which does not have such a value associated with it.

Because this value is requested by the server, for testing on emulator this needs to be emulated somehow. To do this, set the CarrierDeviceId property in the .jad file to something like "[email protected]" to enable sending of a CarrierDeviceId while debugging in emulator. The property value will be read from the .jad, set accordingly in here and used troughout the running of the transaction.

DO NOT set this in the .jad on a phone release though. The phone's CarrierDeviceId will be automatically added by the carrier.

Default is null.

String clientId = null [static]

Stores the emulated value of the ClientId when running on an emulator.

Each Sprint phone comes with a factory preset unique ClientId. This is not true for the emulator though, which does not have such a value associated with it.

Because this value is requested by the server, for testing on emulator this needs to be emulated somehow. To do this, set the ClientId property in the .jad file to something like "[email protected]" to enable sending of a client id while debugging in emulator. The property value will be read from the .jad, set accordingly in here and used troughout the running of the transaction.

DO NOT do this on a phone release though. The phone's ClientId will be automatically used there.

Default is null.

boolean m_bError = false

Tells wether an error occured during the HTTP transaction.

It is set to true if an error has been encountered and false otherwise.

String m_response

The received message buffer.

Check this after a transaction completes to get the received data.

The received message buffer in byte array.

Check this after a transaction completes to get the received data.

String upsubid = null [static]

Stores the emulated value of the UPSUBID when running on an emulator.

Each Nextel Network phone comes with a factory preset unique UPSUBID. This is not true for the emulator though, which does not have such a value associated with it.

Because this value is requested by the server, for testing on emulator this needs to be emulated somehow. To do this, set the UPSUBID property in the .jad file to something like "[email protected]" to enable sending of a UPSUBID while debugging in emulator. The property value will be read from the .jad, set accordingly in here and used troughout the running of the transaction.

DO NOT do this on a phone release though. The phone's UPSUBID will be automatically used there.

Default is null.

String userAgent = null [static]

The User-Agent to be used.

Default is "GameloftClient/1.0"; set to whatever User-Agent you need. If null, no user agent will be set (device defaults will be used instead).

String x_up_calling_line_id = null [static]

Stores the emulated value of the x_up_calling_line_id when running on an emulator.

For testing Virgin Mobile games only. Set x_up_calling_line_id in .jad to a 10 digit phone number to enable sending of a x_up_calling_line_id while debugging in emulator.

Default is null.

String x_up_subno = null [static]

Stores the emulated value of the x_up_subno when running on an emulator.

Each Cingular Blue Network phone comes with a factory preset unique x_up_subno. This is not true for the emulator though, which does not have such a value associated with it.

Because this value is requested by the server, for testing on emulator this needs to be emulated somehow. To do this, set the x_up_subno property in the .jad file to something like "[email protected]" to enable sending of a client id while debugging in emulator. The property value will be read from the .jad, set accordingly in here and used troughout the running of the transaction.

DO NOT set this in the .jad on a phone release though. The phone's x_up_subno will be automatically added by the carrier.

Default is null.


Generated on Tue Sep 23 23:05:32 2008 for GLLib by  doxygen 1.5.2