/*
** file: SafeDNS.java
** purpose: This interface defines the services required of
** to block banned sites.
*/
public interface SafeDNS {
// blacklist(ipa) adds thus IPA to a blacklist.
// A blacklisted IPA will not be returned by the
// lookUp method.
2
public void blacklist(String ipa);
}
• Make your DNS class also implement this interface, using the fastest suitable class from
the collections framework to store and look up IPAs in a blacklist.
• Extend your test program so that sites may be blacklisted and we can test that their IPAs
are not being returned.
Comments
Leave a comment