Package com.logicaldoc.google
Class CalendarClient
java.lang.Object
com.logicaldoc.google.GoogleClient
com.logicaldoc.google.CalendarClient
Facade for Google Calendar.
To handle the API: https://console.developers.google.com
- Since:
- 78.9.4
- Author:
- Marco Meschieri - LogicalDOC
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteEvent
(String eventId) Deletes a remote eventstatic CalendarClient
Retrieves all the upcoming events from the remote calendar synchronising at the same time the local counterpartsPublishes a local event to the remote calendar, if the event does not exist it is created otherwise it gets synchronized.void
Synchronizes the local calendar with the Google oneMethods inherited from class com.logicaldoc.google.GoogleClient
connect, getAccessToken, getRefreshToken, getUserName, isConnected, loadSettings
-
Method Details
-
get
public static CalendarClient get(String name) throws com.logicaldoc.core.PersistenceException, com.logicaldoc.util.security.StringEncrypter.EncryptionException, IOException - Throws:
com.logicaldoc.core.PersistenceException
com.logicaldoc.util.security.StringEncrypter.EncryptionException
IOException
-
getUpcomingEvents
public List<Event> getUpcomingEvents() throws IOException, com.logicaldoc.core.PersistenceException, ParseExceptionRetrieves all the upcoming events from the remote calendar synchronising at the same time the local counterparts- Returns:
- The local future calendar events
- Throws:
IOException
- Error in the I/Ocom.logicaldoc.core.PersistenceException
- Error in the data layerParseException
- Error parting the dates
-
deleteEvent
Deletes a remote event- Parameters:
eventId
- Identifi3er of the event to delete- Throws:
IOException
- Error in the I/O
-
pushEvent
public String pushEvent(Event localEvent) throws IOException, com.logicaldoc.core.PersistenceException, ParseException Publishes a local event to the remote calendar, if the event does not exist it is created otherwise it gets synchronized.- Parameters:
localEvent
- The local event to publish- Returns:
- The external identifier of the remote event
- Throws:
IOException
- Error in the I/Ocom.logicaldoc.core.PersistenceException
- Error in the data layerParseException
- Error in the JSON manipulation
-
synchronize
public void synchronize() throws com.logicaldoc.core.PersistenceException, IOException, ParseExceptionSynchronizes the local calendar with the Google one- Throws:
ParseException
- Exception parsing the datesIOException
- Generic I/O errorcom.logicaldoc.core.PersistenceException
- Error in the data layer
-