COMP6231 Distributed Systems Design Assignment

Assignment Help JAVA Programming
Reference no: EM133076737

COMP6231 Distributed Systems Design - Concordia University

Distributed Appointment Management System (DAMS) using Java RMI

In this assignment, you are going to implement a distributed appointment management system (DAMS) for health care: a distributed system used by hospital admins to manage the information about medical appointments and patients to book or cancel a medical appointment across different hospitals within the medicare system.

Consider three hospitals in different cities: Montreal (MTL), Quebec (QUE) and Sherbrooke (SHE) for your implementation. The users of the system are hospital's appointment admins and appointment booking patients. Admins and Patients are identified by a unique adminID and patientID respectively, which is constructed from the acronym of their hospital's city and a 4-digit number (e.g. MTLA2345 for an admin and MTLP2345 for a patient). Whenever the user performs an operation, the system must identify the server to which the user belongs by looking at the ID prefix (i.e. MTLA or MTLP identifies the server for Montreal) and performs the operation on that server. The user should also maintain a log (text file) of the actions they performed on the system and the response from the system when available. For example, if you have 10 users using your system, you should have a folder containing 10 logs.

In this DAMS, there are different admins for 3 different servers. They create appointment slots corresponding to the appointment type as per the availability of doctors. There are three appointment types for which slots can be created: Physician, Surgeon and Dental. A patient can book an appointment in any of the hospital, for any appointment type, if the appointment is available for booking (if the appointment slots corresponding to an appointment on a particular date is not yet full). A server (which receives the request) maintains a booking- count for every patient. A patient cannot book more than one appointment with the same appointment id and same appointment type. Also, a patient is not allowed to have more than one booking of same appointment type in a day. There are three time slots available for each appointment type on a day: Morning (M), Afternoon (A) and Evening (E). An appointmentID is a combination of city, time slot and appointment date (e.g. MTLM100222 for a morning appointment on 10th February 2022 in Montreal, QUEA151022 for an afternoon appointment on 15th October 2022 in Quebec and SHEE201122 for an evening appointment on 20th November 2022 in Sherbrooke). You should ensure that if the availability of an appointment is full, more patients cannot book the appointment. Also, a patient can book as many appointments in his/her own city, but only at most 3 appointments from other cities overall in a week.

The appointment records are maintained in a hashmap as shown in Figure 1. Here appointment type is the key, while the value is again a sub-hashmap. The key for sub- hashmap is the appointmentID, while the value of the sub-hashmap is the information about the appointment.

Each server also maintains a log file containing the history of all the operations that have been performed on that server. This should be an external text file (one per server) and shall provide as much information as possible about what operations are performed, at what time and who performed the operation. These are some details that a single log file record must contain:
• Date and time the request was sent.
• Request type (book an appointment, cancel an appointment, etc.).
• Request parameters (patientID, appointmentID, etc.).
• Request successfully completed/failed.
• Server response for the particular request.

Admin Role:

The operations that can be performed by an admin are the following:
• addAppointment (appointmentID, appointmentType, capacity):
When an admin invokes this method through the server associated with this admin (determined by the unique adminID prefix), attempts to add an appointment with the information passed, and inserts the record at the appropriate location in the hashmap. The server returns information to the admin whether the operation was successful or not and both the server and the client store this information in their logs. If an appointment already exists for same appointment type, the admin can't add it again for the same appointment type. If an appointment does not exist in the database for that appointment type, then add it. Log the information into the admin log file.
• removeAppointment (appointmentID, appointmentType):
When invoked by an admin, the server associated with that admin (determined by the unique adminID) searches in the hashmap to find and delete the appointment for the indicated appointmentType. Upon success or failure, it returns a message to the admin and the logs are updated with this information. If an appointment does not exist, then obviously there is no deletion performed. Just in case that, if an appointment exists and a patient has booked that appointment, then, delete the appointment and book the next available appointment for that patient. Log the information into the log file.
• listAppointmentAvailability (appointmentType):
When an admin invokes this method from his/her hospital/city through the associated server, that hospital/city server concurrently finds out the number of spaces available for each appointment in all the servers, for only the given appointmentType. This requires inter server communication that will be done using UDP/IP sockets and result will be returned to the client. Eg: Surgeon - MTLE131122 3, QUEA061222 6, SHEM181122 0, MTLE191222

Patient Role:

The operations that can be performed by a patient are the following:
• bookAppointment (patientID, appointmentID, appointmentType):
When a patient invokes this method from his/her city through the server associated with this patient (determined by the unique patientID prefix) attempts to book the appointment for the patient and change the capacity left in that appointment. Also, if the booking was successful or not, an appropriate message is displayed to the patient and both the server and the client stores this information in their logs.
• getAppointmentSchedule (patientID):
When a patient invokes this method from his/her city's hospital through the server associated with this patient, that city's branch server gets all the appointments booked by the patient and display them on the console. Here, appointments from all the cities, Montreal, Quebec and Sherbrooke, should be displayed.
• cancelAppointment (patientID, appointmentID):

