Skip to content

Latest commit

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

java-api-test-client

BlueRover Java API Test Client

Public Methods

  • APIClientAPIClient(creds)

    Instanstiate a BlueroverApi object and set its credentials.

    Parameters:

    HashMap<String,String> creds : API credentials containing the following:

    * `String key` : authentication key for your user
    * `String token` : authentication token for your user
    * `String baseURL` : the address where you are pointing to, normally **developers.bluerover.us**
    

    Returns: Constructs APIClient object

  • voidscheduleEventCall(seconds)

    Schedule a recurring getEvents(startTime,endTime,page) call that occurs every X seconds. It is currently set to fetch events that occured in the past 10 seconds. However, a better solution may be to use the previous call's end time in order to avoid disjoint sets.

    Parameters:

    * `int seconds` : number of seconds between each call
    
  • voidscheduleDeviceCall(seconds)

    Schedule a recurring getDevices() call that occurs every X seconds.

    Parameters:

    * `int seconds` : number of seconds between each call
    
  • voidscheduleRfidCall(seconds)

    Schedule a recurring getRfids() call that occurs every X seconds.

    Parameters:

    * `int seconds` : number of seconds between each call
    
  • voidstartEventStream(pCallBack)

    API Request to start the event stream, calling pCallBack when data is received.

    Define pCallBack by implementing the CallBack class. A sample callback (class SampleCallBack) is provided.

    Parameters:

    * `CallBack pCallBack` : Implementation of CallBack that defines behaviour on data received
    

###Standard operation

//insert your credentials into the mapHashMap<String,String> creds = newHashMap<String,String>();
creds.put("key", "YOUR_KEY_HERE");
creds.put("token", "YOUR_TOKEN_HERE");
creds.put("baseURL", "http://developers.bluerover.us");
APIClientclient = newAPIClient(creds);
//Schedule a recurring event call every 10 secondsclient.scheduleEventCall(10);
//Start the event streamclient.startEventStream(newSampleCallBack());

About

BlueRover Java API Client

Resources

Stars

0 stars

Watchers

17 watching

Forks

Releases

Packages

Contributors

Languages