Project 3: Find the Weather for a City
There are two general goals for this project:
- Client-Server communication.
You will build a weather server on your local machine. The requirements for
the server are:
- Upon client's request, the server replies with the client the current weather
information for that city (as a minimum, you should report the temperature).
- The server should accept as many simultaneous client requests as your machine
can handle. Your machine will have a limit on the numkber of threads that
you can create. You can assume that 50 is the lowest limit.
- The server should maintain a cache that stores the current weather information.
- If a request for a certain city is in progress, other reqests on the same
city should wait for that request to complete and then use the newly cached
- In case a web page is unavailable, a message should be passed back to the
client telling the client information not available. The information in cache
should be marked as not available. The server will try one of the waiting
clients' requests to the web server, until either a vaid webpage passed back,
or all the clients's requests fail. Again, as long as no valid information
passed back by the web server, the information of that city needs to be marked
The client should have text fields that can be used to specify a city and a
As an example, the weather underground supports several request formats. One
is using state and city name. For example, albuquerque will be requested as:
In this case, you need two text fields: one for the the state (NM) and another
for the the city name (Albuquerque). You have the choices of using which weather
web server and which information used to retrieve the weather information. Please
state how to enter input to your program in your readme.
The refresh button is for user to click on to get new information. Your GUI
for display weather information will be refreshed every time a user presses
the refresh button. This means that the client will send a request to the server
everytime the refresh button is pressed.
How your program should run
The server will be started using the following command:
The client will be started with:
- Other java classes as needed
Note: your readme file should include a clear description of how the program
should be run.