Package com.se21.calbot.controllers
Class Controller
java.lang.Object
com.se21.calbot.controllers.Controller
This is main controller class for whole aPAS. In block diagram of architecture, you can see this
class at the center. It serves various purposes, but major functionality is to provide some
algorithm to suggest most optimal activities to be done by user.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) CalendarFactory
(package private) Enums.calendarType
(package private) String
(package private) Calendar
(package private) String
(package private) Enums.operationType
(package private) TokensRepository
(package private) User
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis function contains the logic to re-arrange all events on the basis of priority and suggest most optimal ones for today/week.dataOperation(Enums.operationType opType, String... msgParam)
This is single interface function for clientManager layer to directly call some CRUD operation for calendar layer.To get URL for OAUTH 2.0void
It will create a new entry in db for current user if it already doesn't exist.
-
Field Details
-
clientId
String clientId -
calendarId
Enums.calendarType calendarId -
calendarToken
String calendarToken -
operationId
Enums.operationType operationId -
calObj
Calendar calObj -
calendarFactory
-
tokensRepository
-
user
User user
-
-
Constructor Details
-
Controller
public Controller()
-
-
Method Details
-
initDb
It will create a new entry in db for current user if it already doesn't exist. Else it will retrieve all existing data from db.- Parameters:
discordId
-
-
arrangeEvents
This function contains the logic to re-arrange all events on the basis of priority and suggest most optimal ones for today/week.- Returns:
- Throws:
Exception
-
dataOperation
This is single interface function for clientManager layer to directly call some CRUD operation for calendar layer.- Parameters:
opType
- Add, delete, Retrieve.......etc.msgParam
- the user given parameters- Returns:
- Output received after operation execution
-
getUrl
To get URL for OAUTH 2.0- Parameters:
discordId
-calType
-- Returns:
- URL
-