Package com.se21.calbot.interfaces
Interface Calendar
- All Known Implementing Classes:
GoogleCalendarService
public interface Calendar
This interface provides basic functionality for Calendar classes
-
Method Summary
Modifier and TypeMethodDescriptionAdds event to calendar, currently you can only add unscheduled events i.e.authenticate(String id)
It serves any authenticate requestCreate a new Unscheduled calendar in user's selected calendarDeletes one or some eventorg.json.JSONObject
retrieveEvents(String calId)
Retrieves event from calendarvoid
saveAccessToken(String code, String id)
Saves received access token to db and perform some basic functionalities like getting access token and refresh token further.void
This is temporary function, until spring session variables are not maintainedupdateEvents(org.json.simple.JSONObject req)
Updates existing events to calendar
-
Method Details
-
authenticate
It serves any authenticate request- Parameters:
id
- User unique identifier- Returns:
- URL for authentication
-
saveAccessToken
Saves received access token to db and perform some basic functionalities like getting access token and refresh token further.- Parameters:
code
- auth codeid
- user Id
-
retrieveEvents
Retrieves event from calendar- Parameters:
calId
- calendar id(One google calendar can have multiple calendars at same time)- Returns:
- JSON objects of calendar returned events
- Throws:
Exception
-
updateEvents
Updates existing events to calendar- Parameters:
req
- type is JSON object, exact parameters not yet decided, but can be changed based on different type of calendars- Returns:
- response from calendar
-
addEvents
Adds event to calendar, currently you can only add unscheduled events i.e. when there is no start date but only deadline and number of hours need to be dedicated- Parameters:
title
- Event titlehours
- Number of hours to be dedicateddeadline
- deadline for this activity- Returns:
- Calendar response
-
deleteEvents
Enums.calApiResponse deleteEvents()Deletes one or some event- Returns:
- Calendar response
-
createNewUnscheduledCalendar
Enums.calApiResponse createNewUnscheduledCalendar()Create a new Unscheduled calendar in user's selected calendar- Returns:
- Calendar response
-
setUserVariable
void setUserVariable()This is temporary function, until spring session variables are not maintained
-