Framework Presentation Project Participants Karun Biyani Manish Mehta
Framework Presentation Project Participants: Karun Biyani Manish Mehta Pradeep Vincent CSE 870 Advanced Software Engineering, Spring 2001 Instructor: Dr. B. Cheng 1
Overview Proxy Domain Description n Framework Overview n Sample Application Highlights n Demonstration n Discussion n 30 April, 2001 2
Proxy Domain n Http Filtering Proxy 1. 2. 3. 4. 30 April, 2001 Proxy resides between client and server Does intermediate action Proxy uses: caching, filtering, etc. Filtering: domain filtering, background filtering, ad filtering, block filtering, etc. 3
Framework Packages Error – Contains Exception Handling Routines Html – Contains Html Parser and Html Block is used to store the parsed Html page. Http – Contains Files for Handling Http Request and Http Response. Filter – Contains Filter classes that will do filtering on Request or Response. All new filter applications have to create a new filter class which will inherit the Filter. Handler class. Net – Contains Net Listener. It reads from and writes to the socket. Util – Contains files for generating Log File and Debug Routines Proxy – Contains Proxy Server and Http Proxy Handler 30 April, 2001 4
Framework Application 30 April, 2001 5
Application Highlights n Three Filtering Application n n Ad. Filter Block. Filter Background. Filter To instantiate the framework, the new filter class implements the Filter. Handler interface and then instantiate the new filter class in Http 1_0 Proxy. Handler 30 April, 2001 6
Code public class Http 1_0 Proxy. Handler implements ISocket. Handler { public static final String HTTP_URI_STRING = "http: //"; private Socket m_sck. Out = null; private Net. Obj. Ref t. Ref. Next. Proxy = null; private boolean m_b. Debug = false; private Filter. Handler filter = new Background. Filter(); private static final boolean FLAG_REQ_FILTER = false; private static final boolean FLAG_RESP_FILTER = !FLAG_REQ_FILTER; private static final boolean DO_FILTER = true; public Http 1_0 Proxy. Handler(Filter. Handler applfilter) { filter = applfilter; } 30 April, 2001 7
import COM. reitshamer. http. *; import COM. reitshamer. html. *; public class Ad. Filter implements Filter. Handler { public Http. Response filter (Http. Request req, Http. Response res, boolean mayfilter) { if ( mayfilter ) { HTMLBlock block; if ( res != null ) Http. Object. List obj. List = res. get. Object. List(); else return null; for ( int i=0; i < obj. List. size(); i++ ) { if ( obj. List. is. HTMLBlock(i) ) { block = (HTMLBlock)obj. List. geti(i); dofiltering ( block ); } } } return null; } 30 April, 2001 8
Proxy Demonstration 30 April, 2001 9
Summary and Discussion n Framework Implementation n Fault Tolerance • Handling malformed URLs • Response Failure • Thinking Ahead - Timing Failure n Design Pattern • Iterator Pattern • Adapter Pattern 30 April, 2001 10
Summary and Discussion n (contd. ) Proxy Understanding How Http Request and Http Response are generated and Handled n Http Request and Response Headers n How different filtering can be implemented. n n Working in Team 30 April, 2001 11
- Slides: 11