Public Member Functions

  ORARequest (String url)
  ORARequest (String url, Map< String, String > payload)
  ORARequest (String url, String jsonPayload)
void  setRetryCount (int retryCount)
void  addRequestHeader (String key, String value)
void  addRequestHeaders (Map< String, String > headers)
void  setUrl (String url)
void  setPayload (String jsonPayload)
void  setPayload (Map< String, String > eventMap)
void  setRequestType (@RequestType int requestType)
void  setCompress (boolean compress)
void  setPriority (@Priority int priority)
String  getTAG ()
void  setTAG (String tag)

Static Public Attributes

static final int  REQUEST_TYPE_GET = 1
static final int  REQUEST_TYPE_POST = 2
static final int  PRIORITY_NORMAL = 1
static final int  PRIORITY_IMMEDIATE = 2

Detailed Description

This is the central class to construct a request object.

Constructor & Destructor Documentation

◆ ORARequest() [1/3]

ORARequest ( String url )

Construct Request object with URL. Throws ORAInvalidRequestException if url is not a valid url.

Parameters
url url

◆ ORARequest() [2/3]

ORARequest ( String  url,
Map< String, String >  payload 
)

Construct request object with url and payload. Either valid url or payload is mandatory, otherwise throws ORAInvalidRequestException

Parameters
url url
payload payload in the form of key-value pair

◆ ORARequest() [3/3]

ORARequest ( String  url,
String  jsonPayload 
)

Construct request object with url and payload. Either valid url or payload is mandatory, otherwise throws ORAInvalidRequestException

Parameters
url url
jsonPayload json payload

Member Function Documentation

◆ addRequestHeader()

void addRequestHeader ( String  key,
String  value 
)

To addRequest single request header.

Parameters
key header name
value header value

◆ addRequestHeaders()

void addRequestHeaders ( Map < String, String >  headers )

To addRequest multiple request headers

Parameters
headers Map of request headers

◆ getTAG()

String getTAG ( )

To get the TAG for a request

◆ setCompress()

void setCompress ( boolean  compress )

set whether payload should be compressed or not. Default value is false.

Parameters
compress true to compress, false otherwise.

◆ setPayload() [1/2]

void setPayload ( String  jsonPayload )

Set the url. If the payload is null, it will throw ORAInvalidRequestException

Parameters
jsonPayload to be sent.

◆ setPayload() [2/2]

void setPayload ( Map< String, String >  eventMap )

Set the payload. If the payload is null, it will throw ORAInvalidRequestException

Parameters
eventMap to be sent.

◆ setPriority()

void setPriority ( @Priority int  priority )

set the priority of the request. Default value is PRIORITY_NORMAL

Parameters
priority Possible values are PRIORITY_NORMAL, PRIORITY_IMMEDIATE

◆ setRequestType()

void setRequestType ( @RequestType int  requestType )

Set the request method. Default value is REQUEST_TYPE_POST

Parameters
requestType Possible values are REQUEST_TYPE_POST, REQUEST_TYPE_GET

◆ setRetryCount()

void setRetryCount ( int  retryCount )

Sets the retry count. If the request is failed, the same request is retried for retryCount times. The default value is 1. Minimum is 0 and maximum is 15.

Parameters
retryCount retry count.

◆ setTAG()

void setTAG ( String  tag )

Set the request TAG. Default value is null.

Parameters
tag user defined unique identifier for the request

◆ setUrl()

void setUrl ( String  url )

Set the url.

Parameters
url to be validated.
Exceptions
ORAInvalidRequestException If the url is not valid

Member Data Documentation

◆ PRIORITY_IMMEDIATE

final int PRIORITY_IMMEDIATE = 2
static

Request priority PRIORITY_IMMEDIATE

◆ PRIORITY_NORMAL

final int PRIORITY_NORMAL = 1
static

Request priority PRIORITY_NORMAL

◆ REQUEST_TYPE_GET

final int REQUEST_TYPE_GET = 1
static

HTTP request method GET

◆ REQUEST_TYPE_POST

final int REQUEST_TYPE_POST = 2
static

HTTP request method POST

The documentation for this class was generated from the following file:
  • ORARequest.java