mmRestAPI
Class MMAbstractRestAPI

java.lang.Object
  extended by mmRestAPI.MMAbstractRestAPI
Direct Known Subclasses:
MMGwtRestAPI, MMRestAPI

public abstract class MMAbstractRestAPI
extends java.lang.Object


Nested Class Summary
static class MMAbstractRestAPI.FindCondition
           
static class MMAbstractRestAPI.RestVerb
           
 
Constructor Summary
MMAbstractRestAPI()
           
 
Method Summary
abstract  void addFindCondition(MMAbstractRestAPI.FindCondition condition, java.lang.String key, int value)
           
abstract  void addFindCondition(MMAbstractRestAPI.FindCondition condition, java.lang.String key, java.lang.Long value)
           
abstract  void addFindCondition(MMAbstractRestAPI.FindCondition condition, java.lang.String key, java.lang.String value)
          Add a specific query condition for a Find (i.e.
abstract  MMAbstractRestAPI newInstance()
          Create a new instance of a REST API call; each time to make a request, you should get a new instance using this funciton.
 void prepareRequest(MMAbstractRestAPI.RestVerb rv, java.lang.String c, java.lang.String oid)
          Initialize a REST request to be executed later.
abstract  void sendRequestAsync(java.lang.String dataJsonString, MMRestApiCallback callback)
          Send the prepared request asynchronously to the server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MMAbstractRestAPI

public MMAbstractRestAPI()
Method Detail

prepareRequest

public void prepareRequest(MMAbstractRestAPI.RestVerb rv,
                           java.lang.String c,
                           java.lang.String oid)
Initialize a REST request to be executed later.

Parameters:
rv - the action of the request
c - the collection name of the databse
oid - the object ID is required for some actions (update, delete); could be null

sendRequestAsync

public abstract void sendRequestAsync(java.lang.String dataJsonString,
                                      MMRestApiCallback callback)
Send the prepared request asynchronously to the server.

Parameters:
dataJsonString - the data to be sent in the request; in format of JSON string
callback - the callback to get the return results from the server

newInstance

public abstract MMAbstractRestAPI newInstance()
Create a new instance of a REST API call; each time to make a request, you should get a new instance using this funciton.

Returns:
a new instance of the request instance

addFindCondition

public abstract void addFindCondition(MMAbstractRestAPI.FindCondition condition,
                                      java.lang.String key,
                                      java.lang.String value)
Add a specific query condition for a Find (i.e. query) REST API request. Be sure to use the correct function signature.

Parameters:
condition -
key -
value -

addFindCondition

public abstract void addFindCondition(MMAbstractRestAPI.FindCondition condition,
                                      java.lang.String key,
                                      int value)

addFindCondition

public abstract void addFindCondition(MMAbstractRestAPI.FindCondition condition,
                                      java.lang.String key,
                                      java.lang.Long value)