Turtle Park is a thread-safe implementation of a client/server service to handle a theme park. The user, via four different command-line applications, can interact with the server, performing actions such as loading attractions, adding visitors, booking rides, getting statistics, and receiving notifications.
All client applications and the server are written in Java. The communication between them is carried out with gRPC.
- 1. Prerequisites
- 2. Compiling
- 3. Executing Turtle Park
- 4. Final Remarks
The following prerequisites are needed to run the server executable as well as the client applications:
- Maven
- Java 19
To compile the project and get all executables, cd into the root of the project, and run the following command:
mvn clean packageThis will create two .tar.gz files, that contain all of the files necessary to run the clients and the server respectively. Their location is:
- Client:
./client/target/tpe1-g2-client-1.0-SNAPSHOT-bin.tar.gz - Server:
./server/target/tpe1-g2-server-1.0-SNAPSHOT-bin.tar.gz
Unpack both the server and the client using:
tar -xf <file.tar.gz>
⚠️ From now on, it is assumed that the server files are located inside the./serverdirectory and the client files are located inside the./clientdirectory.
Then, give all executables the needed permissions to be executed:
chmod u+x ./client/*-cli ./server/turtle-parkMust be running for the clients to work. Once it's stopped, all stored data is flushed.
🚨 The current working directory must be
./server.
./turtle-park [ -Dport=XXXX ]
- The default port for the server is
7321, it can be overridden as shown above.
🚨 The current working directory must be
./client.
Three operations are supported:
./admin-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=rides -DinPath=./path.csv The path must point to a Comma Separated Values file, using ; as a delimiter. The file must have the following fields:
- Name (String)
- Opening time (HH:MM)
- Closing time (HH:MM)
- Slot size, in minutes (positive integer)
See below an example:
name;hoursFrom;hoursTo;slotGap
SpaceMountain;09:00;22:00;30
TronLightcycle;10:00;22:00;15
./admin-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=tickets -DinPath=./path.csv The path must point to a Comma Separated Values file, using ; as a delimiter. The file must have the following fields:
- Visitor ID (UUID)
- Ticket type (UNLIMITED | THREE | HALF_DAY)
- Day of year where the ticket is valid (positive integer)
See below an example:
visitorId;passType;dayOfYear
ca286ef0-162a-42fd-b9ea-60166ff0a593;UNLIMITED;100
2af16ea7-4af1-47f6-bf46-8515de5a500f;HALF_DAY;15
./admin-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=slots -Dday=XXX -Dride=XXXXXXXX -Dcapacity=XXX🚨 The current working directory must be
./client.
Five operations are supported:
./book-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=attractionsYou can get the availability for a specific day, slot and ride by:
./book-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=availability -Dday=XXX -Dride=XXXXXXXX -Dslot=XX:XXYou can also get the availability for a range of slots for the same attraction by:
./book-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=availability -Dday=XXX -Dride=XXXXXXXX -Dslot=XX:XX -DslotTo=XX:XXLastly, you can also get the availability for a range of slots for all of the attractions in the park by:
./book-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=availability -Dday=XXX -Dslot=XX:XX -DslotTo=XX:XX./book-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=book -Dday=XXX -Dvisitor=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -Dride=XXXXXXXX -Dslot=15:30./book-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=confirm -Dday=XXX -Dvisitor=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -Dride=XXXXXXXX -Dslot=15:30./book-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=cancel -Dday=XXX -Dvisitor=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -Dride=XXXXXXXX -Dslot=15:30🚨 The current working directory must be
./client.
Two operations are supported:
./notif-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=follow -Dday=XXX -Dvisitor=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -Dride=XXXXXXXXThe terminal where this command is running will be running until one of the following things occur:
- All of the bookings for the visitor are confirmed or cancelled
- The server receives an
unfollowrequest for the visitor - The user kills the process
./notif-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=unfollow -Dday=XXX -Dvisitor=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -Dride=XXXXXXXX🚨 The current working directory must be
./client.
Two operations are supported:
./query-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=capacity -Dday=XXX -DoutPath=./path.txt The path must point to a file that will be created or overridden, with the query results. The file will have the following fields in a table:
- Slot (HH:MM)
- Suggested capacity (positive integer)
- Attraction (String)
See below an example:
Slot | Capacity | Attraction
13:00 | 27 | Tron Lightcycle
12:45 | 23 | Space Mountain
09:00 | 0 | The Hall of Presidents
./query-cli -DserverAddress=XX.XX.XX.XX:YYYY -Daction=confirmed -Dday=XXX -DoutPath=./path.txt The path must point to a file that will be created or overridden, with the query results. The file will have the following fields in a table:
- Slot (HH:MM)
- Visitor ID (UUID)
- Attraction (String)
See below an example:
Slot | Visitor | Attraction
15:30 | ca286ef0-162a-42fd-b9ea-60166ff0a593 | Space Mountain
13:00 | ca286ef0-162a-42fd-b9ea-60166ff0a593 | Tron Lightcycle
13:00 | 2af16ea7-4af1-47f6-bf46-8515de5a500f | Tron Lightcycle
This project was done in an academic environment, as part of the curriculum of Distributed Objects Programming from Instituto Tecnológico de Buenos Aires (ITBA)
The project was carried out by:
- Alejo Flores Lucey
- Andrés Carro Wetzel
- Nehuén Gabriel Llanos