Project 2c

Due Date: Thu 10 March

Overview

  • Your job is to implement the RESTful service you designed in project 2b using the technologies you chose in project 2a and your CloudAnt instance as persistent storage for the cache.
  • Specifically, your service provides the resources described in project 2b. Your service sits between clients who access these resources and the existing reverse lookup and cloud storage services.
  • Extra credit is given for using the whitepages.com API instead of screen scraping.
    • This is required for group of size three.
  • More details are available here.

Functional Requirements

The functional requirements for this phase of the project are as follows. For example, assume /numbers is the parent resource. All numbers must be of this format: country code (1 = US, 49 = Germany, etc.)

Supported requests

  • Parent: GET /numbers
    • return OK with content indicating how to use the system and the required number format including country code 1 for US numbers
  • Lookup of an unsupported number: GET /numbers/5658234567
    • return NOT_FOUND with content indicating the required number format
  • Cached lookup of a name by number: GET /numbers/17735551234 
    • look for a mapping in the cache
    • if there is an unexpired cache hit, return the cached entry
    • otherwise look up the number in the configured sources (WP etc.)
    • if successful, cache the entry with the (externally configured) expiration date
    • return OK and the desired representation of the entry
    • if unsuccessful, return NOT_FOUND
  • Report correct entry: POST /numbers/correct/17735551234
    • increments the pertinent attribute in the domain object corresponding to /numbers/17735551234
  • Report incorrect entry: POST /numbers/incorrect/17735551234
    • increments the pertinent attribute in the domain object corresponding to /numbers/17735551234
  • Delete cache for a specific number: DELETE /numbers/17735551234
    • requires admin authorization
  • Delete cache for all numbers: DELETE /numbers/all
    • requires admin authorization
Per-user caching of number-name mappings are addressed in the next phase of the project.

Representations

Parent
  • description (see above)
  • link for deleting all mappings
Single mapping
  • number
  • name
  • number of times reported as correct
  • number of times reported as incorrect
  • date and time most recently updated from an external source
  • link to self
  • links for reporting correct or incorrect
  • link for deleting the mapping

Deliverables

  • Complete code, including automated unit tests, checked into the repository
  • Documentation checked in as a README file with the code or in the wiki section covering at least these items:
    • programming language(s) used in the code and version(s) (important), e.g., Groovy 1.7.6
    • list of all external dependencies and, if applicable, installation instructions
    • IDE and operating system used to develop and test the code, e.g., Eclipse 3.6.1 on Mac OS X Snow Leopard

Comments