CS4273: Distributed System Technologies and Programming Lecture 13: Review.

13
CS4273: Distributed System Technologies and Programming Lecture 13: Review

Transcript of CS4273: Distributed System Technologies and Programming Lecture 13: Review.

Page 1: CS4273: Distributed System Technologies and Programming Lecture 13: Review.

CS4273: Distributed System Technologies and Programming

Lecture 13: Review

Page 2: CS4273: Distributed System Technologies and Programming Lecture 13: Review.

2

Final Exam

1. When and where?

2. Exam Type?– Close book exam. No teaching materials are allowed.

3. What are the questions?– 2 hours work (the length of your answer should match the marks of the

question).

– 5 questions (mostly programming questions). Answer all the questions.

– Write your answers on the exam paper (use back side if extra space is needed).

4. How to prepare?– Understanding teaching materials, assignments, and tutorial questions.

Page 3: CS4273: Distributed System Technologies and Programming Lecture 13: Review.

3

WWW and Java programming

• HTTP protocol– Operations of the HTTP protocol

• GUI– Event handling model

– Programming of simple event handling

• Java applets – Applet life cycle,

– Applet methods and applet programming format,

– Parameter passing,

– Inter-applet communication.

Page 4: CS4273: Distributed System Technologies and Programming Lecture 13: Review.

4

Java Multi-thread Programming

• Thread definition & creation– Thread methods

– Multi-threaded applets & servers

• Thread mutual exclusion – Using keyword “synchronized”

• Thread coordination – Using wait() / notify() or notifyAll for thread coordination and

thread-execution control

– Thread programming with coordination and mutual exclusion

Page 5: CS4273: Distributed System Technologies and Programming Lecture 13: Review.

5

Socket Communication

• Client-server communication using sockets

• Stream socket (connection oriented) and UDP socket (connectionless)

• Applet and server communication using sockets

Page 6: CS4273: Distributed System Technologies and Programming Lecture 13: Review.

6

Web Searching

• Structure of web searching

• Spider operations (HTTP protocol)

• Web digraph

• Back links and backlink applications

• Page ranking

• Building inverted file for searching

Page 7: CS4273: Distributed System Technologies and Programming Lecture 13: Review.

7

CGI Programming

• CGI life cycle

• Applet and CGI servers (applet invokes CGI server)

• Data exchange between applets & CGI servers (input /output of applets & CGI)

• Design and execution of CGI servers

Page 8: CS4273: Distributed System Technologies and Programming Lecture 13: Review.

8

JDBC

• JDBC fundamentals

• 2-tier structure: Communication and data flow between– applet and DBMS

• 3-tier structure: Communication and data-flow between– applet and CGI,

– CGI and DBMS

• Servlet with JDBC for database access

Page 9: CS4273: Distributed System Technologies and Programming Lecture 13: Review.

9

Java Servlet

• Fundamental concepts of Java Servlet– Invocation of a servlet (servlet life cycle)

– Communication between servlet and applet / browser (HTML forms)

• HTTP Servlet Programming– Get / Post methods

– Input / Output of servlets

– Servlet cookies

– Servlet sessions

• Servlets as a middle tier of systems (DBMS, mail-server, etc.)

Page 10: CS4273: Distributed System Technologies and Programming Lecture 13: Review.

10

Security Programming

• Fundamentals of security– Authentication, secure data transmission, and access control– SSL and https– Certificates, their applications and verification

• Declarative security– Security configurations for authentication, servlets– BASIC method and FORM-based authentication– Switch to https

• Combined declarative and program security– Authentication by declarative method and access control by programming

method

• Pure program security– Authentication, access control and switch to https– Session tracking for authenticated users

Page 11: CS4273: Distributed System Technologies and Programming Lecture 13: Review.

11

JSP

• Fundamental concepts of JSP– Why JSP

– How is a jsp program executed

– How to start a jsp program

• Be able to understand and write simple JSP programs – Inclusion of “Java” code

– Parameter passing

– Use of library or Java beans

Page 12: CS4273: Distributed System Technologies and Programming Lecture 13: Review.

12

Remote Method Invocation (RMI)

• What is RMI (why to use RMI)?

• Programming by using RMI:– Interface definition

– Client side programming

– Server side programming

– Client – Server binding

• Steps of constructing, compiling, and executing clients & servers

• Applet and Server interaction by using RMI

Page 13: CS4273: Distributed System Technologies and Programming Lecture 13: Review.

13

An Example of Past Exam Question

3. [25 marks] Write a Java servlet that collects the order from clients and requests the mail server by using SMTP protocol to send the order to [email protected] as an email. Suppose the mail server is on machine “mail.cityu.edu.hk” and its port number is 25.

The following HTML form (the display image is given below) is used to take the mail orders from clients:<HTML><HEAD><TITLE>Mail Order Form </TITLE></HEAD><BODY><H1> Mail Order (please complete the order form)<FORM ACTION="http://sus16.cs.cityu.edu.hk/js/servlet/MailOrder" METHOD="POST"> Name <input name="customer" size=47> <p> Postal-Address <input name="address" size=40> <p> Product-Name <input name="product" size=40> <p> Quantity <input name="quantity" size=40> <p> <INPUT TYPE="submit" VALUE="Submit Your Order"></FORM></BODY></HTML>The servlet needs to reply the client after he/she submits the order, by displaying:

Your order is under processingThe email sent to the supplier should be in the form of:

The following order has been received: Customer-name Product-name: Quantity