Mission Accomplished
Our current mission was to use the neon globe we created in the previous project and turn it into a geographic information system showing where the requests for a website are coming from. We started by parsing the logfile using regular expressions and extracting the IP address and the timestamp from each line. To make the timestamps easier to work with, we used SimpleDateFormater
to convert the string
representation to a long
. In the draw()
method, we created a timeline showing the timestamps of a logfile.
In the second task, we added the database from the hostIP project, which allows us to map blocks of IP addresses to geo-coordinates on city level. To speed up the geocoding, we created HashMap
using the IP address block as a key. Since the loading of the hostIP database takes some time, we moved the initialization code to a separate thread and added a progress bar to our draw()
method.
In the third task, we used the geocoded data to draw a small red dot for each request...