Cloud Jumpstart

From RifidiWiki

Jump to: navigation, search

Note: The Rifidi SDK includes a Amazon Webservice Cloud template application click here to setup and use the Rifidi SDK.

Create a RifidiApp

  • 1. Create a RifidiApp. First, be sure to set up a developer environment using these steps.

Then check the developer guide for creating your own Rifidi App. Check the section starting at "Importing a Project Template" on page 5 for how to do this.

After your application is set up, you'll have to choose how you want to receive your tags. Tags that are read by RFID readers will be inserted into an event processing engine called Esper. There are a few different ways to receive these tags, as outlined here:

Import Services

  • 2. You can use one of the default services to send and receive tags. You can see a description of the default services here.

You can also see an example of the two services in action in the "Northwind" example (specifically, the "ReadZoneMonitoringService" and the "StableSetService"). See the developer's guide for an overview of the Northwind example. The source code for the example (which can be imported as a project) is in the "apps" folder of the SDK.

Taking the ReadZoneMonitoringService as an example, a method will be called on designated classes whenever a tag arrives or departs. You can find out the ID of this tag (as well as other useful information) and then do whatever you wish with it, including writing the event to a cloud or to social media.

Create Custom Esper Rules

  • 3. You can also write your own custom Esper rules, usually in concert with the ReadZoneMonitoringService. You can find out how to create custom Esper rules at the Custom Esper Rules Jumpstart page.

Add Third Party Libraries

Cloud Interface

  • 5. There are many ways you can communicate with the cloud, and many libraries that you can use to communicate with it. For this example we'll be using the Amazon AWS SDK for Java, specifically the SimpleDB. There is a great example for how to use the SimpleDB here. After you set up the credentials for the system, you can talk to the SimpleDB in a similar fashion that you would talk to any other database.
	@Override
	public void tagArrived(TagReadEvent tag) {
		System.out.println("Tag arrived at location " + location + ": " + tag.getTag().getFormattedID());
		List<ReplaceableItem> data = new ArrayList<ReplaceableItem>();
		data.add(new ReplaceableItem().withName(tag.getTag().getFormattedID()).withAttributes(
			new ReplaceableAttribute().withName("Antenna").withValue(tag.getAntennaID()),
			new ReplaceableAttribute().withName("Timestamp").withValue(tag.getTimestamp())));
		//"sdb" is the SimpleDB client object, "domain" is the name of the domain you wish to insert the tag in
		sdb.batchPutAttributes(new BatchPutAttributesRequest(domain, data));
	}

Sample Rifidi Cloud AWS Application with SDK

  • 6. Here is where one can find the sources for the sample Rifidi AWS Cloud Application. The use case captures arrived and departed events across read/sensor zones and publishes to AWS DynamoDB (This can be changed to publish to other data infrastructures in Cloud as well)
  • Note: You will need to use your own AWS account to run example.

Rifidi AWS Cloud Sample App w/SDK

Personal tools