Package org.ametys.plugins.bluemind
Class BluemindConnector
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.messagingconnector.AbstractMessagingConnector
-
- org.ametys.plugins.bluemind.BluemindConnector
-
- All Implemented Interfaces:
MessagingConnector
,LogEnabled
,Initializable
,Component
,Serviceable
public class BluemindConnector extends AbstractMessagingConnector
The connector used by the messaging connector plugin when the bluemind mail server is used. Implements the methods of the MessagingConnector interface in order to get the informations from the mail server
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.plugins.messagingconnector.MessagingConnector
MessagingConnector.AttendeeInformation, MessagingConnector.FreeBusyStatus, MessagingConnector.ResponseType
-
-
Field Summary
Fields Modifier and Type Field Description protected String
_adminLogin
The administrator login.protected String
_apiKey
An API key generated by the above administrator account.protected String
_bmCoreUrl
The bluemind server core URL (for instance http://bluemind.myserver.com/services)protected String
_domain
The BlueMind domain (for instance myserver.com)protected net.bluemind.core.rest.http.ClientSideServiceProvider
_serviceProvider
The serviceProvider to establish the connection-
Fields inherited from class org.ametys.plugins.messagingconnector.AbstractMessagingConnector
_cryptoHelper, _currentUserProvider, _userPopulationDAO, _userPref
-
Fields inherited from interface org.ametys.plugins.messagingconnector.MessagingConnector
ROLE
-
-
Constructor Summary
Constructors Constructor Description BluemindConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private net.bluemind.core.rest.http.ClientSideServiceProvider
_getServiceUserProvider(UserIdentity userIdentity)
private String
_getUserAuthKey(UserIdentity userIdentity)
protected Map<String,Object>
getEventsInfo(UserIdentity userIdentity, int maxDays)
Get the events information from the bluemind server.void
initialize()
protected List<EmailMessage>
internalGetEmails(UserIdentity userIdentity, int maxEmails)
Get emails (no caching)protected int
internalGetEmailsCount(UserIdentity userIdentity)
Get emails count (no caching)protected List<CalendarEvent>
internalGetEvents(UserIdentity userIdentity, int maxDays, int maxEvents)
Get upcoming events (no caching)protected int
internalGetEventsCount(UserIdentity userIdentity, int maxDays)
Get upcoming events count (no caching)-
Methods inherited from class org.ametys.plugins.messagingconnector.AbstractMessagingConnector
createEvent, deleteEvent, getAllowedPopulationIds, getAttendees, getEvents, getEventsCount, getFreeBusy, getUnreadEmailCount, getUnreadEmails, getUserCryptedPassword, getUserPassword, internalCreateEvent, internalDeleteEvent, internalGetAttendees, internalGetFreeBusy, internalIsEventExist, internalSetAttendees, internalUpdateEvent, isAllowed, isEventExist, isUserExist, service, setAttendees, setUserPassword, supportInvitation, supportUserCredential, updateEvent, userCredentialNeeded
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_bmCoreUrl
protected String _bmCoreUrl
The bluemind server core URL (for instance http://bluemind.myserver.com/services)
-
_adminLogin
protected String _adminLogin
The administrator login.
-
_serviceProvider
protected net.bluemind.core.rest.http.ClientSideServiceProvider _serviceProvider
The serviceProvider to establish the connection
-
-
Constructor Detail
-
BluemindConnector
public BluemindConnector()
-
-
Method Detail
-
initialize
public void initialize()
- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classAbstractMessagingConnector
-
_getUserAuthKey
private String _getUserAuthKey(UserIdentity userIdentity)
-
_getServiceUserProvider
private net.bluemind.core.rest.http.ClientSideServiceProvider _getServiceUserProvider(UserIdentity userIdentity)
-
getEventsInfo
protected Map<String,Object> getEventsInfo(UserIdentity userIdentity, int maxDays) throws MessagingConnectorException
Get the events information from the bluemind server.- Parameters:
userIdentity
- the user identity.maxDays
- The maximum number of days from now to search the events- Returns:
- the events information as a Map.
- Throws:
MessagingConnectorException
- if an error occurs.
-
internalGetEvents
protected List<CalendarEvent> internalGetEvents(UserIdentity userIdentity, int maxDays, int maxEvents) throws MessagingConnectorException
Description copied from class:AbstractMessagingConnector
Get upcoming events (no caching)- Specified by:
internalGetEvents
in classAbstractMessagingConnector
- Parameters:
userIdentity
- The user identitymaxDays
- The maximum number of days to search formaxEvents
- The maximum number of events to retrieve- Returns:
- The calendar events
- Throws:
MessagingConnectorException
- if failed to get events from server
-
internalGetEventsCount
protected int internalGetEventsCount(UserIdentity userIdentity, int maxDays) throws MessagingConnectorException
Description copied from class:AbstractMessagingConnector
Get upcoming events count (no caching)- Specified by:
internalGetEventsCount
in classAbstractMessagingConnector
- Parameters:
userIdentity
- The user identitymaxDays
- The maximum number of days to search for- Returns:
- The number of calendar events
- Throws:
MessagingConnectorException
- if failed to get events from server
-
internalGetEmails
protected List<EmailMessage> internalGetEmails(UserIdentity userIdentity, int maxEmails) throws MessagingConnectorException
Description copied from class:AbstractMessagingConnector
Get emails (no caching)- Specified by:
internalGetEmails
in classAbstractMessagingConnector
- Parameters:
userIdentity
- The user identitymaxEmails
- The maximum number of emails to retrieve- Returns:
- The emails
- Throws:
MessagingConnectorException
- if failed to get events from server
-
internalGetEmailsCount
protected int internalGetEmailsCount(UserIdentity userIdentity) throws MessagingConnectorException
Description copied from class:AbstractMessagingConnector
Get emails count (no caching)- Specified by:
internalGetEmailsCount
in classAbstractMessagingConnector
- Parameters:
userIdentity
- The user identity- Returns:
- The emails count
- Throws:
MessagingConnectorException
- if failed to get events from server
-
-