3 simple REST services in Java
This project was awarded to lkh007 for $100 USD.Get free quotes for a project like this
Project Budget$30 - $250 USD
I am in need of a number of simple REST-based Java services – I do however not have the time myself to develop them, so I hope you will be able to assist me. The services will not be used in “production”, i.e. high performance/reliability requirements are not required.
Your help will be greatly appreciated!
• Jersey Framework for REST
• Database: can be flat file/mySql/in memory (What is required is that the data can be stored and retrieved as long as the webservice is running)
• Package name: com.myServices.rest. (…)
Required deliveries in the project
1) Source code for the below mentioned REST services (PUT & GET & DELETE methods are needed)
2) A WAR file per REST service that is ready to be deployed to a Tomcat server, including a short “how to run the REST service” txt file that contains a few examples of how to run the service, e.g. http://localhost:8080/TransformService/rest/112
3) A WADL file per PUT service (these should be able to be generated automatically, see e.g. [url removed, login to view]). In other words: 3 WADL files.
The REST Services that should be developed
1) transformMessage: transform octal number to decimal number
2) voter: returns the most frequent number in an array
3) aggregate: adds key-value pairs to an object
(The detailed description (see below) is also found in the pdf.)
The REST Services that should be developed:
For each of the 3 services I have described in the below text I have included a description of the PUT operations. I assume you will be able to figure out how the GET and DELETE operation will look.
Service 1: Transform message
Description: This service will receive a message in one format (octal) and should simply store and return the text in another format (decimal)
Input parameter integer (octal format)
Output parameter integer (decimal format)
Expected effect the output parameter has been stored, and the value will be written to the browser
Operation name transformMessage
PUT value 112, the new decimal value is calculated (i.e. 74). This value is stored and returned (written to browser)
GET value 112; and then the value (decimal) 74 will be returned (written to browser)
Service 2: Voter Mechanism
Description: This service should act as a voter which based on a number of input parameters (an array of integers) should return the “most frequent” value. In case more values have the same frequency the one closest to the average value of the array should be returned.
Input parameter: array of integer
Output parameter most frequent number (In case more values have the same frequency, an average of these values should be returned.)
Expected effect the array should be saved
Operation name voter
PUT [1,2,3,3,4,5]; should return 3 (the array is saved as ID 1 (here I assume this is the first entry in the database))
PUT [1,2,3,3,3,4,9,9,9]; should return (the array is saved as ID 2)
GET 1; writes the array as well as the “frequent value” (i.e. [1,2,3,3,4,5] and 3)
Service 3: A Room Aggregator
Description: This service will take a number of parameters as input (sensor values) and return with an aggregated return object (contains the numbers for the room).
Input parameter room id (string) and a key-value pair containing information about the room (e.g. room temperature in Celsius (integer), humidity (integer in percentage), light in room (yes/no), etc
Output parameter The measurements the object hold should be written to the browser, e.g. “Room A: temperature: 23 C, Light: on”
Expected effect The new object should be stored/updated
Operation name Aggregate
PUT: A, (“temperature”, 20)
PUT: A, (“light”, “on”)
PUT: Room Lakeside, (“windows open”, “false”)
Get: A => this will print something like: “A: temperature: 20, light: on”
Final notes: I am aware that these services can seem more SOAP’ish. Nevertheless, I am interested in them as RESTful services.
Browse Related Skills
Other things people do on Freelancer
Looking to make some money?
- Set your budget and the timeframe
- Outline your proposal
- Get paid for your work
Hire Freelancers who also bid on this project
Looking for work?
Work on projects like this and make money from home!Sign Up Now
- The New York Times
- Wall Street Journal
- Times Online