Search in sources :

Example 1 with GetFolderResponseType

use of com.microsoft.schemas.exchange.services._2006.messages.GetFolderResponseType in project zm-mailbox by Zimbra.

the class ExchangeEWSFreeBusyProvider method bindFolder.

BaseFolderType bindFolder(DistinguishedFolderIdNameType distinguishedFolderId, DefaultShapeNamesType shapeType) {
    final DistinguishedFolderIdType distinguishedFolderIdType = new DistinguishedFolderIdType();
    distinguishedFolderIdType.setId(distinguishedFolderId);
    final NonEmptyArrayOfBaseFolderIdsType nonEmptyArrayOfBaseFolderIdsType = new NonEmptyArrayOfBaseFolderIdsType();
    nonEmptyArrayOfBaseFolderIdsType.getFolderIdOrDistinguishedFolderId().add(distinguishedFolderIdType);
    GetFolderType getFolderRequest = new GetFolderType();
    getFolderRequest.setFolderIds(nonEmptyArrayOfBaseFolderIdsType);
    FolderResponseShapeType stResp = new FolderResponseShapeType();
    stResp.setBaseShape(shapeType);
    getFolderRequest.setFolderShape(stResp);
    RequestServerVersion serverVersion = new RequestServerVersion();
    serverVersion.setVersion(ExchangeVersionType.EXCHANGE_2010_SP_1);
    Holder<ServerVersionInfo> gfversionInfo = new Holder<ServerVersionInfo>();
    Holder<GetFolderResponseType> gfresponseHolder = new Holder<GetFolderResponseType>();
    MailboxCultureType mct = new MailboxCultureType();
    mct.setValue("EN");
    TimeZoneDefinitionType tzdt = new TimeZoneDefinitionType();
    tzdt.setId("Greenwich Standard Time");
    TimeZoneContextType tzct = new TimeZoneContextType();
    tzct.setTimeZoneDefinition(tzdt);
    ManagementRoleType role = null;
    service.getFolder(getFolderRequest, mct, serverVersion, tzct, role, gfresponseHolder, gfversionInfo);
    FolderInfoResponseMessageType firmtResp = (FolderInfoResponseMessageType) gfresponseHolder.value.getResponseMessages().getCreateItemResponseMessageOrDeleteItemResponseMessageOrGetItemResponseMessage().get(0).getValue();
    if (firmtResp.getFolders().getFolderOrCalendarFolderOrContactsFolder().size() > 0) {
        return firmtResp.getFolders().getFolderOrCalendarFolderOrContactsFolder().get(0);
    } else {
        ZimbraLog.fb.error("Could not find the folder in Exchange : " + distinguishedFolderId.toString());
    }
    return null;
}
Also used : NonEmptyArrayOfBaseFolderIdsType(com.microsoft.schemas.exchange.services._2006.types.NonEmptyArrayOfBaseFolderIdsType) Holder(javax.xml.ws.Holder) TimeZoneContextType(com.microsoft.schemas.exchange.services._2006.types.TimeZoneContextType) FolderInfoResponseMessageType(com.microsoft.schemas.exchange.services._2006.messages.FolderInfoResponseMessageType) FolderResponseShapeType(com.microsoft.schemas.exchange.services._2006.types.FolderResponseShapeType) DistinguishedFolderIdType(com.microsoft.schemas.exchange.services._2006.types.DistinguishedFolderIdType) GetFolderResponseType(com.microsoft.schemas.exchange.services._2006.messages.GetFolderResponseType) RequestServerVersion(com.microsoft.schemas.exchange.services._2006.types.RequestServerVersion) TimeZoneDefinitionType(com.microsoft.schemas.exchange.services._2006.types.TimeZoneDefinitionType) ManagementRoleType(com.microsoft.schemas.exchange.services._2006.types.ManagementRoleType) ServerVersionInfo(com.microsoft.schemas.exchange.services._2006.types.ServerVersionInfo) GetFolderType(com.microsoft.schemas.exchange.services._2006.messages.GetFolderType) MailboxCultureType(com.microsoft.schemas.exchange.services._2006.types.MailboxCultureType)

Aggregations

FolderInfoResponseMessageType (com.microsoft.schemas.exchange.services._2006.messages.FolderInfoResponseMessageType)1 GetFolderResponseType (com.microsoft.schemas.exchange.services._2006.messages.GetFolderResponseType)1 GetFolderType (com.microsoft.schemas.exchange.services._2006.messages.GetFolderType)1 DistinguishedFolderIdType (com.microsoft.schemas.exchange.services._2006.types.DistinguishedFolderIdType)1 FolderResponseShapeType (com.microsoft.schemas.exchange.services._2006.types.FolderResponseShapeType)1 MailboxCultureType (com.microsoft.schemas.exchange.services._2006.types.MailboxCultureType)1 ManagementRoleType (com.microsoft.schemas.exchange.services._2006.types.ManagementRoleType)1 NonEmptyArrayOfBaseFolderIdsType (com.microsoft.schemas.exchange.services._2006.types.NonEmptyArrayOfBaseFolderIdsType)1 RequestServerVersion (com.microsoft.schemas.exchange.services._2006.types.RequestServerVersion)1 ServerVersionInfo (com.microsoft.schemas.exchange.services._2006.types.ServerVersionInfo)1 TimeZoneContextType (com.microsoft.schemas.exchange.services._2006.types.TimeZoneContextType)1 TimeZoneDefinitionType (com.microsoft.schemas.exchange.services._2006.types.TimeZoneDefinitionType)1 Holder (javax.xml.ws.Holder)1