Distributed Computing (5)-restful client Programming

Source: Internet
Author: User

1. Write the curl corresponding to the execution // sent http put request to update Customer Info In experiment 1 and the output result.

Curl-v-h "Content-Type: Application/XML"-d "<? XML version = '1. 0'?> <Customer> <Name> Mary </Name> <ID> 123 </ID> </customer> "-x put" http: // localhost: 9000/customerservice/Mers MERs"

 

 

 

2. Briefly describe the process of executing the corresponding program in question 1.

 

 

 

3. In experiment 1, briefly describe the role of the uriresolver class?

Convert the input address string to a URL with a file type

 

4. In experiment 1, what is the role of the cachedoutputstream class?

As the data buffer, read a certain number of bytes from the input stream and store them in the buffer, without the need to read the Input Source cyclically.

 

5. Translate Jersey document 5.1. uniform interface constraint's five targets.

1. The structure should be easy to understand and maintain. And can be upgraded, with low coupling. The client and service can be upgraded over time and requires backward compatibility.

2. Each resource is identified by a URI.

3. The client uses a fixed set of HTTP methods for interaction with resources through HTTP requests and responses.

4. One or more proxies can be returned and identified by media types.

5. content can be connected to more in-depth resources.

 

6. Briefly describe the role of the uribuilder class mentioned in Article 5.2 in Experiment 2.

Allows you to create Uris from different resources and modify the URI instance.

 

7. Read the official documentation of experiment 3 and State motivation for reactive client in your own language (Chinese.

The reactive method is a way to get rid of the Java callback hell, based on the concept of data stream and over-stream to change the propagation of the execution model. After the Jax-Rs request is complete, the next project (or user code) in the data stream is declared as a continuation, completion, or failure. You describe what to do next instead of how to trigger the next action. A data stream can be combined. Multiple Data streams can be combined into one result and operated on.

When we need to process a large number of requests (mutual dependencies) and make the request into a result, reactive programming mode is a good choice.

 

8 (!) A runable lab program is provided, which is included in the job.

9. Read the official documentation of Experiment 4. Why do I have to declare interfaces before writing Web Services in Java? Normally, such an interface must be placed in an independent Java file.

Defines a series of public interfaces that can be implemented by multiple sub-classes to facilitate future expansion, maintenance, and save effective time. The same interface can be implemented differently without interfering with each other.

 

10 what is the role of the jaxrsclientfactory class?

Create a proxy client.

 

11. Briefly describe the role of transparent proxy.

User A and user B do not know that the behavior management device acts as a transparent proxy. When user a or user B submits a request to server a or server B, the transparent proxy device intercepts and modifies User A or B's packets according to its own policies, and sends requests to server a or server B as the actual requester. When receiving information, the transparent proxy then sends the allowed packets back to user a or user B according to its own settings. If the transparent proxy settings do not allow access to server B, user A or user B will not get data from server B.

 

Distributed Computing (5)-restful client Programming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.