Search in sources :

Example 1 with ExchangeUserResolver

use of com.zimbra.cs.fb.ExchangeFreeBusyProvider.ExchangeUserResolver in project zm-mailbox by Zimbra.

the class ExchangeEWSFreeBusyProvider method addFreeBusyRequest.

@Override
public void addFreeBusyRequest(Request req) throws FreeBusyUserNotFoundException {
    ServerInfo info = null;
    for (ExchangeUserResolver resolver : sRESOLVERS) {
        String email = req.email;
        if (req.requestor != null)
            email = req.requestor.getName();
        info = resolver.getServerInfo(email);
        if (info != null) {
            if (!info.enabled)
                throw new FreeBusyUserNotFoundException();
            if (null == service) {
                try {
                    initService(info);
                } catch (MalformedURLException e) {
                    ZimbraLog.fb.warn("failed to initialize provider", e);
                }
            }
            break;
        }
    }
    if (info == null)
        throw new FreeBusyUserNotFoundException();
    addRequest(info, req);
}
Also used : MalformedURLException(java.net.MalformedURLException) ExchangeUserResolver(com.zimbra.cs.fb.ExchangeFreeBusyProvider.ExchangeUserResolver) ServerInfo(com.zimbra.cs.fb.ExchangeFreeBusyProvider.ServerInfo)

Aggregations

ExchangeUserResolver (com.zimbra.cs.fb.ExchangeFreeBusyProvider.ExchangeUserResolver)1 ServerInfo (com.zimbra.cs.fb.ExchangeFreeBusyProvider.ServerInfo)1 MalformedURLException (java.net.MalformedURLException)1