Project #8 (Terp Idol)

CMSC 132

Due Date: Tuesday Dec 4, 6:00 pm

Object-Oriented Programming II

Type of Project: Closed

Fall 2007


Objective

This project has several objectives.  Those objectives are:

This project is considered a closed project.  Make sure you read the open/closed policy before continuing working on this project.

Project Clarifications

Any clarifications or corrections associated with this project will be available at:

http://www.cs.umd.edu/class/fall2007/cmsc132/projects/p8/clarifications.html

Overview

For this project you will complete the following tasks:

Javadoc documentation for this project can be found at CMSC 132 Terp Idol.

Your project will be graded as follows:

Public JUnit tests                                      45 %

Release JUnit tests                                  50 %

Style                                                            5 %

For this project:

Specifications

Terp Idol Rules

The Terp Idol contest is run in a similar manner as American Idol.

Client-Server Programming Model

Your code must use a client-server programming model, where clients initiate contact with the server to request some service.  The server waits for incoming client requests and sends back the appropriate response. Your task is to implement client and server classes that we can use to run online voting & information gathering for a Terp Idol contest. To do so you must implement code in the classes Client, Server, ContestServer, IdolCommandProcessor, and IdolClient classes. The strings representing the messages between clients and the server are defined as static final in the Const class, and may be used in other classes using "import static terpIdol.Consts.*;".

You will first implement two classes (Client, Server) that provide the basic client/server functionality.  For the server, this functionality will be:

You will use the Server and Client classes to implement a particular client and server terpIdol application.  The classes you must implement are:

Client-Server Requests

The list of requests the terpIdol contest server must process are shown in the following table:

Sent by Client Sends Server Returns Server Sends REQUEST FAILED if
Client PING SERVER RUNNING <date>  
DISCONNECT <none>  
<unknown request code> INVALID REQUEST <unknown code>  
Voter CONTESTANTS CONTESTANTS <names on separate lines>  
VOTE <name> VOTE <name> REQUEST FAILED <name> if no such contestant
LOOKUP <name> LOOKUP <line in data file for name> REQUEST FAILED if <name> not in information.txt file
IMAGES <url> IMAGES <URLs of images on separate lines> REQUEST FAILED if <url> not valid file/web page
Judge INVITE <name> INVITE <name> REQUEST FAILED <name> if already contestant 
TALLY TALLY <names & # votes, each name on separate line>  
NEW ROUND NEW ROUND <name of eliminated contestant> REQUEST FAILED if no contestants left

To recognize images, the server will search through the html code of the specified web page, looking for entries starting with "<img src="  where any number of spaces and options (e.g. border) may exist in between img and src.   An image is represented by the string following "src=", ending in a quotation mark. For instance, the following text are examples of possible image URLs for which you will be searching.

                <img src="http://i.cnn.net/cnn/images/1.gif">    <img src="file:/C:/eclipse/workspace/p8/web/2.gif">

The server will return a list of URLs of images found.  A URL is defined as one that starts with "http:" or "file:" and which provide the exact location of the image so that we can cut-and-paste the URL in a browser and actually see the image.  For this project you don't have to worry about sites that may use uppercase letters for img or src in the html code. 

Feel free to add any private instance variables and methods you understand are necessary.  You may not add any additional public methods.  Also, feel free to add any support classes you might need.

Additional Information

Java Language Requirements

Style Requirements

Video

The video TerpIdolVideo.avi illustrate some of the functionality associated with the system you are expected to implement.

Submission

Submit your project using the submit project option associated with Eclipse. 

Academic Integrity

Please make sure you read the academic integrity section of the syllabus so you understand what is permissible in our programming projects.  We want to remind you that we check your project against other students' projects and any case of academic dishonesty will be referred to the University's Office of Judicial Program

Web Accessibility