public class Main
extends javafx.application.Application
Modifier and Type | Field and Description |
---|---|
(package private) static java.io.ObjectInputStream |
in
Input stream connected through Socket, acts to get commands from server.
|
(package private) static java.io.ObjectOutputStream |
out
Output stream connected through Socket, acts to send commands to server.
|
(package private) static java.net.Socket |
server
Socket object to hold communication with Server
|
static TimeTable |
tt
TimeTable object to store the timetable in RAM.
|
static User |
u
User object to determine the current user in our client.
|
Constructor and Description |
---|
Main() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
acceptBookings(Slot k)
Command from admin to accept a request.
|
static java.lang.String |
addDropCourse(java.lang.String l)
Method to toggle Register/De-register for a course for the current user.
|
static boolean |
auditRoomBooking(ExtraSlot s)
The replacement booking for an already existing slot.
|
static boolean |
authenticate(java.lang.String email,
java.lang.String pass)
This method will authenticate whether the user is the required person or not
In case user is the person, place the user in the static user object for further use
|
static void |
connectAndInitialise()
This function will connect to the database and set up and initialise required objects
|
static void |
deleteBookings(Slot k)
Request the server to delete a booking.
|
static void |
exit()
Do up cleaning stuff and exit the Client application.
|
static java.util.List<Slot> |
getBookings()
Return all the bookings done by the current user
Contains all bookings by all users if called by Admin.
|
static java.util.List<Slot> |
getRequests()
Returns All the pending Requests for the Admin.
|
static void |
main(java.lang.String[] args)
This method will initialize connections with the server and will hand-over control to the JavaFX engine
|
static java.util.List<Course> |
requestCourses()
Return a list of all the courses.
|
static boolean |
requestRoomBooking(ExtraSlot s)
Request the server to book a particular room.
|
static void |
requestTimeTable()
Get's Time Table over the Socket
|
static boolean |
signUp(User x)
This method will sign-up the user if possible, and return false otherwise
|
void |
start(javafx.stage.Stage primaryStage)
Entry point for the GUI application.
|
static void |
updateUser()
Deprecated Method for updating User.
|
static void |
userPut()
Deprecated Method.
|
public static volatile TimeTable tt
public static volatile User u
static volatile java.net.Socket server
static volatile java.io.ObjectOutputStream out
static volatile java.io.ObjectInputStream in
public void start(javafx.stage.Stage primaryStage)
start
in class javafx.application.Application
public static void requestTimeTable() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
- When Socket is closed or Object cannot be serializedjava.lang.ClassNotFoundException
- When object could not be read properlypublic static boolean requestRoomBooking(ExtraSlot s) throws java.io.IOException, java.lang.ClassNotFoundException
s
- This is the slot that needs to be bookedjava.io.IOException
- When Socket is closed or Object cannot be serializedjava.lang.ClassNotFoundException
- When object could not be read properlypublic static boolean auditRoomBooking(ExtraSlot s) throws java.io.IOException, java.lang.ClassNotFoundException
s
- New slot, that will be replaced.java.io.IOException
- When Socket is closed or Object cannot be serializedjava.lang.ClassNotFoundException
- When object could not be read properly.public static java.util.List<Slot> getRequests() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
- When Socket is closed or Object cannot be serializedjava.lang.ClassNotFoundException
- When object could not be read properly.public static java.util.List<Slot> getBookings() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
- When Socket is closed or Object cannot be serializedjava.lang.ClassNotFoundException
- When object could not be read properly.public static void deleteBookings(Slot k) throws java.io.IOException
k
- The slot to be deleted.java.io.IOException
- When Socket is closed or Object cannot be serializedpublic static java.lang.String acceptBookings(Slot k) throws java.io.IOException, java.lang.ClassNotFoundException
k
- The slot for which to accept.java.io.IOException
- When Socket is closed or Object cannot be serializedjava.lang.ClassNotFoundException
- When object could not be read properlypublic static void userPut() throws java.io.IOException
java.io.IOException
- When Socket is closed or Object cannot be serializedpublic static void updateUser() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
- When Socket is closed or Object cannot be serializedjava.lang.ClassNotFoundException
- When object could not be read properlypublic static java.lang.String addDropCourse(java.lang.String l) throws java.io.IOException, java.lang.ClassNotFoundException
l
- The course acronym for which registration/de-registration will occur.java.io.IOException
- When Socket is closed or Object cannot be serializedjava.lang.ClassNotFoundException
- When object could not be read properlypublic static java.util.List<Course> requestCourses() throws java.lang.ClassNotFoundException, java.io.IOException
java.lang.ClassNotFoundException
- When object could not be read properlyjava.io.IOException
- When Socket is closed or Object cannot be serializedpublic static void connectAndInitialise()
public static boolean signUp(User x) throws java.io.IOException, java.lang.ClassNotFoundException
x
- The user who needs to be registered.java.io.IOException
- When object could not be read properlyjava.lang.ClassNotFoundException
- When object could not be read properlypublic static boolean authenticate(java.lang.String email, java.lang.String pass) throws java.io.IOException, java.lang.ClassNotFoundException
email
- The Email Id of person to authenticatepass
- The password of person to authenticatejava.io.IOException
- When Socket is closed or Object cannot be serializedjava.lang.ClassNotFoundException
- When object could not be read properlypublic static void main(java.lang.String[] args) throws java.io.IOException
args
- Not used.java.io.IOException
- When Socket is closed or Object cannot be serializedpublic static void exit()