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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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