Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We would like to implement the following system using REST Services. Multiple Web services (called participants) are competing for the use of common resource (e.g.,

We would like to implement the following system using REST Services.

Multiple Web services (called participants) are competing for the use of common resource (e.g., a high performance computer on the cloud). However, we assume that at most one service has access to the resource at given time. For that purpose, we use a third-party REST services, called synchronizer, to synchronize access to that resource as described below.

All participants that are interested in accessing the common resource have to initially register with the synchronizer.

Each time a participant P wants to access the resource, it sends a reserve request to the synchronizer. The request includes the service ID and duration of use. The synchronizer checks whether the resource is available. If the resource is available, it replies to P with a ticket (i.e., password) that grants access to P; the synchronizer marks the resource as busy. If the resource is unavailable, it executes an internal algorithm to estimate the waiting time for P. Then it replies to P with the estimated waiting time. o P has to send a follow-up message stating whether it agrees to wait or not along with the service ID. If P agrees to wait, the synchronizer puts P in a local waiting list and replies with acknowledgement message back to P; If P does not agree to wait, the synchronizer discards Ps request and replies with a discarded message.

Whenever a participant is done using the resource, it sends a release message to the synchronizer. The synchronizer uses an internal policy to select the next service (e.g., FIFO) and sends an access ticket (i.e., password) to the selected participant.

Just need text answers for the below questions

For simplicity, we assume that there is no fault/failure in the system.

1. Give the REST API of Synchronizer. For each API, provide the following: a. The protocol used (GET or POST). b. The URL (you do not need to give actual URL. c. A short text description (one or two sentences) of what the API does. d. The XML structure of the input message (sent to the API as request) and output message (result sent back by the API). e. Who invokes the API (e.g., participant, coordinator, etc.)

2. Give the REST API of each participant. For each API, provide the following: a. The protocol used (GET or POST). b. The URL (you do not need to give actual URL. c. A short text description (one or two sentences) of what the API does. d. The XML structure of the input message (sent to the API as request) and output message (result sent back by the API). e. Who invokes the API (e.g., participant, coordinator, etc.)

3. Give a UML sequence diagram showing the execution of the system for 3 participants. Assume the requests to access the resources are received in this order: 1, 2, 3. Also, assume that access to the resource is granted in this order: 1, 3, 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What tools might be helpful?

Answered: 1 week ago