When a patient invokes this method from his/her city's hospital through the server associated with this patient (determined by the unique patientID prefix) searches the hash map to find the appointmentID and remove the appointment. Upon success or failure, it returns a message to the patient and the logs are updated with this information. It is required to check that the appointment can only be removed if it was booked by the same customer who sends cancel request.

Thus, this application has a number of servers (one per city) each implementing the above operations for that hospital, PatientClient invoking the patient's operations at the associated server as necessary and AdminClient invoking the admin's operations at the associated server. When a server is started, it registers its address and related/necessary information with a central repository. For each operation, the PatientClient/AdminClient finds the required information about the associated server from the central repository and invokes the corresponding operation. Your server should ensure that a patient can only perform a patient operation and cannot perform any admin operations, but an admin can perform all operations.

In this assignment, you are going to develop this application using Java RMI. Specifically, do the following:
• Write the Java RMI interface definition for the server with the specified operations.
• Implement the server.
• Design and implement a PatientClient, which invokes the server system to test the correct operation of the DAMS invoking multiple servers (each of the servers initially have few records) and multiple patients.
• Design and implement an AdminClient, which invokes the server system to test the correct operation of the DAMS invoking multiple servers (each of the servers initially have few records) and multiple admins.

You should design the server maximizing concurrency. In other words, use proper synchronization that allows multiple users to perform operations for the same or different records at the same time.

Attachment:- Distributed Systems Design.rar

Reference no: EM133076737

Questions Cloud

Intuition in making management decisions : Q1 Explains Would a car insurance company or a car manufacturer benefit more from the use of data mining? Explain your answer.
Compute the value of depreciation recorded : Superior Vacations bought a new apartment building on December 16, 2017. The building was rented out to families on June 5, 2018. The building cost 639,593 doll
Breach of implied warranty of merchantability : Ben Miller purchased a new and expensive Whirlpool gas range home use from Corona Appliances, the local appliance store. The range malfunctioned and exploded du
What is vera tax basis in her columbus shares : At the beginning of the current year, Vera's tax basis in her Columbus shares was $25,000. What is Vera tax basis in her Columbus shares
COMP6231 Distributed Systems Design Assignment : COMP6231 Distributed Systems Design Assignment Help and Solution, Concordia University - Assessment Writing Service
What is the amount of the semi-annual interest payments : The present value of the bond is $37,282,062 and the market rate of interest was 8%. What is the amount of the semi-annual interest payments
Easily manipulated to present biased opinion : Statistics can be easily manipulated to present a biased opinion. Explain how it is easy to be mislead by statistics.
Dimensions of statistical reasoning : Discuss the four dimensions of statistical reasoning / thinking used in statistical inquiry.
Find the fair value of plan assets at December : The settlement rate is 10%. Other data related to the pension plan for 2020 are: Service cost $300,000. Find the fair value of plan assets at December

Reviews

len3076737

1/30/2022 9:49:50 PM

I needed some help with my Java rmi project. Can you please let me know if you are available for helping in my project this week and also please tell me how much you would charge for it. Looking forward to hearing from you

Write a Review

JAVA Programming Questions & Answers

  An api for a library that provides for all these operations

Quaternions can be represented with four (4) real numbers (a,b,c,d). They can be added, subtracted, multiplied and divided. You can multiply a quaternion by a scalar (which produces a quaternion as a result)

  EE509 Discrete-Event Simulation of a Random Early Detection

EE509 Discrete-Event Simulation of a Random Early Detection Assignment Help and Solution, Assessment Writing Service - Modelling a Queue with No Loss

  Write a program using java script to convert a currency

Write a program using Java Script to convert a currency from dollars onto euro. If the rate of conversion is for each Euro 1.8 dollars. The use shall continue to convers as long as he/she desire to do so. Also print output via a message box

  Develop and re-wrap the trivial console application

COS30016/HIT3037 Programming in Java - Develop and re-wrap the trivial console application into a GUI Application which allows the users to perform similar operations as indicated in assignment 1 handout.

  Wrappershallow and wrapperdeep

Each class is simply a wrapper class to hold a private array variable. int [] a; The default constructor for each class should initialize â??aâ??. Each class should have a toString() and equals(). Each class should have a setArray method that allows ..

  Class pointparameters

What is the output of the following Java program? Explain in terms of how parameters are passed in Java.import java.awt.*;class PointParameters

  Write java statements that use a for each loop to cycle

Write java statements that use a for each loop to cycle through all the elements in an ArrayList of doubles named grades.

  Describe a scenario where you use a class

Describe a scenario where you use a class to obtain user input in a Java program. Explain whether the Scanner class or the JOptionPane class

  Describe a specific made-up situation

For each of these possibilities, describe a specific made-up situation (what is the program, what are the classes) where it would be the right choice

  Which weblogic property is used to control number of queued

Which WebLogic 4.5x/5.x property is used to control the number of queued requests inside the WebLogic server? When I try load *.jsp files, I see the source code of each JSP files in my browser, what is wrong?

  Implement class that can be player in a game of tic tac toe

Specify, design, and implement a class that can be one player in a game of tic-toc-toe. The constructor should be specify whether the object is to be the first player (X's) or the second player (O's).

  Create an array of integers at random

create an array of integers at random with a range of 0 through 1000 in Java... any hints?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd