Beaconstac Android  0.9.9
com.mobstac.beaconstac.models.MSAction Class Reference
Inheritance diagram for com.mobstac.beaconstac.models.MSAction:
com.mobstac.beaconstac.models.ModelBase

Classes

enum  MSActionType
 
interface  WebhookHandler
 

Public Member Functions

 MSAction (int id, String actionName, int ruleID, String ruleName, int actionType, JSONObject meta, Date created, Date updated, String status)
 
int getActionID ()
 
String getName ()
 
MSActionType getType ()
 
HashMap< String, Object > getMessage ()
 
void setMessage (HashMap< String, Object > msg)
 
int getRuleID ()
 
void setRuleID (int id)
 
String getRuleName ()
 
void setRuleName (String name)
 
JSONObject getMeta ()
 
void setMeta (JSONObject meta)
 
String getStatus ()
 
void setStatus (String newstat)
 
Date getCreated ()
 
void setCreated (Date date)
 
Date getUpdated ()
 
void setUpdated (Date date)
 
void executeWebhook (final Context context, HashMap< String, String > postParams, final HashMap< String, String > additionalHeaders, final WebhookHandler handler) throws MSException
 
 MSAction (Parcel p)
 
- Public Member Functions inherited from com.mobstac.beaconstac.models.ModelBase
 ModelBase (Object...objects)
 

Additional Inherited Members

- Static Protected Attributes inherited from com.mobstac.beaconstac.models.ModelBase
static final String idString = "_id"
 
static final String[] base_columns = { idString }
 

Member Function Documentation

void com.mobstac.beaconstac.models.MSAction.executeWebhook ( final Context  context,
HashMap< String, String >  postParams,
final HashMap< String, String >  additionalHeaders,
final WebhookHandler  handler 
) throws MSException

This method must be called when action type is webhook. This posts data to the URL configured in Beaconstac developer portal. Throws MSException if called on an action that is not of type Webhook.

Parameters
contextAn instance of context
postParamsA dictionary of data that you want to post to the URL. Please note that timestamp and data available in factsDictionary is automatically posted.
additionalHeadersA dictionary of HTTP headers with values. Plesae note that HTTP headers sent from the portal are set by default
handlerA class that implements WebhookHandler to take care of success and error handlers
int com.mobstac.beaconstac.models.MSAction.getActionID ( )

Returns the ID of the action

Date com.mobstac.beaconstac.models.MSAction.getCreated ( )
Returns
the date when the action was created
HashMap<String, Object> com.mobstac.beaconstac.models.MSAction.getMessage ( )

Returns the message of the action. This is a HashMap. Message HashMap can have keys: text, url depending on the type of action

JSONObject com.mobstac.beaconstac.models.MSAction.getMeta ( )
Returns
A dictionary that contains meta information associated with the action
String com.mobstac.beaconstac.models.MSAction.getName ( )

Returns the name of the action

int com.mobstac.beaconstac.models.MSAction.getRuleID ( )

Returns the rule ID associated to the action

String com.mobstac.beaconstac.models.MSAction.getRuleName ( )

Returns the name of the rule this action is associated with

String com.mobstac.beaconstac.models.MSAction.getStatus ( )
Returns
the status of action This can have following values - A - active P - paused R - removed
MSActionType com.mobstac.beaconstac.models.MSAction.getType ( )

Returns the type of the action. This can have values: popup, webpage, video, audio, custom

Date com.mobstac.beaconstac.models.MSAction.getUpdated ( )
Returns
the date when the action was last updated
void com.mobstac.beaconstac.models.MSAction.setCreated ( Date  date)

Set the date when the action was created

Parameters
date
void com.mobstac.beaconstac.models.MSAction.setMessage ( HashMap< String, Object >  msg)

Set the message of the action.

Parameters
msgHashMap with keys text, url etc. depending on the type of action
void com.mobstac.beaconstac.models.MSAction.setMeta ( JSONObject  meta)

Set meta dictionary

Parameters
metaJSON Dictionary
void com.mobstac.beaconstac.models.MSAction.setRuleID ( int  id)

Set the rule id

Parameters
idrule id
void com.mobstac.beaconstac.models.MSAction.setRuleName ( String  name)

Sets the name of the rule this action is associated with

Parameters
namerule name
void com.mobstac.beaconstac.models.MSAction.setStatus ( String  newstat)

Set the action status

Parameters
newstatnew status
void com.mobstac.beaconstac.models.MSAction.setUpdated ( Date  date)

Set the date when the action was last updated

Parameters
dateupdated date

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