Java HTML
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
html
scripts
src/main/java/org/cloudi/examples/tutorial
.travis.yml
README.markdown
pom.xml
schema.sql.bz2

README.markdown

CloudI Java Tutorial

Build Status

This repository contains the example source code for the tutorial at http://cloudi.org/tutorial_java.html. The source code provides local real-time recommendations for the electronic books available at Project Gutenberg.

While the source code is meant to show information related to Java development with the Java CloudI API, additional source code dependencies are used:

BUILD

Use maven and JDK 1.7 or higher (>= Java 7) to build:

mvn clean package

RUNNING

Refer to the Java Tutorial for detailed steps.

SERVICE API EXAMPLES

Update an item's rating:

curl -X POST -d '{"message_name": "recommendation_update", "user_id": 1, "item_id": 1, "rating": 5.0}' http://localhost:8080/tutorial/java/service/recommendation/update

Get the current list of recommendations:

curl -X POST -d '{"message_name": "recommendation_list", "user_id": 1}' http://localhost:8080/tutorial/java/service/recommendation/list

Get the current list of items with the user's current ratings:

curl -X POST -d '{"message_name": "item_list", "user_id": 1, "language": "en", "subject": "Philosophy"}' http://localhost:8080/tutorial/java/service/item/list

Get the current list of languages that items are available in:

curl -X POST -d '{"message_name": "language_list"}' http://localhost:8080/tutorial/java/service/language/list

Get the current list of subjects that items are available in:

curl -X POST -d '{"message_name": "subject_list"}' http://localhost:8080/tutorial/java/service/subject/list

Refresh the list of items with the books available at gutenberg.org:

curl -X POST -d '{"message_name": "item_refresh"}' http://localhost:8080/tutorial/java/service/item/refresh

Update the recommendations model (public services often do this daily or weekly, but this can be done more frequently):

curl -X POST -d '{"message_name": "recommendation_refresh"}' http://localhost:8080/tutorial/java/service/recommendation/refresh