diff --git a/build-common.xml b/build-common.xml index 1b9018dd4e8..cacac220ed8 100644 --- a/build-common.xml +++ b/build-common.xml @@ -314,9 +314,7 @@ - - - + diff --git a/client/src/java/com/zimbra/client/ZDataSource.java b/client/src/java/com/zimbra/client/ZDataSource.java index dc50ae4d3e8..0a2ba0ce138 100644 --- a/client/src/java/com/zimbra/client/ZDataSource.java +++ b/client/src/java/com/zimbra/client/ZDataSource.java @@ -54,7 +54,7 @@ public ZDataSource(DataSource data) { } public DataSource toJaxb() { - MailUnknownDataSource jaxbObject = new MailUnknownDataSource(); + MailDataSource jaxbObject = new MailDataSource(); jaxbObject.setId(data.getId()); jaxbObject.setName(data.getName()); jaxbObject.setEnabled(data.isEnabled()); diff --git a/client/src/java/com/zimbra/client/ZFolder.java b/client/src/java/com/zimbra/client/ZFolder.java index 55c0b1b044c..acc9d0b12ac 100644 --- a/client/src/java/com/zimbra/client/ZFolder.java +++ b/client/src/java/com/zimbra/client/ZFolder.java @@ -99,7 +99,7 @@ public class ZFolder implements ZItem, FolderStore, Comparable, ToZJSONO private RetentionPolicy mRetentionPolicy = new RetentionPolicy(); private boolean mActiveSyncDisabled; private Boolean mDeletable = null; - private int mImapRECENTCutoff; + private Integer mImapRECENTCutoff = null; @Override @@ -743,6 +743,14 @@ public int getImapRECENTCutoff(boolean inWritableSession) { } catch (ServiceException e) { ZimbraLog.imap.warn("Error retrieving last item ID in mailbox", e); } + if (mImapRECENTCutoff == null) { + try { + mImapRECENTCutoff = mMailbox.getImapRECENTCutoff(mId); + } catch (ServiceException e) { + ZimbraLog.mailbox.info("Problem determining IMAP RECENTCutoff for %s assuming 0", this, e); + mImapRECENTCutoff = 0; + } + } return mImapRECENTCutoff; } @@ -998,7 +1006,7 @@ public void clearGrants() throws ServiceException { public void rename(String newPath) throws ServiceException { mMailbox.renameFolder(mId, newPath); } public void updateImapRECENTCutoff(int lastItemId) { - if (mImapRECENTCutoff < lastItemId) { + if ((mImapRECENTCutoff == null) || (mImapRECENTCutoff < lastItemId)) { mImapRECENTCutoff = lastItemId; } } diff --git a/client/src/java/com/zimbra/client/ZMailbox.java b/client/src/java/com/zimbra/client/ZMailbox.java index b23f75d4872..17bdc0a5d0e 100644 --- a/client/src/java/com/zimbra/client/ZMailbox.java +++ b/client/src/java/com/zimbra/client/ZMailbox.java @@ -174,6 +174,8 @@ import com.zimbra.soap.mail.message.GetFilterRulesResponse; import com.zimbra.soap.mail.message.GetFolderRequest; import com.zimbra.soap.mail.message.GetFolderResponse; +import com.zimbra.soap.mail.message.GetIMAPRecentCutoffRequest; +import com.zimbra.soap.mail.message.GetIMAPRecentCutoffResponse; import com.zimbra.soap.mail.message.GetIMAPRecentRequest; import com.zimbra.soap.mail.message.GetIMAPRecentResponse; import com.zimbra.soap.mail.message.GetLastItemIdInMailboxRequest; @@ -6506,6 +6508,11 @@ public int getImapRECENT(String folderId) throws ServiceException { return resp.getNum(); } + public int getImapRECENTCutoff(String folderId) throws ServiceException { + GetIMAPRecentCutoffResponse resp = invokeJaxb(new GetIMAPRecentCutoffRequest(folderId)); + return resp.getCutoff(); + } + /** @return List of IMAP UIDs */ public List imapCopy(int[] itemIds, MailItemType type, int folderId) throws ServiceException { List result = Lists.newArrayList(); diff --git a/common/src/java/com/zimbra/common/account/ZAttrProvisioning.java b/common/src/java/com/zimbra/common/account/ZAttrProvisioning.java index 3ff02825f13..2d988419204 100644 --- a/common/src/java/com/zimbra/common/account/ZAttrProvisioning.java +++ b/common/src/java/com/zimbra/common/account/ZAttrProvisioning.java @@ -1783,7 +1783,8 @@ public static PrefDelegatedSendSaveTarget fromString(String s) throws ServiceExc public static enum PrefExternalSendersType { ALL("ALL"), ALLNOTINAB("ALLNOTINAB"), - INAB("INAB"); + INAB("INAB"), + INSD("INSD"); private String mValue; private PrefExternalSendersType(String value) { mValue = value; } public String toString() { return mValue; } @@ -1796,6 +1797,7 @@ public static PrefExternalSendersType fromString(String s) throws ServiceExcepti public boolean isALL() { return this == ALL;} public boolean isALLNOTINAB() { return this == ALLNOTINAB;} public boolean isINAB() { return this == INAB;} + public boolean isINSD() { return this == INSD;} } public static enum PrefFileSharingApplication { @@ -6288,6 +6290,14 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc @ZAttr(id=806) public static final String A_zimbraFeatureConfirmationPageEnabled = "zimbraFeatureConfirmationPageEnabled"; + /** + * Enable contact backup feature + * + * @since ZCS 8.8.5 + */ + @ZAttr(id=2131) + public static final String A_zimbraFeatureContactBackupEnabled = "zimbraFeatureContactBackupEnabled"; + /** * Sleep time between subsequent contact backups. 0 means that contact * backup is disabled. . Must be in valid duration format: @@ -7992,7 +8002,7 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc /** * Determines the load-balancing algorithm used to select an IMAP server * from the pool of available zimbraReverseProxyUpstreamImapServers. - * Valid values are ClientIpHash, custom:{handler-algorithm} [arg1 arg2 + * Valid values are AccountIdHash, custom:{handler-algorithm} [arg1 arg2 * ...] * * @since ZCS 8.7.6 @@ -12788,7 +12798,8 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc * "ALL" minus users who are in the recipient's address * book. "INAB" Users/Addresses whose domain doesn't match * the recipient's domain or zimbraInternalSendersDomain and which - * are present in recipient's address book. + * are present in recipient's address book. "INSD" means + * users whose domain matches the specific domain * * @since ZCS 8.0.0 */ @@ -13497,6 +13508,14 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc @ZAttr(id=59) public static final String A_zimbraPrefOutOfOfficeReplyEnabled = "zimbraPrefOutOfOfficeReplyEnabled"; + /** + * Specific domains to which custom out of office message is to be sent + * + * @since ZCS 8.8.5 + */ + @ZAttr(id=2132) + public static final String A_zimbraPrefOutOfOfficeSpecificDomains = "zimbraPrefOutOfOfficeSpecificDomains"; + /** * when user has OOO message enabled, when they login into web client, * whether to alert the user that the OOO message is turned on and @@ -14939,6 +14958,18 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc @ZAttr(id=1360) public static final String A_zimbraReverseProxySSLToUpstreamEnabled = "zimbraReverseProxySSLToUpstreamEnabled"; + /** + * Configure the default server block in + * 'nginx.conf.web.https?.default.template' to return a default + * HTTP response for all unconfigured host names. See also related + * attributes 'zimbraVirtualHostname' and + * 'zimbraVirtualIPAddress'. + * + * @since ZCS 8.8.6 + */ + @ZAttr(id=3020) + public static final String A_zimbraReverseProxyStrictServerNameEnabled = "zimbraReverseProxyStrictServerNameEnabled"; + /** * The connect timeout is the time interval after which NGINX will * disconnect while establishing an upstream HTTP connection. Measured in diff --git a/common/src/java/com/zimbra/common/localconfig/LC.java b/common/src/java/com/zimbra/common/localconfig/LC.java index c4654fd0feb..75d8c80bcb9 100644 --- a/common/src/java/com/zimbra/common/localconfig/LC.java +++ b/common/src/java/com/zimbra/common/localconfig/LC.java @@ -574,7 +574,7 @@ static void init() { public static final KnownKey cbpolicyd_pid_file = KnownKey.newKey("${zimbra_log_directory}/cbpolicyd.pid"); public static final KnownKey cbpolicyd_log_file = KnownKey.newKey("${zimbra_log_directory}/cbpolicyd.log"); public static final KnownKey cbpolicyd_db_file = KnownKey.newKey("${zimbra_home}/data/cbpolicyd/db/cbpolicyd.sqlitedb"); - public static final KnownKey cbpolicyd_cache_file = KnownKey.newKey("${zimbra_home}/data/cache"); + public static final KnownKey cbpolicyd_cache_file = KnownKey.newKey("${zimbra_home}/data/cbpolicyd/cbpolicyd.cache"); public static final KnownKey cbpolicyd_log_mail = KnownKey.newKey("main"); public static final KnownKey cbpolicyd_log_detail = KnownKey.newKey("modules"); @@ -605,15 +605,15 @@ static void init() { " -Dorg.apache.jasper.compiler.disablejsr199=true" + " -XX:+UseConcMarkSweepGC" + " -XX:SoftRefLRUPolicyMSPerMB=1" + + " -XX:-OmitStackTraceInFastThrow" + " -verbose:gc" + " -XX:+PrintGCDetails" + " -XX:+PrintGCDateStamps" + " -XX:+PrintGCApplicationStoppedTime" + - " -XX:-OmitStackTraceInFastThrow" + " -Xloggc:/opt/zimbra/log/gc.log" + - " -XX:-UseGCLogFileRotation" + + " -XX:+UseGCLogFileRotation" + " -XX:NumberOfGCLogFiles=20" + - " -XX:GCLogFileSize=4096K"); + " -XX:GCLogFileSize=10M"); @Supported public static final KnownKey mailboxd_pidfile = KnownKey.newKey("${zimbra_log_directory}/mailboxd.pid"); @@ -936,6 +936,7 @@ static void init() { public static final KnownKey yauth_baseuri = KnownKey.newKey("https://login.yahoo.com/WSLogin/V1"); public static final KnownKey purge_initial_sleep_ms = KnownKey.newKey(30 * Constants.MILLIS_PER_MINUTE); + public static final KnownKey contact_backup_initial_sleep_ms = KnownKey.newKey(10 * Constants.MILLIS_PER_MINUTE); public static final KnownKey conversation_max_age_ms = KnownKey.newKey(31 * Constants.MILLIS_PER_DAY); public static final KnownKey tombstone_max_age_ms = KnownKey.newKey(3 * Constants.MILLIS_PER_MONTH); diff --git a/common/src/java/com/zimbra/common/soap/MailConstants.java b/common/src/java/com/zimbra/common/soap/MailConstants.java index 82f6bd6379b..a53e5d8e6f8 100644 --- a/common/src/java/com/zimbra/common/soap/MailConstants.java +++ b/common/src/java/com/zimbra/common/soap/MailConstants.java @@ -294,6 +294,8 @@ private MailConstants() { public static final String E_RECORD_IMAP_SESSION_RESPONSE = "RecordIMAPSessionResponse"; public static final String E_GET_IMAP_RECENT_REQUEST = "GetIMAPRecentRequest"; public static final String E_GET_IMAP_RECENT_RESPONSE = "GetIMAPRecentResponse"; + public static final String E_GET_IMAP_RECENT_CUTOFF_REQUEST = "GetIMAPRecentCutoffRequest"; + public static final String E_GET_IMAP_RECENT_CUTOFF_RESPONSE = "GetIMAPRecentCutoffResponse"; public static final String E_IMAP_COPY_REQUEST = "IMAPCopyRequest"; public static final String E_IMAP_COPY_RESPONSE = "IMAPCopyResponse"; @@ -588,6 +590,8 @@ private MailConstants() { public static final QName BEGIN_TRACKING_IMAP_RESPONSE = QName.get(E_BEGIN_TRACKING_IMAP_RESPONSE, NAMESPACE); public static final QName GET_IMAP_RECENT_REQUEST = QName.get(E_GET_IMAP_RECENT_REQUEST, NAMESPACE); public static final QName GET_IMAP_RECENT_RESPONSE = QName.get(E_GET_IMAP_RECENT_RESPONSE, NAMESPACE); + public static final QName GET_IMAP_RECENT_CUTOFF_REQUEST = QName.get(E_GET_IMAP_RECENT_CUTOFF_REQUEST, NAMESPACE); + public static final QName GET_IMAP_RECENT_CUTOFF_RESPONSE = QName.get(E_GET_IMAP_RECENT_CUTOFF_RESPONSE, NAMESPACE); public static final QName RECORD_IMAP_SESSION_REQUEST = QName.get(E_RECORD_IMAP_SESSION_REQUEST, NAMESPACE); public static final QName RECORD_IMAP_SESSION_RESPONSE = QName.get(E_RECORD_IMAP_SESSION_RESPONSE, NAMESPACE); public static final QName IMAP_COPY_REQUEST = QName.get(E_IMAP_COPY_REQUEST, NAMESPACE); @@ -782,6 +786,7 @@ private MailConstants() { public static final String A_IMAP_NUM = "i4n"; public static final String A_IMAP_MODSEQ = "i4ms"; public static final String A_IMAP_UIDNEXT = "i4next"; + public static final String A_IMAP_RECENT_CUTOFF = "cutoff"; public static final String A_TOTAL_SIZE = "total"; public static final String A_OPERATION = "op"; public static final String A_RECURSIVE = "recursive"; @@ -1348,4 +1353,11 @@ private MailConstants() { public static final String A_CONTACTS_BACKUP_FILE_NAME = "contactsBackupFileName"; public static final String A_CONTACTS_RESTORE_RESOLVE = "resolve"; public static final String A_CONTACTS_BACKUP_FOLDER_NAME = "ContactsBackup"; + + // SearchAction API + public static final String E_SEARCH_ACTION_REQUEST = "SearchActionRequest"; + public static final String E_SEARCH_ACTION_RESPONSE = "SearchActionResponse"; + public static final String E_BULK_ACTION = "BulkAction"; + public static final QName SEARCH_ACTION_REQUEST = QName.get(E_SEARCH_ACTION_REQUEST, NAMESPACE); + public static final QName SEARCH_ACTION_RESPONSE = QName.get(E_SEARCH_ACTION_RESPONSE, NAMESPACE); } diff --git a/common/src/java/com/zimbra/common/util/ZimbraLog.java b/common/src/java/com/zimbra/common/util/ZimbraLog.java index e6758229e74..3ad884694fe 100644 --- a/common/src/java/com/zimbra/common/util/ZimbraLog.java +++ b/common/src/java/com/zimbra/common/util/ZimbraLog.java @@ -460,6 +460,11 @@ public final class ZimbraLog { */ public static final Log ephemeral = LogFactory.getLog("zimbra.ephemeral"); + /** + * the "zimbra.contactbackup" logger. For Contact backup/restore-related logs. + */ + public static final Log contactbackup = LogFactory.getLog("zimbra.contactbackup"); + /** * Maps the log category name to its description. */ @@ -548,6 +553,7 @@ public static Set getAccountNamesFromContext() { descriptions.put(nginxlookup.getCategory(), "Nginx lookup operations"); descriptions.put(activity.getCategory(), "Document operations"); descriptions.put(ews.getCategory(), "EWS operations"); + descriptions.put(contactbackup.getCategory(), "Contact Backup and restore"); CATEGORY_DESCRIPTIONS = Collections.unmodifiableMap(descriptions); } diff --git a/common/src/java/com/zimbra/common/zclient/ZClientException.java b/common/src/java/com/zimbra/common/zclient/ZClientException.java index 77c452de755..24785431787 100644 --- a/common/src/java/com/zimbra/common/zclient/ZClientException.java +++ b/common/src/java/com/zimbra/common/zclient/ZClientException.java @@ -54,7 +54,7 @@ public static ZClientException CLIENT_ERROR(String msg, Throwable cause) { } public static ZClientException UPLOAD_SIZE_LIMIT_EXCEEDED(String msg, Throwable cause) { - return new ZClientException(msg, UPLOAD_SIZE_LIMIT_EXCEEDED, SENDERS_FAULT, cause); + return new ZClientUploadSizeLimitExceededException(msg, cause); } public static ZClientException UPLOAD_FAILED(String msg, Throwable cause) { @@ -81,6 +81,13 @@ public ZClientNoSuchItemException(int id) { } } + public static class ZClientUploadSizeLimitExceededException extends ZClientException { + private static final long serialVersionUID = 1728995252512138761L; + public ZClientUploadSizeLimitExceededException(String msg, Throwable cause) { + super(msg, UPLOAD_SIZE_LIMIT_EXCEEDED, SENDERS_FAULT, cause); + } + } + public static class ZClientNoSuchMsgException extends ZClientNoSuchItemException { private static final long serialVersionUID = 7916158633910054737L; diff --git a/soap/src/java-test/com/zimbra/soap/mail/CalImportDataRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/CalImportDataRequest.xml new file mode 100644 index 00000000000..af4832a4a23 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/CalImportDataRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/CaldavImportDataRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/CaldavImportDataRequest.xml new file mode 100644 index 00000000000..c19d0199b0c --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/CaldavImportDataRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/CreateCalDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/CreateCalDataSourceRequest.xml new file mode 100644 index 00000000000..2682ed8f4c4 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/CreateCalDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/CreateCaldavDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/CreateCaldavDataSourceRequest.xml new file mode 100644 index 00000000000..58224055d16 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/CreateCaldavDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/CreateGalDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/CreateGalDataSourceRequest.xml new file mode 100644 index 00000000000..c213f280379 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/CreateGalDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/CreateImapDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/CreateImapDataSourceRequest.xml new file mode 100644 index 00000000000..60b4d700462 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/CreateImapDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/CreatePop3DataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/CreatePop3DataSourceRequest.xml new file mode 100644 index 00000000000..b9da0c60c76 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/CreatePop3DataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/CreateRssDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/CreateRssDataSourceRequest.xml new file mode 100644 index 00000000000..09cd5240d0e --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/CreateRssDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/CreateUnknownDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/CreateUnknownDataSourceRequest.xml new file mode 100644 index 00000000000..d311cf57424 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/CreateUnknownDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/DataSourceJaxbTest.java b/soap/src/java-test/com/zimbra/soap/mail/DataSourceJaxbTest.java new file mode 100644 index 00000000000..1afd979f951 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/DataSourceJaxbTest.java @@ -0,0 +1,584 @@ +package com.zimbra.soap.mail; + +import static org.junit.Assert.*; + +import java.util.List; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; + +import org.junit.Test; + +import com.zimbra.soap.mail.message.CreateDataSourceRequest; +import com.zimbra.soap.mail.message.GetDataSourcesResponse; +import com.zimbra.soap.mail.message.ImportDataRequest; +import com.zimbra.soap.mail.message.ModifyDataSourceRequest; +import com.zimbra.soap.mail.message.TestDataSourceRequest; +import com.zimbra.soap.mail.type.CalDataSourceNameOrId; +import com.zimbra.soap.mail.type.CaldavDataSourceNameOrId; +import com.zimbra.soap.mail.type.DataSourceNameOrId; +import com.zimbra.soap.mail.type.GalDataSourceNameOrId; +import com.zimbra.soap.mail.type.ImapDataSourceNameOrId; +import com.zimbra.soap.mail.type.MailCalDataSource; +import com.zimbra.soap.mail.type.MailCaldavDataSource; +import com.zimbra.soap.mail.type.MailDataSource; +import com.zimbra.soap.mail.type.MailGalDataSource; +import com.zimbra.soap.mail.type.MailImapDataSource; +import com.zimbra.soap.mail.type.MailPop3DataSource; +import com.zimbra.soap.mail.type.MailRssDataSource; +import com.zimbra.soap.mail.type.Pop3DataSourceNameOrId; +import com.zimbra.soap.mail.type.RssDataSourceNameOrId; +import com.zimbra.soap.type.DataSource; +import com.zimbra.soap.type.DataSource.ConnectionType; + +public class DataSourceJaxbTest { + + @Test + public void testCreateDataSourceRequest() throws JAXBException { + JAXBContext jaxb = JAXBContext.newInstance(CreateDataSourceRequest.class); + Unmarshaller unmarshaller = jaxb.createUnmarshaller(); + CreateDataSourceRequest req = (CreateDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("CreateUnknownDataSourceRequest.xml")); + DataSource ds = req.getDataSource(); + assertNotNull("Generic DataSource should not be NULL", ds); + assertTrue("DataSource should be an instance of MailDataSource", ds instanceof MailDataSource); + assertEquals("wrong folder ID", "257", ds.getFolderId()); + assertEquals("wrong refresh token", "AAbbccdd1244eeffVdNHR.l0_jzuWvPNtAt0BCCcOm8w9wq1gdB", ds.getRefreshToken()); + assertEquals("wrong host", "yahoo.com", ds.getHost()); + assertEquals("wrong name", "blablah@yahoo.com", ds.getName()); + assertEquals("wrong import class", "com.synacor.zimbra.OAuthDataImport", ds.getImportClass()); + + req = (CreateDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("CreateImapDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("IMAP DataSource should not be NULL", ds); + assertTrue("DataSource should be an instance of MailImapDataSource", ds instanceof MailImapDataSource); + assertEquals("wrong folder ID", "2", ds.getFolderId()); + assertEquals("wrong refresh token", "AAbbccdd1244eeffVdNHR.l0_jzuWvPNtAt0BCCcOm8w9wq1gdB", ds.getRefreshToken()); + assertEquals("wrong clientSecret", "test123", ((MailImapDataSource)ds).getClientSecret()); + assertEquals("wrong clietnId", "someclientid", ((MailImapDataSource)ds).getClientId()); + //using a string that's as long as a real OAuth2 token to make sure Jaxb does not truncate it + assertEquals("wrong oauth token", "LoremIpsumZZZyyY123.MaybeLorem.53445.WWW.YelpcYE1p6L1iS5vwZAg8pntEPGs2M.FcbPqY7PxBxORvoYhcbiTLlK7YcRwMB.1gprP5vxYghvqPT9KKV_EJ2vpDQr881.dzLB896UWZYI3hLrqAwiePEhFdw1XXTNP4u6gJ8J6ErPSZJInN1SMK74smQZErEpBgNfyFD2kgNPfcdxjMLh5ODjvhMufHcsb_NI5liTCOWa7k693ziHVZQkyGCJdAzxhtYeIyaCxyTsvaj3ybeXcye.qWFvwpdZbqWj8U8DqRXpjrq6wnNsK1ljGafon_uuX06wWNLh5P0GmLkaW4Yrumh9L7ir59Wm9bQ98TuHxNQDnLLqCK42P3Grb8guWGFRetPiLV2mb4ZT0fPAOeYPmaJXc2_OEWtr.KlazJt.ig6Me1HWR0vHC_MnfHUFA028wooDD9URrhTeMrvizeoePMfd3tgMEw721AbAoH58tg5VebNH_F_.wlQKYkU9rXv4v5Mzw3vsCKvW6wniJzepaY6gwKpMjlWn4CxAQNwRMPyoCDR2gRUXriulDO7vKbQ1ku_g2H.Swq2XGyr0EKjOjRAKVNGWJAh.1flPkzF0W5n7kcgJnG1H3AopZJMAypTiNQEDEyjqDCF41jgN4rKo5q9skZMbRG0D5jL0T_SoKDp6jWoXbWAmeog4Tb0eCHD0QJJGOa1BfFZkXbDB0Eet8JxxfG.0vM23oIervWHqcBPlfKJtkxiI9CCdqOniDNPfhbxkaSlOq3bQRmFOq08jaOwswlsECm4U95bEDxAtKcnVl8AnrP8qsbqxmanHdTh.dehEnjJ1gXyGpaMEBA2Yrt_QEewyWEDuR_zBKsomeDotsSp1.tyw3WCqnMx27tArDDasdNNlPPdfRVQlqe6gX45HfK0C8PAXsPnqZUA07.pFTa8ifcucsdqbh3_UpXnuPj8Mn.67GxwvujJkO8WpD3nCQpwp4Fns6NOnoNoasdgyiSCcGpCsGs2l6ZIFJyUMvIf4q6cfEiJ18lyBjRxi3rpgMAYTt5sOmikOst.gttN1gettkvWyY8-", + ((MailImapDataSource)ds).getOAuthToken()); + assertEquals("wrong host", "imap.yahoo.com", ds.getHost()); + assertEquals("wrong name", "blablah2@yahoo.com", ds.getName()); + + req = (CreateDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("CreateCalDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("Cal DataSource should not be NULL", ds); + assertTrue("DataSource should be an instance of MailCalDataSource", ds instanceof MailCalDataSource); + assertEquals("wrong folder ID", "5", ds.getFolderId()); + assertEquals("wrong host", "calendar.google.com", ds.getHost()); + assertEquals("wrong name", "someCalDS", ds.getName()); + + req = (CreateDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("CreateGalDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("GAL DataSource should not be NULL", ds); + assertTrue("DataSource should be an instance of MailGalDataSource", ds instanceof MailGalDataSource); + assertEquals("wrong folder ID", "7", ds.getFolderId()); + assertEquals("wrong host", "ldap.zimbra.com", ds.getHost()); + assertEquals("wrong name", "zimbraGAL", ds.getName()); + assertEquals("wrong polling interval", "24h", ds.getPollingInterval()); + assertTrue("wrong isEnabled", ds.isEnabled()); + + req = (CreateDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("CreatePop3DataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("POP3 DataSource should not be NULL", ds); + assertTrue("DataSource should be an instance of MailPop3DataSource", ds instanceof MailPop3DataSource); + assertEquals("wrong folder ID", "1", ds.getFolderId()); + assertEquals("wrong host", "pop.email.provider.domain", ds.getHost()); + assertEquals("wrong name", "pop3DSForTest", ds.getName()); + assertEquals("wrong polling interval", "24h", ds.getPollingInterval()); + assertTrue("wrong leaveOnServer", ((MailPop3DataSource)ds).isLeaveOnServer()); + assertFalse("wrong isEnabled", ds.isEnabled()); + + req = (CreateDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("CreateCaldavDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("CalDAV DataSource should not be NULL", ds); + assertTrue("DataSource should be an instance of MailCaldavDataSource", ds instanceof MailCaldavDataSource); + assertEquals("wrong folder ID", "3", ds.getFolderId()); + assertEquals("wrong host", "some.cal.dav.host", ds.getHost()); + assertEquals("wrong name", "caldavDS", ds.getName()); + assertEquals("wrong polling interval", "1h", ds.getPollingInterval()); + assertFalse("wrong isEnabled", ds.isEnabled()); + + req = (CreateDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("CreateRssDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("RSS DataSource should not be NULL", ds); + assertTrue("DataSource should be an instance of MailRssDataSource", ds instanceof MailRssDataSource); + assertEquals("wrong folder ID", "260", ds.getFolderId()); + assertEquals("wrong host", "some.rss.dav.host", ds.getHost()); + assertEquals("wrong name", "RssFeedDataSource", ds.getName()); + assertEquals("wrong polling interval", "30m", ds.getPollingInterval()); + assertTrue("wrong isEnabled", ds.isEnabled()); + } + + @Test + public void testModifyDataSourceRequest() throws JAXBException { + JAXBContext jaxb = JAXBContext.newInstance(ModifyDataSourceRequest.class); + Unmarshaller unmarshaller = jaxb.createUnmarshaller(); + ModifyDataSourceRequest req = (ModifyDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("ModifyUnknownDataSourceRequest.xml")); + DataSource ds = req.getDataSource(); + assertNotNull("Generic DataSource should not be NULL", ds); + assertNotNull("Generic DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for generic DataSource", "11e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailDataSource", ds instanceof MailDataSource); + assertEquals("wrong refresh token", "AAbbccdd1244eeffVdNHR.l0_jzuWvPNtAt0BCCcOm8w9wq1gdB", ds.getRefreshToken()); + assertEquals("wrong host", "yahoo.com", ds.getHost()); + assertEquals("wrong import class", "com.synacor.zimbra.OAuthDataImport", ds.getImportClass()); + assertEquals("wrong polling interval", "60s", ds.getPollingInterval()); + + req = (ModifyDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("ModifyImapDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("IMAP DataSource should not be NULL", ds); + assertNotNull("IMAP DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for IMAP DataSource", "71e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailImapDataSource", ds instanceof MailImapDataSource); + assertEquals("wrong polling interval", "30m", ds.getPollingInterval()); + + req = (ModifyDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("ModifyCalDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("Cal DataSource should not be NULL", ds); + assertNotNull("Cal DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for Cal DataSource", "61e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailCalDataSource", ds instanceof MailCalDataSource); + assertEquals("wrong folder ID", "333", ds.getFolderId()); + + req = (ModifyDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("ModifyGalDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("GAL DataSource should not be NULL", ds); + assertNotNull("GAL DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for GAL DataSource", "51e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailGalDataSource", ds instanceof MailGalDataSource); + assertEquals("wrong polling interval", "69s", ds.getPollingInterval()); + + req = (ModifyDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("ModifyPop3DataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("POP3 DataSource should not be NULL", ds); + assertNotNull("POP3 DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for POP3 DataSource", "41e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailPop3DataSource", ds instanceof MailPop3DataSource); + assertEquals("wrong polling interval", "1m", ds.getPollingInterval()); + assertFalse("wrong leaveOnServer", ((MailPop3DataSource)ds).isLeaveOnServer()); + + req = (ModifyDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("ModifyCaldavDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("Caldav DataSource should not be NULL", ds); + assertNotNull("Caldav DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for Caldav DataSource", "31e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailCaldavDataSource", ds instanceof MailCaldavDataSource); + assertEquals("wrong polling interval", "60s", ds.getPollingInterval()); + + req = (ModifyDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("ModifyRssDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("RSS DataSource should not be NULL", ds); + assertNotNull("RSS DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for RSS DataSource", "21e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailRssDataSource", ds instanceof MailRssDataSource); + assertEquals("wrong polling interval", "2d", ds.getPollingInterval()); + assertFalse("wrong isEnabled", ds.isEnabled()); + } + + @Test + public void testTestDataSourceRequest() throws Exception { + JAXBContext jaxb = JAXBContext.newInstance(TestDataSourceRequest.class); + Unmarshaller unmarshaller = jaxb.createUnmarshaller(); + TestDataSourceRequest req = (TestDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("TestUnknownDataSourceRequest.xml")); + DataSource ds = req.getDataSource(); + assertNotNull("Generic DataSource should not be NULL", ds); + assertNotNull("Generic DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for generic DataSource", "11e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailDataSource", ds instanceof MailDataSource); + + req = (TestDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("TestImapDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("IMAP DataSource should not be NULL", ds); + assertNotNull("IMAP DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for IMAP DataSource", "71e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailImapDataSource", ds instanceof MailImapDataSource); + + req = (TestDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("TestCalDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("Cal DataSource should not be NULL", ds); + assertNotNull("Cal DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for Cal DataSource", "31e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailCalDataSource", ds instanceof MailCalDataSource); + + req = (TestDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("TestGalDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("GAL DataSource should not be NULL", ds); + assertNotNull("GAL DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for GAL DataSource", "51e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailGalDataSource", ds instanceof MailGalDataSource); + + req = (TestDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("TestPop3DataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("POP3 DataSource should not be NULL", ds); + assertNotNull("POP3 DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for POP3 DataSource", "41e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailPop3DataSource", ds instanceof MailPop3DataSource); + + req = (TestDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("TestCaldavDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("Caldav DataSource should not be NULL", ds); + assertNotNull("Caldav DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for Caldav DataSource", "31e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailCaldavDataSource", ds instanceof MailCaldavDataSource); + + req = (TestDataSourceRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("TestRssDataSourceRequest.xml")); + ds = req.getDataSource(); + assertNotNull("RSS DataSource should not be NULL", ds); + assertNotNull("RSS DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for RSS DataSource", "21e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSource should be an instance of MailRssDataSource", ds instanceof MailRssDataSource); + } + + @Test + public void testGetDataSourcesResponse() throws Exception { + //response with one Unknown datasource + JAXBContext jaxb = JAXBContext.newInstance(GetDataSourcesResponse.class); + Unmarshaller unmarshaller = jaxb.createUnmarshaller(); + GetDataSourcesResponse resp = (GetDataSourcesResponse) unmarshaller.unmarshal( + getClass().getResourceAsStream("GetUnknownDataSourcesResponse.xml")); + List dsList = resp.getDataSources(); + assertNotNull("datasources should not be NULL", dsList); + assertFalse("list of datasources should not be empty", dsList.isEmpty()); + assertEquals("expecting one datasource in the list", 1, dsList.size()); + DataSource ds = dsList.get(0); + assertNotNull("Generic DataSource should not be NULL", ds); + assertNotNull("Generic DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for generic DataSource", "8d17e182-fdc6-4f6c-b83f-d478c9b04bfd", ds.getId()); + assertTrue("DataSource should be an instance of MailDataSource", ds instanceof MailDataSource); + assertEquals("wrong refresh token", "AAbbcdd22wkBVsVdNHR.l0_jzuWvPNiAt0DBOcRm7w9zLorEM", ds.getRefreshToken()); + assertEquals("wrong host", "yahoo.com", ds.getHost()); + assertEquals("wrong import class", "com.synacor.zimbra.OAuthDataImport", ds.getImportClass()); + assertEquals("wrong datasource name", "blablah@yahoo.com", ds.getName()); + + //response with one IMAP datasource + resp = (GetDataSourcesResponse) unmarshaller.unmarshal( + getClass().getResourceAsStream("GetImapDataSourcesResponse.xml")); + dsList = resp.getDataSources(); + assertNotNull("datasources should not be NULL", dsList); + assertFalse("list of datasources should not be empty", dsList.isEmpty()); + assertEquals("expecting 1 datasource in the list", 1, dsList.size()); + ds = dsList.get(0); + assertNotNull("IMAP DataSource should not be NULL", ds); + assertNotNull("IMAP DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for IMAP DataSource", "d96e9a7d-6af9-4625-ba68-37bcd73fce6d", ds.getId()); + assertTrue("DataSource should be an instance of MailImapDataSource", ds instanceof MailImapDataSource); + assertEquals("wrong connectionType", ConnectionType.cleartext, ds.getConnectionType()); + assertEquals("wrong host", "imap.zimbra.com", ds.getHost()); + assertEquals("wrong datasource name", "myIMAPSource", ds.getName()); + + //response with an Unknown and an IMAP datasources + resp = (GetDataSourcesResponse) unmarshaller.unmarshal( + getClass().getResourceAsStream("GetTwoDataSourcesResponse.xml")); + dsList = resp.getDataSources(); + assertNotNull("datasources should not be NULL", dsList); + assertFalse("list of datasources should not be empty", dsList.isEmpty()); + assertEquals("expecting 2 datasources in the list", 2, dsList.size()); + ds = dsList.get(0); + assertNotNull("Generic DataSource should not be NULL", ds); + assertNotNull("Generic DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for generic DataSource", "8d17e182-fdc6-4f6c-b83f-d478c9b04bfd", ds.getId()); + assertTrue("DataSource should be an instance of MailDataSource", ds instanceof MailDataSource); + assertEquals("wrong refresh token", "AAbbcdd22wkBVsVdNHR.l0_jzuWvPNiAt0DBOcRm7w9zLorEM", ds.getRefreshToken()); + assertEquals("wrong host", "yahoo.com", ds.getHost()); + assertEquals("wrong import class", "com.synacor.zimbra.OAuthDataImport", ds.getImportClass()); + assertEquals("wrong datasource name", "blablah@yahoo.com", ds.getName()); + + ds = dsList.get(1); + assertNotNull("IMAP DataSource should not be NULL", ds); + assertNotNull("IMAP DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for IMAP DataSource", "d96e9a7d-6af9-4625-ba68-37bcd73fce6d", ds.getId()); + assertTrue("DataSource should be an instance of MailImapDataSource", ds instanceof MailImapDataSource); + assertEquals("wrong connectionType", ConnectionType.cleartext, ds.getConnectionType()); + assertEquals("wrong host", "imap.zimbra.com", ds.getHost()); + assertEquals("wrong datasource name", "myIMAPSource", ds.getName()); + + //Response with one element of each type of datasource + resp = (GetDataSourcesResponse) unmarshaller.unmarshal( + getClass().getResourceAsStream("GetOneEachDataSourcesResponse.xml")); + dsList = resp.getDataSources(); + assertNotNull("datasources should not be NULL", dsList); + assertFalse("list of datasources should not be empty", dsList.isEmpty()); + assertEquals("expecting 7 datasources in the list", 7, dsList.size()); + ds = dsList.get(0); + assertNotNull("Generic DataSource should not be NULL", ds); + assertNotNull("Generic DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for generic DataSource", "8d17e182-fdc6-4f6c-b83f-d478c9b04bfd", ds.getId()); + assertTrue("DataSource should be an instance of MailDataSource", ds instanceof MailDataSource); + assertEquals("wrong refresh token", "AAbbcdd22wkBVsVdNHR.l0_jzuWvPNiAt0DBOcRm7w9zLorEM", ds.getRefreshToken()); + assertEquals("wrong host", "yahoo.com", ds.getHost()); + assertEquals("wrong import class", "com.synacor.zimbra.OAuthDataImport", ds.getImportClass()); + assertEquals("wrong datasource name", "blablah@yahoo.com", ds.getName()); + + ds = dsList.get(1); + assertNotNull("IMAP DataSource should not be NULL", ds); + assertNotNull("IMAP DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for IMAP DataSource", "d96e9a7d-6af9-4625-ba68-37bcd73fce6d", ds.getId()); + assertTrue("DataSource should be an instance of MailImapDataSource", ds instanceof MailImapDataSource); + assertEquals("wrong connectionType", ConnectionType.cleartext, ds.getConnectionType()); + assertEquals("wrong host", "imap.zimbra.com", ds.getHost()); + assertEquals("wrong datasource name", "myIMAPSource", ds.getName()); + + ds = dsList.get(2); + assertNotNull("POP3 DataSource should not be NULL", ds); + assertNotNull("POP3 DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for POP3 DataSource", "b5e98a1f-5f93-4e19-a1a4-956c4c95af1b", ds.getId()); + assertTrue("DataSource should be an instance of MailPop3DataSource", ds instanceof MailPop3DataSource); + assertEquals("wrong connectionType", ConnectionType.cleartext, ds.getConnectionType()); + assertEquals("wrong host", "pop.zimbra.com", ds.getHost()); + assertEquals("wrong datasource name", "myPop3Mail", ds.getName()); + assertTrue("wrong leaveOnServer", ((MailPop3DataSource)ds).isLeaveOnServer()); + + ds = dsList.get(3); + assertNotNull("RSS DataSource should not be NULL", ds); + assertNotNull("RSS DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for RSS DataSource", "89bca37f-9096-419d-9471-62149a58cbdc", ds.getId()); + assertTrue("DataSource should be an instance of MailRssDataSource", ds instanceof MailRssDataSource); + assertEquals("wrong connectionType", ConnectionType.cleartext, ds.getConnectionType()); + assertEquals("wrong host", "rss.zimbra.com", ds.getHost()); + assertEquals("wrong datasource name", "myRssFeed", ds.getName()); + assertEquals("wrong polling interval", "43200000", ds.getPollingInterval()); + assertEquals("wrong FolderId", "260", ds.getFolderId()); + + ds = dsList.get(4); + assertNotNull("Cal DataSource should not be NULL", ds); + assertNotNull("Cal DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for Cal DataSource", "112da07b-43e3-41ab-a0b3-5c109169ee49", ds.getId()); + assertTrue("DataSource should be an instance of MailCalDataSource", ds instanceof MailCalDataSource); + assertEquals("wrong host", "calendar.zimbra.com", ds.getHost()); + assertEquals("wrong datasource name", "GCal", ds.getName()); + assertEquals("wrong polling interval", "63100000", ds.getPollingInterval()); + + ds = dsList.get(5); + assertNotNull("GAL DataSource should not be NULL", ds); + assertNotNull("GAL DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for GAL DataSource", "ed408f4d-f8d5-4597-bf49-563ed62b64de", ds.getId()); + assertTrue("DataSource should be an instance of MailCalDataSource", ds instanceof MailGalDataSource); + assertEquals("wrong host", "ldap.somehost.local", ds.getHost()); + assertEquals("wrong datasource name", "corpAddressBook", ds.getName()); + + ds = dsList.get(6); + assertNotNull("Caldav DataSource should not be NULL", ds); + assertNotNull("Caldav DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for Caldav DataSource", "95c066a8-5ad6-40fa-a094-06f8b3531878", ds.getId()); + assertTrue("DataSource should be an instance of MailCaldavDataSource", ds instanceof MailCaldavDataSource); + assertEquals("wrong host", "dav.zimbra.com", ds.getHost()); + assertEquals("wrong datasource name", "externalDAV", ds.getName()); + + //Response with multiple instances of some types of data sources + resp = (GetDataSourcesResponse) unmarshaller.unmarshal( + getClass().getResourceAsStream("GetManyDataSourcesResponse.xml")); + dsList = resp.getDataSources(); + assertNotNull("datasources should not be NULL", dsList); + assertFalse("list of datasources should not be empty", dsList.isEmpty()); + assertEquals("expecting 10 datasources in the list", 10, dsList.size()); + ds = dsList.get(0); + assertNotNull("Generic DataSource should not be NULL", ds); + assertNotNull("Generic DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for generic DataSource", "8d17e182-fdc6-4f6c-b83f-d478c9b04bfd", ds.getId()); + assertTrue("DataSource should be an instance of MailDataSource", ds instanceof MailDataSource); + assertEquals("wrong refresh token", "AAbbcdd22wkBVsVdNHR.l0_jzuWvPNiAt0DBOcRm7w9zLorEM", ds.getRefreshToken()); + assertEquals("wrong host", "yahoo.com", ds.getHost()); + assertEquals("wrong import class", "com.synacor.zimbra.OAuthDataImport", ds.getImportClass()); + assertEquals("wrong datasource name", "blablah@yahoo.com", ds.getName()); + + ds = dsList.get(1); + assertNotNull("IMAP DataSource should not be NULL", ds); + assertNotNull("IMAP DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for IMAP DataSource", "d96e9a7d-6af9-4625-ba68-37bcd73fce6d", ds.getId()); + assertTrue("DataSource should be an instance of MailImapDataSource", ds instanceof MailImapDataSource); + assertEquals("wrong connectionType", ConnectionType.cleartext, ds.getConnectionType()); + assertEquals("wrong host", "imap.zimbra.com", ds.getHost()); + assertEquals("wrong datasource name", "myIMAPSource", ds.getName()); + assertEquals("wrong port", 143, ds.getPort().intValue()); + + ds = dsList.get(2); + assertNotNull("POP3 DataSource should not be NULL", ds); + assertNotNull("POP3 DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for POP3 DataSource", "b5e98a1f-5f93-4e19-a1a4-956c4c95af1b", ds.getId()); + assertTrue("DataSource should be an instance of MailPop3DataSource", ds instanceof MailPop3DataSource); + assertEquals("wrong connectionType", ConnectionType.cleartext, ds.getConnectionType()); + assertEquals("wrong host", "pop.zimbra.com", ds.getHost()); + assertEquals("wrong datasource name", "myPop3Mail", ds.getName()); + assertTrue("wrong leaveOnServer", ((MailPop3DataSource)ds).isLeaveOnServer()); + + ds = dsList.get(3); + assertNotNull("RSS DataSource should not be NULL", ds); + assertNotNull("RSS DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for RSS DataSource", "89bca37f-9096-419d-9471-62149a58cbdc", ds.getId()); + assertTrue("DataSource should be an instance of MailRssDataSource", ds instanceof MailRssDataSource); + assertEquals("wrong connectionType", ConnectionType.cleartext, ds.getConnectionType()); + assertEquals("wrong host", "rss.zimbra.com", ds.getHost()); + assertEquals("wrong datasource name", "myRssFeed", ds.getName()); + assertEquals("wrong polling interval", "43200000", ds.getPollingInterval()); + assertEquals("wrong FolderId", "260", ds.getFolderId()); + + ds = dsList.get(4); + assertNotNull("Cal DataSource should not be NULL", ds); + assertNotNull("Cal DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for Cal DataSource", "112da07b-43e3-41ab-a0b3-5c109169ee49", ds.getId()); + assertTrue("DataSource should be an instance of MailCalDataSource", ds instanceof MailCalDataSource); + assertEquals("wrong host", "calendar.zimbra.com", ds.getHost()); + assertEquals("wrong datasource name", "GCal", ds.getName()); + assertEquals("wrong polling interval", "63100000", ds.getPollingInterval()); + + ds = dsList.get(5); + assertNotNull("GAL DataSource should not be NULL", ds); + assertNotNull("GAL DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for GAL DataSource", "ed408f4d-f8d5-4597-bf49-563ed62b64de", ds.getId()); + assertTrue("DataSource should be an instance of MailCalDataSource", ds instanceof MailGalDataSource); + assertEquals("wrong host", "ldap.somehost.local", ds.getHost()); + assertEquals("wrong datasource name", "corpAddressBook", ds.getName()); + + ds = dsList.get(6); + assertNotNull("Caldav DataSource should not be NULL", ds); + assertNotNull("Caldav DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for Caldav DataSource", "95c066a8-5ad6-40fa-a094-06f8b3531878", ds.getId()); + assertTrue("DataSource should be an instance of MailCaldavDataSource", ds instanceof MailCaldavDataSource); + assertEquals("wrong host", "dav.zimbra.com", ds.getHost()); + assertEquals("wrong datasource name", "externalDAV", ds.getName()); + + ds = dsList.get(7); + assertNotNull("2d RSS DataSource should not be NULL", ds); + assertNotNull("2d RSS DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for the 2d RSS DataSource", "f32349af-9a78-4c26-80a1-338203378930", ds.getId()); + assertTrue("DataSource should be an instance of MailRssDataSource", ds instanceof MailRssDataSource); + assertEquals("wrong connectionType", ConnectionType.cleartext, ds.getConnectionType()); + assertEquals("wrong host", "news.yahoo.com", ds.getHost()); + assertEquals("wrong datasource name", "myYahoo", ds.getName()); + assertEquals("wrong polling interval", "43200000", ds.getPollingInterval()); + assertEquals("wrong FolderId", "261", ds.getFolderId()); + + ds = dsList.get(8); + assertNotNull("2d IMAP DataSource should not be NULL", ds); + assertNotNull("2d IMAP DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for the 2d IMAP DataSource", "b2e929f5-e124-47a0-b1b4-a7fbcd14fb31", ds.getId()); + assertTrue("DataSource should be an instance of MailImapDataSource", ds instanceof MailImapDataSource); + assertEquals("wrong connectionType", ConnectionType.tls_if_available, ds.getConnectionType()); + assertEquals("wrong host", "imap3.zimbra.com", ds.getHost()); + assertEquals("wrong port", 193, ds.getPort().intValue()); + assertEquals("wrong datasource name", "forgottenMail", ds.getName()); + + ds = dsList.get(9); + assertNotNull("2d Generic DataSource should not be NULL", ds); + assertNotNull("2d Generic DataSource ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for the 2d generic DataSource", "82e3b467-5a0f-4cff-ad8d-533ed6fc4992", ds.getId()); + assertTrue("DataSource should be an instance of MailDataSource", ds instanceof MailDataSource); + assertNull("Refresh token should be NULL",ds.getRefreshToken()); + assertEquals("wrong host", "abook.gmail.com", ds.getHost()); + assertEquals("wrong import class", "com.synacor.zimbra.OAuthDataImport", ds.getImportClass()); + assertEquals("wrong datasource name", "someone@gmail.com", ds.getName()); + } + + @Test + public void testImportDataRequest() throws Exception { + JAXBContext jaxb = JAXBContext.newInstance(ImportDataRequest.class); + Unmarshaller unmarshaller = jaxb.createUnmarshaller(); + ImportDataRequest resp = (ImportDataRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("UnknownImportDataRequest.xml")); + List dsList = resp.getDataSources(); + assertNotNull("datasources should not be NULL", dsList); + assertFalse("list of datasources should not be empty", dsList.isEmpty()); + assertEquals("expecting one datasource in the list", 1, dsList.size()); + DataSourceNameOrId ds = dsList.get(0); + assertNotNull("Generic DataSourceNameOrId should not be NULL", ds); + assertNotNull("Generic DataSourceNameOrId ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for generic DataSource", "8d17e182-fdc6-4f6c-b83f-d478c9b04bfd", ds.getId()); + assertTrue("DataSource should be an instance of DataSourceNameOrId", ds instanceof DataSourceNameOrId); + + resp = (ImportDataRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("ImapImportDataRequest.xml")); + dsList = resp.getDataSources(); + assertNotNull("datasources should not be NULL", dsList); + assertFalse("list of datasources should not be empty", dsList.isEmpty()); + assertEquals("expecting 1 datasource in the list", 1, dsList.size()); + ds = dsList.get(0); + assertNotNull("IMAP DataSourceNameOrId should not be NULL", ds); + assertNotNull("IMAP DataSourceNameOrId ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for IMAP DataSourceNameOrId", "d96e9a7d-6af9-4625-ba68-37bcd73fce6d", ds.getId()); + assertTrue("DataSourceNameOrId should be an instance of ImapDataSourceNameOrId", ds instanceof ImapDataSourceNameOrId); + + resp = (ImportDataRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("Pop3ImportDataRequest.xml")); + dsList = resp.getDataSources(); + assertNotNull("datasources should not be NULL", dsList); + assertFalse("list of datasources should not be empty", dsList.isEmpty()); + assertEquals("expecting 1 datasource in the list", 1, dsList.size()); + ds = dsList.get(0); + assertNotNull("POP3 DataSourceNameOrId should not be NULL", ds); + assertNotNull("POP3 DataSourceNameOrId ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for POP3 DataSourceNameOrId", "d96e9a7d-6af9-4625-ba68-37bcd73fce6d", ds.getId()); + assertTrue("DataSourceNameOrId should be an instance of Pop3DataSourceNameOrId", ds instanceof Pop3DataSourceNameOrId); + + resp = (ImportDataRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("RssImportDataRequest.xml")); + dsList = resp.getDataSources(); + assertNotNull("datasources should not be NULL", dsList); + assertFalse("list of datasources should not be empty", dsList.isEmpty()); + assertEquals("expecting 1 datasource in the list", 1, dsList.size()); + ds = dsList.get(0); + assertNotNull("POP3 DataSourceNameOrId should not be NULL", ds); + assertNotNull("POP3 DataSourceNameOrId ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for RSS DataSourceNameOrId", "21e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSourceNameOrId should be an instance of RssDataSourceNameOrId", ds instanceof RssDataSourceNameOrId); + + resp = (ImportDataRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("CaldavImportDataRequest.xml")); + dsList = resp.getDataSources(); + assertNotNull("datasources should not be NULL", dsList); + assertFalse("list of datasources should not be empty", dsList.isEmpty()); + assertEquals("expecting 1 datasource in the list", 1, dsList.size()); + ds = dsList.get(0); + assertNotNull("Caldav DataSourceNameOrId should not be NULL", ds); + assertNotNull("Caldav DataSourceNameOrId ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for Caldav DataSourceNameOrId", "31e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSourceNameOrId should be an instance of CaldavDataSourceNameOrId", ds instanceof CaldavDataSourceNameOrId); + + resp = (ImportDataRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("CalImportDataRequest.xml")); + dsList = resp.getDataSources(); + assertNotNull("datasources should not be NULL", dsList); + assertFalse("list of datasources should not be empty", dsList.isEmpty()); + assertEquals("expecting 1 datasource in the list", 1, dsList.size()); + ds = dsList.get(0); + assertNotNull("Cal DataSourceNameOrId should not be NULL", ds); + assertNotNull("Cal DataSourceNameOrId ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for Caldav DataSourceNameOrId", "61e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSourceNameOrId should be an instance of CalDataSourceNameOrId", ds instanceof CalDataSourceNameOrId); + + resp = (ImportDataRequest) unmarshaller.unmarshal( + getClass().getResourceAsStream("GalImportDataRequest.xml")); + dsList = resp.getDataSources(); + assertNotNull("datasources should not be NULL", dsList); + assertFalse("list of datasources should not be empty", dsList.isEmpty()); + assertEquals("expecting 1 datasource in the list", 1, dsList.size()); + ds = dsList.get(0); + assertNotNull("GAL DataSourceNameOrId should not be NULL", ds); + assertNotNull("GAL DataSourceNameOrId ID should not be NULL", ds.getId()); + assertEquals("Wrong ID for Caldav DataSourceNameOrId", "51e1c69c-bbb3-4f5d-8903-14ef8bdacbcc", ds.getId()); + assertTrue("DataSourceNameOrId should be an instance of CalDataSourceNameOrId", ds instanceof GalDataSourceNameOrId); + } +} diff --git a/soap/src/java-test/com/zimbra/soap/mail/GalImportDataRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/GalImportDataRequest.xml new file mode 100644 index 00000000000..139eac2f73b --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/GalImportDataRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/GetImapDataSourcesResponse.xml b/soap/src/java-test/com/zimbra/soap/mail/GetImapDataSourcesResponse.xml new file mode 100644 index 00000000000..438830ba03f --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/GetImapDataSourcesResponse.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/GetManyDataSourcesResponse.xml b/soap/src/java-test/com/zimbra/soap/mail/GetManyDataSourcesResponse.xml new file mode 100644 index 00000000000..f9163baa216 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/GetManyDataSourcesResponse.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/GetOneEachDataSourcesResponse.xml b/soap/src/java-test/com/zimbra/soap/mail/GetOneEachDataSourcesResponse.xml new file mode 100644 index 00000000000..5ad6ff5490e --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/GetOneEachDataSourcesResponse.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/GetTwoDataSourcesResponse.xml b/soap/src/java-test/com/zimbra/soap/mail/GetTwoDataSourcesResponse.xml new file mode 100644 index 00000000000..2f1074cbf6e --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/GetTwoDataSourcesResponse.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/GetUnknownDataSourcesResponse.xml b/soap/src/java-test/com/zimbra/soap/mail/GetUnknownDataSourcesResponse.xml new file mode 100644 index 00000000000..160d79e6e6c --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/GetUnknownDataSourcesResponse.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/ImapImportDataRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/ImapImportDataRequest.xml new file mode 100644 index 00000000000..bb47f95737c --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/ImapImportDataRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/ModifyCalDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/ModifyCalDataSourceRequest.xml new file mode 100644 index 00000000000..cdcd1c63604 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/ModifyCalDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/ModifyCaldavDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/ModifyCaldavDataSourceRequest.xml new file mode 100644 index 00000000000..1a6137c6522 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/ModifyCaldavDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/ModifyGalDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/ModifyGalDataSourceRequest.xml new file mode 100644 index 00000000000..263e44132ae --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/ModifyGalDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/ModifyImapDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/ModifyImapDataSourceRequest.xml new file mode 100644 index 00000000000..908855d0038 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/ModifyImapDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/ModifyPop3DataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/ModifyPop3DataSourceRequest.xml new file mode 100644 index 00000000000..c0131ee22ef --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/ModifyPop3DataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/ModifyRssDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/ModifyRssDataSourceRequest.xml new file mode 100644 index 00000000000..56b354000ed --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/ModifyRssDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/ModifyUnknownDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/ModifyUnknownDataSourceRequest.xml new file mode 100644 index 00000000000..ea7eb37acee --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/ModifyUnknownDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/Pop3ImportDataRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/Pop3ImportDataRequest.xml new file mode 100644 index 00000000000..87e4458540c --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/Pop3ImportDataRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/RssImportDataRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/RssImportDataRequest.xml new file mode 100644 index 00000000000..8982af80806 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/RssImportDataRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/TestCalDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/TestCalDataSourceRequest.xml new file mode 100644 index 00000000000..ff40ee04a58 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/TestCalDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/TestCaldavDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/TestCaldavDataSourceRequest.xml new file mode 100644 index 00000000000..0c0c59557e3 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/TestCaldavDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/TestGalDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/TestGalDataSourceRequest.xml new file mode 100644 index 00000000000..5bcb523378a --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/TestGalDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/TestImapDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/TestImapDataSourceRequest.xml new file mode 100644 index 00000000000..bfb84cb20af --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/TestImapDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/TestPop3DataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/TestPop3DataSourceRequest.xml new file mode 100644 index 00000000000..34639eec00a --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/TestPop3DataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/TestRssDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/TestRssDataSourceRequest.xml new file mode 100644 index 00000000000..354c50daa72 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/TestRssDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/TestUnknownDataSourceRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/TestUnknownDataSourceRequest.xml new file mode 100644 index 00000000000..be2a3a6bf88 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/TestUnknownDataSourceRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java-test/com/zimbra/soap/mail/UnknownImportDataRequest.xml b/soap/src/java-test/com/zimbra/soap/mail/UnknownImportDataRequest.xml new file mode 100644 index 00000000000..579a3672008 --- /dev/null +++ b/soap/src/java-test/com/zimbra/soap/mail/UnknownImportDataRequest.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/soap/src/java/com/zimbra/soap/JaxbUtil.java b/soap/src/java/com/zimbra/soap/JaxbUtil.java index 2adf23b8403..0758f8c5d89 100644 --- a/soap/src/java/com/zimbra/soap/JaxbUtil.java +++ b/soap/src/java/com/zimbra/soap/JaxbUtil.java @@ -78,17 +78,20 @@ public final class JaxbUtil { static { MESSAGE_CLASSES = new Class>[] { - // zimbraAccount com.zimbra.soap.account.message.AuthRequest.class, com.zimbra.soap.account.message.AuthResponse.class, com.zimbra.soap.account.message.AutoCompleteGalRequest.class, com.zimbra.soap.account.message.AutoCompleteGalResponse.class, + com.zimbra.soap.account.message.BootstrapMobileGatewayAppRequest.class, + com.zimbra.soap.account.message.BootstrapMobileGatewayAppResponse.class, com.zimbra.soap.account.message.ChangePasswordRequest.class, com.zimbra.soap.account.message.ChangePasswordResponse.class, com.zimbra.soap.account.message.CheckLicenseRequest.class, com.zimbra.soap.account.message.CheckLicenseResponse.class, com.zimbra.soap.account.message.CheckRightsRequest.class, com.zimbra.soap.account.message.CheckRightsResponse.class, + com.zimbra.soap.account.message.CreateAppSpecificPasswordRequest.class, + com.zimbra.soap.account.message.CreateAppSpecificPasswordResponse.class, com.zimbra.soap.account.message.CreateDistributionListRequest.class, com.zimbra.soap.account.message.CreateDistributionListResponse.class, com.zimbra.soap.account.message.CreateIdentityRequest.class, @@ -99,18 +102,26 @@ public final class JaxbUtil { com.zimbra.soap.account.message.DeleteIdentityResponse.class, com.zimbra.soap.account.message.DeleteSignatureRequest.class, com.zimbra.soap.account.message.DeleteSignatureResponse.class, + com.zimbra.soap.account.message.DisableTwoFactorAuthRequest.class, + com.zimbra.soap.account.message.DisableTwoFactorAuthResponse.class, com.zimbra.soap.account.message.DiscoverRightsRequest.class, com.zimbra.soap.account.message.DiscoverRightsResponse.class, com.zimbra.soap.account.message.DistributionListActionRequest.class, com.zimbra.soap.account.message.DistributionListActionResponse.class, + com.zimbra.soap.account.message.EnableTwoFactorAuthRequest.class, + com.zimbra.soap.account.message.EnableTwoFactorAuthResponse.class, com.zimbra.soap.account.message.EndSessionRequest.class, com.zimbra.soap.account.message.EndSessionResponse.class, + com.zimbra.soap.account.message.GenerateScratchCodesRequest.class, + com.zimbra.soap.account.message.GenerateScratchCodesResponse.class, com.zimbra.soap.account.message.GetAccountDistributionListsRequest.class, com.zimbra.soap.account.message.GetAccountDistributionListsResponse.class, com.zimbra.soap.account.message.GetAccountInfoRequest.class, com.zimbra.soap.account.message.GetAccountInfoResponse.class, com.zimbra.soap.account.message.GetAllLocalesRequest.class, com.zimbra.soap.account.message.GetAllLocalesResponse.class, + com.zimbra.soap.account.message.GetAppSpecificPasswordsRequest.class, + com.zimbra.soap.account.message.GetAppSpecificPasswordsResponse.class, com.zimbra.soap.account.message.GetAvailableCsvFormatsRequest.class, com.zimbra.soap.account.message.GetAvailableCsvFormatsResponse.class, com.zimbra.soap.account.message.GetAvailableLocalesRequest.class, @@ -121,20 +132,30 @@ public final class JaxbUtil { com.zimbra.soap.account.message.GetDistributionListMembersResponse.class, com.zimbra.soap.account.message.GetDistributionListRequest.class, com.zimbra.soap.account.message.GetDistributionListResponse.class, + com.zimbra.soap.account.message.GetGcmSenderIdRequest.class, + com.zimbra.soap.account.message.GetGcmSenderIdResponse.class, com.zimbra.soap.account.message.GetIdentitiesRequest.class, com.zimbra.soap.account.message.GetIdentitiesResponse.class, com.zimbra.soap.account.message.GetInfoRequest.class, com.zimbra.soap.account.message.GetInfoResponse.class, + com.zimbra.soap.account.message.GetOAuthConsumersRequest.class, + com.zimbra.soap.account.message.GetOAuthConsumersResponse.class, com.zimbra.soap.account.message.GetPrefsRequest.class, com.zimbra.soap.account.message.GetPrefsResponse.class, com.zimbra.soap.account.message.GetRightsRequest.class, com.zimbra.soap.account.message.GetRightsResponse.class, com.zimbra.soap.account.message.GetSMIMEPublicCertsRequest.class, com.zimbra.soap.account.message.GetSMIMEPublicCertsResponse.class, + com.zimbra.soap.account.message.GetScratchCodesRequest.class, + com.zimbra.soap.account.message.GetScratchCodesResponse.class, com.zimbra.soap.account.message.GetShareInfoRequest.class, com.zimbra.soap.account.message.GetShareInfoResponse.class, com.zimbra.soap.account.message.GetSignaturesRequest.class, com.zimbra.soap.account.message.GetSignaturesResponse.class, + com.zimbra.soap.account.message.GetSmimeCertificateInfoRequest.class, + com.zimbra.soap.account.message.GetSmimeCertificateInfoResponse.class, + com.zimbra.soap.account.message.GetTrustedDevicesRequest.class, + com.zimbra.soap.account.message.GetTrustedDevicesResponse.class, com.zimbra.soap.account.message.GetVersionInfoRequest.class, com.zimbra.soap.account.message.GetVersionInfoResponse.class, com.zimbra.soap.account.message.GetWhiteBlackListRequest.class, @@ -153,8 +174,22 @@ public final class JaxbUtil { com.zimbra.soap.account.message.ModifyWhiteBlackListResponse.class, com.zimbra.soap.account.message.ModifyZimletPrefsRequest.class, com.zimbra.soap.account.message.ModifyZimletPrefsResponse.class, + com.zimbra.soap.account.message.RegisterMobileGatewayAppRequest.class, + com.zimbra.soap.account.message.RegisterMobileGatewayAppResponse.class, + com.zimbra.soap.account.message.RenewMobileGatewayAppTokenRequest.class, + com.zimbra.soap.account.message.RenewMobileGatewayAppTokenResponse.class, + com.zimbra.soap.account.message.RevokeAppSpecificPasswordRequest.class, + com.zimbra.soap.account.message.RevokeAppSpecificPasswordResponse.class, + com.zimbra.soap.account.message.RevokeOAuthConsumerRequest.class, + com.zimbra.soap.account.message.RevokeOAuthConsumerResponse.class, + com.zimbra.soap.account.message.RevokeOtherTrustedDevicesRequest.class, + com.zimbra.soap.account.message.RevokeOtherTrustedDevicesResponse.class, com.zimbra.soap.account.message.RevokeRightsRequest.class, com.zimbra.soap.account.message.RevokeRightsResponse.class, + com.zimbra.soap.account.message.RevokeTrustedDeviceRequest.class, + com.zimbra.soap.account.message.RevokeTrustedDeviceResponse.class, + com.zimbra.soap.account.message.SaveSmimeCertificateRequest.class, + com.zimbra.soap.account.message.SaveSmimeCertificateResponse.class, com.zimbra.soap.account.message.SearchCalendarResourcesRequest.class, com.zimbra.soap.account.message.SearchCalendarResourcesResponse.class, com.zimbra.soap.account.message.SearchGalRequest.class, @@ -163,386 +198,68 @@ public final class JaxbUtil { com.zimbra.soap.account.message.SubscribeDistributionListResponse.class, com.zimbra.soap.account.message.SyncGalRequest.class, com.zimbra.soap.account.message.SyncGalResponse.class, - - // two-factor auth - com.zimbra.soap.account.message.EnableTwoFactorAuthRequest.class, - com.zimbra.soap.account.message.EnableTwoFactorAuthResponse.class, - com.zimbra.soap.account.message.DisableTwoFactorAuthRequest.class, - com.zimbra.soap.account.message.DisableTwoFactorAuthResponse.class, - com.zimbra.soap.account.message.CreateAppSpecificPasswordRequest.class, - com.zimbra.soap.account.message.CreateAppSpecificPasswordResponse.class, - com.zimbra.soap.account.message.RevokeAppSpecificPasswordRequest.class, - com.zimbra.soap.account.message.RevokeAppSpecificPasswordResponse.class, - com.zimbra.soap.account.message.GetAppSpecificPasswordsRequest.class, - com.zimbra.soap.account.message.GetAppSpecificPasswordsResponse.class, - com.zimbra.soap.account.message.GetScratchCodesRequest.class, - com.zimbra.soap.account.message.GetScratchCodesResponse.class, - com.zimbra.soap.account.message.GenerateScratchCodesRequest.class, - com.zimbra.soap.account.message.GenerateScratchCodesResponse.class, - com.zimbra.soap.account.message.GetTrustedDevicesRequest.class, - com.zimbra.soap.account.message.GetTrustedDevicesResponse.class, - com.zimbra.soap.account.message.RevokeTrustedDeviceRequest.class, - com.zimbra.soap.account.message.RevokeTrustedDeviceResponse.class, - com.zimbra.soap.account.message.RevokeOtherTrustedDevicesRequest.class, - com.zimbra.soap.account.message.RevokeOtherTrustedDevicesResponse.class, + com.zimbra.soap.admin.message.AbortHsmRequest.class, + com.zimbra.soap.admin.message.AbortHsmResponse.class, + com.zimbra.soap.admin.message.AbortXMbxSearchRequest.class, + com.zimbra.soap.admin.message.AbortXMbxSearchResponse.class, + com.zimbra.soap.admin.message.ActivateLicenseRequest.class, + com.zimbra.soap.admin.message.ActivateLicenseResponse.class, + com.zimbra.soap.admin.message.AddAccountAliasRequest.class, + com.zimbra.soap.admin.message.AddAccountAliasResponse.class, + com.zimbra.soap.admin.message.AddAccountLoggerRequest.class, + com.zimbra.soap.admin.message.AddAccountLoggerResponse.class, + com.zimbra.soap.admin.message.AddDistributionListAliasRequest.class, + com.zimbra.soap.admin.message.AddDistributionListAliasResponse.class, + com.zimbra.soap.admin.message.AddDistributionListMemberRequest.class, + com.zimbra.soap.admin.message.AddDistributionListMemberResponse.class, + com.zimbra.soap.admin.message.AddGalSyncDataSourceRequest.class, + com.zimbra.soap.admin.message.AddGalSyncDataSourceResponse.class, + com.zimbra.soap.admin.message.AdminCreateWaitSetRequest.class, + com.zimbra.soap.admin.message.AdminCreateWaitSetResponse.class, + com.zimbra.soap.admin.message.AdminDestroyWaitSetRequest.class, + com.zimbra.soap.admin.message.AdminDestroyWaitSetResponse.class, + com.zimbra.soap.admin.message.AdminWaitSetRequest.class, + com.zimbra.soap.admin.message.AdminWaitSetResponse.class, + com.zimbra.soap.admin.message.AuthRequest.class, + com.zimbra.soap.admin.message.AuthResponse.class, + com.zimbra.soap.admin.message.AutoCompleteGalRequest.class, + com.zimbra.soap.admin.message.AutoCompleteGalResponse.class, + com.zimbra.soap.admin.message.AutoProvAccountRequest.class, + com.zimbra.soap.admin.message.AutoProvAccountResponse.class, + com.zimbra.soap.admin.message.AutoProvTaskControlRequest.class, + com.zimbra.soap.admin.message.AutoProvTaskControlResponse.class, + com.zimbra.soap.admin.message.BackupAccountQueryRequest.class, + com.zimbra.soap.admin.message.BackupAccountQueryResponse.class, + com.zimbra.soap.admin.message.BackupQueryRequest.class, + com.zimbra.soap.admin.message.BackupQueryResponse.class, + com.zimbra.soap.admin.message.BackupRequest.class, + com.zimbra.soap.admin.message.BackupResponse.class, + com.zimbra.soap.admin.message.CancelPendingRemoteWipeRequest.class, + com.zimbra.soap.admin.message.CancelPendingRemoteWipeResponse.class, + com.zimbra.soap.admin.message.CheckAuthConfigRequest.class, + com.zimbra.soap.admin.message.CheckAuthConfigResponse.class, + com.zimbra.soap.admin.message.CheckBlobConsistencyRequest.class, + com.zimbra.soap.admin.message.CheckBlobConsistencyResponse.class, + com.zimbra.soap.admin.message.CheckDirectoryRequest.class, + com.zimbra.soap.admin.message.CheckDirectoryResponse.class, + com.zimbra.soap.admin.message.CheckDomainMXRecordRequest.class, + com.zimbra.soap.admin.message.CheckDomainMXRecordResponse.class, + com.zimbra.soap.admin.message.CheckExchangeAuthRequest.class, + com.zimbra.soap.admin.message.CheckExchangeAuthResponse.class, + com.zimbra.soap.admin.message.CheckGalConfigRequest.class, + com.zimbra.soap.admin.message.CheckGalConfigResponse.class, + com.zimbra.soap.admin.message.CheckHealthRequest.class, + com.zimbra.soap.admin.message.CheckHealthResponse.class, + com.zimbra.soap.admin.message.CheckHostnameResolveRequest.class, + com.zimbra.soap.admin.message.CheckHostnameResolveResponse.class, + com.zimbra.soap.admin.message.CheckPasswordStrengthRequest.class, + com.zimbra.soap.admin.message.CheckPasswordStrengthResponse.class, + com.zimbra.soap.admin.message.CheckRightRequest.class, + com.zimbra.soap.admin.message.CheckRightResponse.class, + com.zimbra.soap.admin.message.ClearCookieRequest.class, + com.zimbra.soap.admin.message.ClearCookieResponse.class, com.zimbra.soap.admin.message.ClearTwoFactorAuthDataRequest.class, com.zimbra.soap.admin.message.ClearTwoFactorAuthDataResponse.class, - com.zimbra.soap.admin.message.GetClearTwoFactorAuthDataStatusRequest.class, - com.zimbra.soap.admin.message.GetClearTwoFactorAuthDataStatusResponse.class, - - // zimbraMail - com.zimbra.soap.mail.message.AddAppointmentInviteRequest.class, - com.zimbra.soap.mail.message.AddAppointmentInviteResponse.class, - com.zimbra.soap.mail.message.AddCommentRequest.class, - com.zimbra.soap.mail.message.AddCommentResponse.class, - com.zimbra.soap.mail.message.AddMsgRequest.class, - com.zimbra.soap.mail.message.AddMsgResponse.class, - com.zimbra.soap.mail.message.AddTaskInviteRequest.class, - com.zimbra.soap.mail.message.AddTaskInviteResponse.class, - com.zimbra.soap.mail.message.AnnounceOrganizerChangeRequest.class, - com.zimbra.soap.mail.message.AnnounceOrganizerChangeResponse.class, - com.zimbra.soap.mail.message.ApplyFilterRulesRequest.class, - com.zimbra.soap.mail.message.ApplyFilterRulesResponse.class, - com.zimbra.soap.mail.message.ApplyOutgoingFilterRulesRequest.class, - com.zimbra.soap.mail.message.ApplyOutgoingFilterRulesResponse.class, - com.zimbra.soap.mail.message.AutoCompleteRequest.class, - com.zimbra.soap.mail.message.AutoCompleteResponse.class, - com.zimbra.soap.mail.message.BounceMsgRequest.class, - com.zimbra.soap.mail.message.BounceMsgResponse.class, - com.zimbra.soap.mail.message.BrowseRequest.class, - com.zimbra.soap.mail.message.BrowseResponse.class, - com.zimbra.soap.mail.message.CancelAppointmentRequest.class, - com.zimbra.soap.mail.message.CancelAppointmentResponse.class, - com.zimbra.soap.mail.message.CancelTaskRequest.class, - com.zimbra.soap.mail.message.CancelTaskResponse.class, - com.zimbra.soap.mail.message.CheckDeviceStatusRequest.class, - com.zimbra.soap.mail.message.CheckDeviceStatusResponse.class, - com.zimbra.soap.mail.message.CheckPermissionRequest.class, - com.zimbra.soap.mail.message.CheckPermissionResponse.class, - com.zimbra.soap.mail.message.CheckRecurConflictsRequest.class, - com.zimbra.soap.mail.message.CheckRecurConflictsResponse.class, - com.zimbra.soap.mail.message.CheckSpellingRequest.class, - com.zimbra.soap.mail.message.CheckSpellingResponse.class, - com.zimbra.soap.mail.message.CompleteTaskInstanceRequest.class, - com.zimbra.soap.mail.message.CompleteTaskInstanceResponse.class, - com.zimbra.soap.mail.message.ContactActionRequest.class, - com.zimbra.soap.mail.message.ContactActionResponse.class, - com.zimbra.soap.mail.message.ConvActionRequest.class, - com.zimbra.soap.mail.message.ConvActionResponse.class, - com.zimbra.soap.mail.message.CounterAppointmentRequest.class, - com.zimbra.soap.mail.message.CounterAppointmentResponse.class, - com.zimbra.soap.mail.message.CreateAppointmentExceptionRequest.class, - com.zimbra.soap.mail.message.CreateAppointmentExceptionResponse.class, - com.zimbra.soap.mail.message.CreateAppointmentRequest.class, - com.zimbra.soap.mail.message.CreateAppointmentResponse.class, - com.zimbra.soap.mail.message.CreateContactRequest.class, - com.zimbra.soap.mail.message.CreateContactResponse.class, - com.zimbra.soap.mail.message.CreateDataSourceRequest.class, - com.zimbra.soap.mail.message.CreateDataSourceResponse.class, - com.zimbra.soap.mail.message.CreateFolderRequest.class, - com.zimbra.soap.mail.message.CreateFolderResponse.class, - com.zimbra.soap.mail.message.CreateMountpointRequest.class, - com.zimbra.soap.mail.message.CreateMountpointResponse.class, - com.zimbra.soap.mail.message.CreateNoteRequest.class, - com.zimbra.soap.mail.message.CreateNoteResponse.class, - com.zimbra.soap.mail.message.CreateSearchFolderRequest.class, - com.zimbra.soap.mail.message.CreateSearchFolderResponse.class, - com.zimbra.soap.mail.message.CreateTagRequest.class, - com.zimbra.soap.mail.message.CreateTagResponse.class, - com.zimbra.soap.mail.message.CreateTaskExceptionRequest.class, - com.zimbra.soap.mail.message.CreateTaskExceptionResponse.class, - com.zimbra.soap.mail.message.CreateTaskRequest.class, - com.zimbra.soap.mail.message.CreateTaskResponse.class, - com.zimbra.soap.mail.message.CreateWaitSetRequest.class, - com.zimbra.soap.mail.message.CreateWaitSetResponse.class, - com.zimbra.soap.mail.message.DeclineCounterAppointmentRequest.class, - com.zimbra.soap.mail.message.DeclineCounterAppointmentResponse.class, - com.zimbra.soap.mail.message.DeleteDataSourceRequest.class, - com.zimbra.soap.mail.message.DeleteDataSourceResponse.class, - com.zimbra.soap.mail.message.DeleteDeviceRequest.class, - com.zimbra.soap.mail.message.DeleteDeviceResponse.class, - com.zimbra.soap.mail.message.DestroyWaitSetRequest.class, - com.zimbra.soap.mail.message.DestroyWaitSetResponse.class, - com.zimbra.soap.mail.message.DiffDocumentRequest.class, - com.zimbra.soap.mail.message.DiffDocumentResponse.class, - com.zimbra.soap.mail.message.DismissCalendarItemAlarmRequest.class, - com.zimbra.soap.mail.message.DismissCalendarItemAlarmResponse.class, - com.zimbra.soap.mail.message.DocumentActionRequest.class, - com.zimbra.soap.mail.message.DocumentActionResponse.class, - com.zimbra.soap.mail.message.EmptyDumpsterRequest.class, - com.zimbra.soap.mail.message.EmptyDumpsterResponse.class, - com.zimbra.soap.mail.message.EnableSharedReminderRequest.class, - com.zimbra.soap.mail.message.EnableSharedReminderResponse.class, - com.zimbra.soap.mail.message.ExpandRecurRequest.class, - com.zimbra.soap.mail.message.ExpandRecurResponse.class, - com.zimbra.soap.mail.message.ExportContactsRequest.class, - com.zimbra.soap.mail.message.ExportContactsResponse.class, - com.zimbra.soap.mail.message.FolderActionRequest.class, - com.zimbra.soap.mail.message.FolderActionResponse.class, - com.zimbra.soap.mail.message.ForwardAppointmentInviteRequest.class, - com.zimbra.soap.mail.message.ForwardAppointmentInviteResponse.class, - com.zimbra.soap.mail.message.ForwardAppointmentRequest.class, - com.zimbra.soap.mail.message.ForwardAppointmentResponse.class, - com.zimbra.soap.mail.message.GenerateUUIDRequest.class, - com.zimbra.soap.mail.message.GenerateUUIDResponse.class, - com.zimbra.soap.mail.message.GetActivityStreamRequest.class, - com.zimbra.soap.mail.message.GetActivityStreamResponse.class, - com.zimbra.soap.mail.message.GetAllDevicesRequest.class, - com.zimbra.soap.mail.message.GetAllDevicesResponse.class, - com.zimbra.soap.mail.message.GetAppointmentRequest.class, - com.zimbra.soap.mail.message.GetAppointmentResponse.class, - com.zimbra.soap.mail.message.GetApptSummariesRequest.class, - com.zimbra.soap.mail.message.GetApptSummariesResponse.class, - com.zimbra.soap.mail.message.GetCalendarItemSummariesRequest.class, - com.zimbra.soap.mail.message.GetCalendarItemSummariesResponse.class, - com.zimbra.soap.mail.message.GetCommentsRequest.class, - com.zimbra.soap.mail.message.GetCommentsResponse.class, - com.zimbra.soap.mail.message.GetContactBackupListRequest.class, - com.zimbra.soap.mail.message.GetContactBackupListResponse.class, - com.zimbra.soap.mail.message.GetContactsRequest.class, - com.zimbra.soap.mail.message.GetContactsResponse.class, - com.zimbra.soap.mail.message.GetConvRequest.class, - com.zimbra.soap.mail.message.GetConvResponse.class, - com.zimbra.soap.mail.message.GetCustomMetadataRequest.class, - com.zimbra.soap.mail.message.GetCustomMetadataResponse.class, - com.zimbra.soap.mail.message.GetDataSourcesRequest.class, - com.zimbra.soap.mail.message.GetDataSourcesResponse.class, - com.zimbra.soap.mail.message.GetDataSourceUsageRequest.class, - com.zimbra.soap.mail.message.GetDataSourceUsageResponse.class, - com.zimbra.soap.mail.message.GetDocumentShareURLRequest.class, - com.zimbra.soap.mail.message.GetDocumentShareURLResponse.class, - com.zimbra.soap.mail.message.GetEffectiveFolderPermsRequest.class, - com.zimbra.soap.mail.message.GetEffectiveFolderPermsResponse.class, - com.zimbra.soap.mail.message.GetFilterRulesRequest.class, - com.zimbra.soap.mail.message.GetFilterRulesResponse.class, - com.zimbra.soap.mail.message.GetFolderRequest.class, - com.zimbra.soap.mail.message.GetFolderResponse.class, - com.zimbra.soap.mail.message.GetFreeBusyRequest.class, - com.zimbra.soap.mail.message.GetFreeBusyResponse.class, - com.zimbra.soap.mail.message.GetICalRequest.class, - com.zimbra.soap.mail.message.GetICalResponse.class, - com.zimbra.soap.mail.message.GetImportStatusRequest.class, - com.zimbra.soap.mail.message.GetImportStatusResponse.class, - com.zimbra.soap.mail.message.GetItemRequest.class, - com.zimbra.soap.mail.message.GetItemResponse.class, - com.zimbra.soap.mail.message.GetMailboxMetadataRequest.class, - com.zimbra.soap.mail.message.GetMailboxMetadataResponse.class, - com.zimbra.soap.mail.message.GetMiniCalRequest.class, - com.zimbra.soap.mail.message.GetMiniCalResponse.class, - com.zimbra.soap.mail.message.GetMsgMetadataRequest.class, - com.zimbra.soap.mail.message.GetMsgMetadataResponse.class, - com.zimbra.soap.mail.message.GetMsgRequest.class, - com.zimbra.soap.mail.message.GetMsgResponse.class, - com.zimbra.soap.mail.message.GetNoteRequest.class, - com.zimbra.soap.mail.message.GetNoteResponse.class, - com.zimbra.soap.mail.message.GetNotificationsRequest.class, - com.zimbra.soap.mail.message.GetNotificationsResponse.class, - com.zimbra.soap.mail.message.GetOutgoingFilterRulesRequest.class, - com.zimbra.soap.mail.message.GetOutgoingFilterRulesResponse.class, - com.zimbra.soap.mail.message.GetPermissionRequest.class, - com.zimbra.soap.mail.message.GetPermissionResponse.class, - com.zimbra.soap.mail.message.GetRecurRequest.class, - com.zimbra.soap.mail.message.GetRecurResponse.class, - com.zimbra.soap.mail.message.GetSearchFolderRequest.class, - com.zimbra.soap.mail.message.GetSearchFolderResponse.class, - com.zimbra.soap.mail.message.GetShareDetailsRequest.class, - com.zimbra.soap.mail.message.GetShareDetailsResponse.class, - com.zimbra.soap.mail.message.GetShareNotificationsRequest.class, - com.zimbra.soap.mail.message.GetShareNotificationsResponse.class, - com.zimbra.soap.mail.message.GetSpellDictionariesRequest.class, - com.zimbra.soap.mail.message.GetSpellDictionariesResponse.class, - com.zimbra.soap.mail.message.GetSystemRetentionPolicyRequest.class, - com.zimbra.soap.mail.message.GetSystemRetentionPolicyResponse.class, - com.zimbra.soap.mail.message.GetTagRequest.class, - com.zimbra.soap.mail.message.GetTagResponse.class, - com.zimbra.soap.mail.message.GetTaskRequest.class, - com.zimbra.soap.mail.message.GetTaskResponse.class, - com.zimbra.soap.mail.message.GetTaskSummariesRequest.class, - com.zimbra.soap.mail.message.GetTaskSummariesResponse.class, - com.zimbra.soap.mail.message.GetWatchersRequest.class, - com.zimbra.soap.mail.message.GetWatchersResponse.class, - com.zimbra.soap.mail.message.GetWatchingItemsRequest.class, - com.zimbra.soap.mail.message.GetWatchingItemsResponse.class, - com.zimbra.soap.mail.message.GetWorkingHoursRequest.class, - com.zimbra.soap.mail.message.GetWorkingHoursResponse.class, - com.zimbra.soap.mail.message.GetYahooAuthTokenRequest.class, - com.zimbra.soap.mail.message.GetYahooAuthTokenResponse.class, - com.zimbra.soap.mail.message.GetYahooCookieRequest.class, - com.zimbra.soap.mail.message.GetYahooCookieResponse.class, - com.zimbra.soap.mail.message.GrantPermissionRequest.class, - com.zimbra.soap.mail.message.GrantPermissionResponse.class, - com.zimbra.soap.mail.message.ICalReplyRequest.class, - com.zimbra.soap.mail.message.ICalReplyResponse.class, - com.zimbra.soap.mail.message.ImportAppointmentsRequest.class, - com.zimbra.soap.mail.message.ImportAppointmentsResponse.class, - com.zimbra.soap.mail.message.ImportContactsRequest.class, - com.zimbra.soap.mail.message.ImportContactsResponse.class, - com.zimbra.soap.mail.message.ImportDataRequest.class, - com.zimbra.soap.mail.message.ImportDataResponse.class, - com.zimbra.soap.mail.message.InvalidateReminderDeviceRequest.class, - com.zimbra.soap.mail.message.InvalidateReminderDeviceResponse.class, - com.zimbra.soap.mail.message.ItemActionRequest.class, - com.zimbra.soap.mail.message.ItemActionResponse.class, - com.zimbra.soap.mail.message.ListDocumentRevisionsRequest.class, - com.zimbra.soap.mail.message.ListDocumentRevisionsResponse.class, - com.zimbra.soap.mail.message.ModifyAppointmentRequest.class, - com.zimbra.soap.mail.message.ModifyAppointmentResponse.class, - com.zimbra.soap.mail.message.ModifyContactRequest.class, - com.zimbra.soap.mail.message.ModifyContactResponse.class, - com.zimbra.soap.mail.message.ModifyDataSourceRequest.class, - com.zimbra.soap.mail.message.ModifyDataSourceResponse.class, - com.zimbra.soap.mail.message.ModifyFilterRulesRequest.class, - com.zimbra.soap.mail.message.ModifyFilterRulesResponse.class, - com.zimbra.soap.mail.message.ModifyMailboxMetadataRequest.class, - com.zimbra.soap.mail.message.ModifyMailboxMetadataResponse.class, - com.zimbra.soap.mail.message.ModifyOutgoingFilterRulesRequest.class, - com.zimbra.soap.mail.message.ModifyOutgoingFilterRulesResponse.class, - com.zimbra.soap.mail.message.ModifySearchFolderRequest.class, - com.zimbra.soap.mail.message.ModifySearchFolderResponse.class, - com.zimbra.soap.mail.message.ModifyTaskRequest.class, - com.zimbra.soap.mail.message.ModifyTaskResponse.class, - com.zimbra.soap.mail.message.MsgActionRequest.class, - com.zimbra.soap.mail.message.MsgActionResponse.class, - com.zimbra.soap.mail.message.NoOpRequest.class, - com.zimbra.soap.mail.message.NoOpResponse.class, - com.zimbra.soap.mail.message.NoteActionRequest.class, - com.zimbra.soap.mail.message.NoteActionResponse.class, - com.zimbra.soap.mail.message.PurgeRevisionRequest.class, - com.zimbra.soap.mail.message.PurgeRevisionResponse.class, - com.zimbra.soap.mail.message.RankingActionRequest.class, - com.zimbra.soap.mail.message.RankingActionResponse.class, - com.zimbra.soap.mail.message.RegisterDeviceRequest.class, - com.zimbra.soap.mail.message.RegisterDeviceResponse.class, - com.zimbra.soap.mail.message.RemoveAttachmentsRequest.class, - com.zimbra.soap.mail.message.RemoveAttachmentsResponse.class, - com.zimbra.soap.mail.message.RevokePermissionRequest.class, - com.zimbra.soap.mail.message.RevokePermissionResponse.class, - com.zimbra.soap.mail.message.SaveDocumentRequest.class, - com.zimbra.soap.mail.message.SaveDocumentResponse.class, - com.zimbra.soap.mail.message.SaveDraftRequest.class, - com.zimbra.soap.mail.message.SaveDraftResponse.class, - com.zimbra.soap.mail.message.SearchConvRequest.class, - com.zimbra.soap.mail.message.SearchConvResponse.class, - com.zimbra.soap.mail.message.SearchRequest.class, - com.zimbra.soap.mail.message.SearchResponse.class, - com.zimbra.soap.mail.message.SendDeliveryReportRequest.class, - com.zimbra.soap.mail.message.SendDeliveryReportResponse.class, - com.zimbra.soap.mail.message.SendInviteReplyRequest.class, - com.zimbra.soap.mail.message.SendInviteReplyResponse.class, - com.zimbra.soap.mail.message.SendMsgRequest.class, - com.zimbra.soap.mail.message.SendMsgResponse.class, - com.zimbra.soap.mail.message.SendShareNotificationRequest.class, - com.zimbra.soap.mail.message.SendShareNotificationResponse.class, - com.zimbra.soap.mail.message.SendVerificationCodeRequest.class, - com.zimbra.soap.mail.message.SendVerificationCodeResponse.class, - com.zimbra.soap.mail.message.SetAppointmentRequest.class, - com.zimbra.soap.mail.message.SetAppointmentResponse.class, - com.zimbra.soap.mail.message.SetCustomMetadataRequest.class, - com.zimbra.soap.mail.message.SetCustomMetadataResponse.class, - com.zimbra.soap.mail.message.SetMailboxMetadataRequest.class, - com.zimbra.soap.mail.message.SetMailboxMetadataResponse.class, - com.zimbra.soap.mail.message.SetTaskRequest.class, - com.zimbra.soap.mail.message.SetTaskResponse.class, - com.zimbra.soap.mail.message.SnoozeCalendarItemAlarmRequest.class, - com.zimbra.soap.mail.message.SnoozeCalendarItemAlarmResponse.class, - com.zimbra.soap.mail.message.SyncRequest.class, - com.zimbra.soap.mail.message.SyncResponse.class, - com.zimbra.soap.mail.message.TagActionRequest.class, - com.zimbra.soap.mail.message.TagActionResponse.class, - com.zimbra.soap.mail.message.TestDataSourceRequest.class, - com.zimbra.soap.mail.message.TestDataSourceResponse.class, - com.zimbra.soap.mail.message.UpdateDeviceStatusRequest.class, - com.zimbra.soap.mail.message.UpdateDeviceStatusResponse.class, - com.zimbra.soap.mail.message.VerifyCodeRequest.class, - com.zimbra.soap.mail.message.VerifyCodeResponse.class, - com.zimbra.soap.mail.message.WaitSetRequest.class, - com.zimbra.soap.mail.message.WaitSetResponse.class, - - //IMAP - com.zimbra.soap.mail.message.RecordIMAPSessionRequest.class, - com.zimbra.soap.mail.message.RecordIMAPSessionResponse.class, - com.zimbra.soap.mail.message.GetIMAPRecentRequest.class, - com.zimbra.soap.mail.message.GetIMAPRecentResponse.class, - com.zimbra.soap.mail.message.IMAPCopyRequest.class, - com.zimbra.soap.mail.message.IMAPCopyResponse.class, - com.zimbra.soap.mail.message.ListIMAPSubscriptionsRequest.class, - com.zimbra.soap.mail.message.ListIMAPSubscriptionsResponse.class, - com.zimbra.soap.mail.message.SaveIMAPSubscriptionsRequest.class, - com.zimbra.soap.mail.message.SaveIMAPSubscriptionsResponse.class, - com.zimbra.soap.mail.message.ResetRecentMessageCountRequest.class, - com.zimbra.soap.mail.message.ResetRecentMessageCountResponse.class, - com.zimbra.soap.mail.message.OpenIMAPFolderRequest.class, - com.zimbra.soap.mail.message.OpenIMAPFolderResponse.class, - com.zimbra.soap.mail.message.GetModifiedItemsIDsRequest.class, - com.zimbra.soap.mail.message.GetModifiedItemsIDsResponse.class, - com.zimbra.soap.mail.message.GetLastItemIdInMailboxRequest.class, - com.zimbra.soap.mail.message.GetLastItemIdInMailboxResponse.class, - com.zimbra.soap.mail.message.BeginTrackingIMAPRequest.class, - com.zimbra.soap.mail.message.BeginTrackingIMAPResponse.class, - - // zimbraAdmin - com.zimbra.soap.admin.message.AbortHsmRequest.class, - com.zimbra.soap.admin.message.AbortHsmResponse.class, - com.zimbra.soap.admin.message.AbortXMbxSearchRequest.class, - com.zimbra.soap.admin.message.AbortXMbxSearchResponse.class, - com.zimbra.soap.admin.message.ActivateLicenseRequest.class, - com.zimbra.soap.admin.message.ActivateLicenseResponse.class, - com.zimbra.soap.admin.message.AddAccountAliasRequest.class, - com.zimbra.soap.admin.message.AddAccountAliasResponse.class, - com.zimbra.soap.admin.message.AddAccountLoggerRequest.class, - com.zimbra.soap.admin.message.AddAccountLoggerResponse.class, - com.zimbra.soap.admin.message.AddDistributionListAliasRequest.class, - com.zimbra.soap.admin.message.AddDistributionListAliasResponse.class, - com.zimbra.soap.admin.message.AddDistributionListMemberRequest.class, - com.zimbra.soap.admin.message.AddDistributionListMemberResponse.class, - com.zimbra.soap.admin.message.AddGalSyncDataSourceRequest.class, - com.zimbra.soap.admin.message.AddGalSyncDataSourceResponse.class, - com.zimbra.soap.admin.message.AdminCreateWaitSetRequest.class, - com.zimbra.soap.admin.message.AdminCreateWaitSetResponse.class, - com.zimbra.soap.admin.message.AdminDestroyWaitSetRequest.class, - com.zimbra.soap.admin.message.AdminDestroyWaitSetResponse.class, - com.zimbra.soap.admin.message.AdminWaitSetRequest.class, - com.zimbra.soap.admin.message.AdminWaitSetResponse.class, - com.zimbra.soap.admin.message.AuthRequest.class, - com.zimbra.soap.admin.message.AuthResponse.class, - com.zimbra.soap.admin.message.AutoCompleteGalRequest.class, - com.zimbra.soap.admin.message.AutoCompleteGalResponse.class, - com.zimbra.soap.admin.message.AutoProvAccountRequest.class, - com.zimbra.soap.admin.message.AutoProvAccountResponse.class, - com.zimbra.soap.admin.message.AutoProvTaskControlRequest.class, - com.zimbra.soap.admin.message.AutoProvTaskControlResponse.class, - com.zimbra.soap.admin.message.BackupAccountQueryRequest.class, - com.zimbra.soap.admin.message.BackupAccountQueryResponse.class, - com.zimbra.soap.admin.message.BackupQueryRequest.class, - com.zimbra.soap.admin.message.BackupQueryResponse.class, - com.zimbra.soap.admin.message.BackupRequest.class, - com.zimbra.soap.admin.message.BackupResponse.class, - com.zimbra.soap.admin.message.CancelPendingRemoteWipeRequest.class, - com.zimbra.soap.admin.message.CancelPendingRemoteWipeResponse.class, - com.zimbra.soap.admin.message.CheckAuthConfigRequest.class, - com.zimbra.soap.admin.message.CheckAuthConfigResponse.class, - com.zimbra.soap.admin.message.CheckBlobConsistencyRequest.class, - com.zimbra.soap.admin.message.CheckBlobConsistencyResponse.class, - com.zimbra.soap.admin.message.CheckDirectoryRequest.class, - com.zimbra.soap.admin.message.CheckDirectoryResponse.class, - com.zimbra.soap.admin.message.CheckDomainMXRecordRequest.class, - com.zimbra.soap.admin.message.CheckDomainMXRecordResponse.class, - com.zimbra.soap.admin.message.CheckExchangeAuthRequest.class, - com.zimbra.soap.admin.message.CheckExchangeAuthResponse.class, - com.zimbra.soap.admin.message.CheckGalConfigRequest.class, - com.zimbra.soap.admin.message.CheckGalConfigResponse.class, - com.zimbra.soap.admin.message.CheckHealthRequest.class, - com.zimbra.soap.admin.message.CheckHealthResponse.class, - com.zimbra.soap.admin.message.CheckHostnameResolveRequest.class, - com.zimbra.soap.admin.message.CheckHostnameResolveResponse.class, - com.zimbra.soap.admin.message.CheckPasswordStrengthRequest.class, - com.zimbra.soap.admin.message.CheckPasswordStrengthResponse.class, - com.zimbra.soap.admin.message.CheckRightRequest.class, - com.zimbra.soap.admin.message.CheckRightResponse.class, - com.zimbra.soap.admin.message.ClearCookieRequest.class, - com.zimbra.soap.admin.message.ClearCookieResponse.class, - com.zimbra.soap.admin.message.RefreshRegisteredAuthTokensRequest.class, - com.zimbra.soap.admin.message.RefreshRegisteredAuthTokensResponse.class, com.zimbra.soap.admin.message.CompactIndexRequest.class, com.zimbra.soap.admin.message.CompactIndexResponse.class, com.zimbra.soap.admin.message.ComputeAggregateQuotaUsageRequest.class, @@ -553,12 +270,12 @@ public final class JaxbUtil { com.zimbra.soap.admin.message.CopyCosResponse.class, com.zimbra.soap.admin.message.CountAccountRequest.class, com.zimbra.soap.admin.message.CountAccountResponse.class, - com.zimbra.soap.admin.message.CreateAlwaysOnClusterRequest.class, - com.zimbra.soap.admin.message.CreateAlwaysOnClusterResponse.class, com.zimbra.soap.admin.message.CountObjectsRequest.class, com.zimbra.soap.admin.message.CountObjectsResponse.class, com.zimbra.soap.admin.message.CreateAccountRequest.class, com.zimbra.soap.admin.message.CreateAccountResponse.class, + com.zimbra.soap.admin.message.CreateAlwaysOnClusterRequest.class, + com.zimbra.soap.admin.message.CreateAlwaysOnClusterResponse.class, com.zimbra.soap.admin.message.CreateArchiveRequest.class, com.zimbra.soap.admin.message.CreateArchiveResponse.class, com.zimbra.soap.admin.message.CreateCalendarResourceRequest.class, @@ -711,18 +428,20 @@ public final class JaxbUtil { com.zimbra.soap.admin.message.GetAllXMPPComponentsResponse.class, com.zimbra.soap.admin.message.GetAllZimletsRequest.class, com.zimbra.soap.admin.message.GetAllZimletsResponse.class, + com.zimbra.soap.admin.message.GetAlwaysOnClusterRequest.class, + com.zimbra.soap.admin.message.GetAlwaysOnClusterResponse.class, com.zimbra.soap.admin.message.GetApplianceHSMFSRequest.class, com.zimbra.soap.admin.message.GetApplianceHSMFSResponse.class, com.zimbra.soap.admin.message.GetAttributeInfoRequest.class, com.zimbra.soap.admin.message.GetAttributeInfoResponse.class, - com.zimbra.soap.admin.message.GetAlwaysOnClusterRequest.class, - com.zimbra.soap.admin.message.GetAlwaysOnClusterResponse.class, com.zimbra.soap.admin.message.GetCSRRequest.class, com.zimbra.soap.admin.message.GetCSRResponse.class, com.zimbra.soap.admin.message.GetCalendarResourceRequest.class, com.zimbra.soap.admin.message.GetCalendarResourceResponse.class, com.zimbra.soap.admin.message.GetCertRequest.class, com.zimbra.soap.admin.message.GetCertResponse.class, + com.zimbra.soap.admin.message.GetClearTwoFactorAuthDataStatusRequest.class, + com.zimbra.soap.admin.message.GetClearTwoFactorAuthDataStatusResponse.class, com.zimbra.soap.admin.message.GetClusterStatusRequest.class, com.zimbra.soap.admin.message.GetClusterStatusResponse.class, com.zimbra.soap.admin.message.GetConfigRequest.class, @@ -811,6 +530,8 @@ public final class JaxbUtil { com.zimbra.soap.admin.message.GetSessionsResponse.class, com.zimbra.soap.admin.message.GetShareInfoRequest.class, com.zimbra.soap.admin.message.GetShareInfoResponse.class, + com.zimbra.soap.admin.message.GetSyncStateRequest.class, + com.zimbra.soap.admin.message.GetSyncStateResponse.class, com.zimbra.soap.admin.message.GetSystemRetentionPolicyRequest.class, com.zimbra.soap.admin.message.GetSystemRetentionPolicyResponse.class, com.zimbra.soap.admin.message.GetUCServiceRequest.class, @@ -907,6 +628,8 @@ public final class JaxbUtil { com.zimbra.soap.admin.message.ReIndexResponse.class, com.zimbra.soap.admin.message.RecalculateMailboxCountsRequest.class, com.zimbra.soap.admin.message.RecalculateMailboxCountsResponse.class, + com.zimbra.soap.admin.message.RefreshRegisteredAuthTokensRequest.class, + com.zimbra.soap.admin.message.RefreshRegisteredAuthTokensResponse.class, com.zimbra.soap.admin.message.RegisterMailboxMoveOutRequest.class, com.zimbra.soap.admin.message.RegisterMailboxMoveOutResponse.class, com.zimbra.soap.admin.message.ReloadAccountRequest.class, @@ -927,6 +650,8 @@ public final class JaxbUtil { com.zimbra.soap.admin.message.RemoveDistributionListAliasResponse.class, com.zimbra.soap.admin.message.RemoveDistributionListMemberRequest.class, com.zimbra.soap.admin.message.RemoveDistributionListMemberResponse.class, + com.zimbra.soap.admin.message.RemoveStaleDeviceMetadataRequest.class, + com.zimbra.soap.admin.message.RemoveStaleDeviceMetadataResponse.class, com.zimbra.soap.admin.message.RenameAccountRequest.class, com.zimbra.soap.admin.message.RenameAccountResponse.class, com.zimbra.soap.admin.message.RenameCalendarResourceRequest.class, @@ -999,8 +724,6 @@ public final class JaxbUtil { com.zimbra.soap.admin.message.VerifyStoreManagerResponse.class, com.zimbra.soap.admin.message.VersionCheckRequest.class, com.zimbra.soap.admin.message.VersionCheckResponse.class, - - // zimbraAdminExt com.zimbra.soap.adminext.message.BulkIMAPDataImportRequest.class, com.zimbra.soap.adminext.message.BulkIMAPDataImportResponse.class, com.zimbra.soap.adminext.message.BulkImportAccountsRequest.class, @@ -1011,42 +734,330 @@ public final class JaxbUtil { com.zimbra.soap.adminext.message.GetBulkIMAPImportTaskListResponse.class, com.zimbra.soap.adminext.message.PurgeBulkIMAPImportTasksRequest.class, com.zimbra.soap.adminext.message.PurgeBulkIMAPImportTasksResponse.class, - - // zimbraRepl - com.zimbra.soap.replication.message.BecomeMasterRequest.class, - com.zimbra.soap.replication.message.BecomeMasterResponse.class, - com.zimbra.soap.replication.message.BringDownServiceIPRequest.class, - com.zimbra.soap.replication.message.BringDownServiceIPResponse.class, - com.zimbra.soap.replication.message.BringUpServiceIPRequest.class, - com.zimbra.soap.replication.message.BringUpServiceIPResponse.class, - com.zimbra.soap.replication.message.ReplicationStatusRequest.class, - com.zimbra.soap.replication.message.ReplicationStatusResponse.class, - com.zimbra.soap.replication.message.StartCatchupRequest.class, - com.zimbra.soap.replication.message.StartCatchupResponse.class, - com.zimbra.soap.replication.message.StartFailoverClientRequest.class, - com.zimbra.soap.replication.message.StartFailoverClientResponse.class, - com.zimbra.soap.replication.message.StartFailoverDaemonRequest.class, - com.zimbra.soap.replication.message.StartFailoverDaemonResponse.class, - com.zimbra.soap.replication.message.StopFailoverClientRequest.class, - com.zimbra.soap.replication.message.StopFailoverClientResponse.class, - com.zimbra.soap.replication.message.StopFailoverDaemonRequest.class, - com.zimbra.soap.replication.message.StopFailoverDaemonResponse.class, - - // zimbraSync - com.zimbra.soap.sync.message.CancelPendingRemoteWipeRequest.class, - com.zimbra.soap.sync.message.CancelPendingRemoteWipeResponse.class, - com.zimbra.soap.sync.message.GetDeviceStatusRequest.class, - com.zimbra.soap.sync.message.GetDeviceStatusResponse.class, - com.zimbra.soap.sync.message.RemoteWipeRequest.class, - com.zimbra.soap.sync.message.RemoteWipeResponse.class, - com.zimbra.soap.sync.message.RemoveDeviceRequest.class, - com.zimbra.soap.sync.message.RemoveDeviceResponse.class, - com.zimbra.soap.sync.message.ResumeDeviceRequest.class, - com.zimbra.soap.sync.message.ResumeDeviceResponse.class, + com.zimbra.soap.mail.message.AddAppointmentInviteRequest.class, + com.zimbra.soap.mail.message.AddAppointmentInviteResponse.class, + com.zimbra.soap.mail.message.AddCommentRequest.class, + com.zimbra.soap.mail.message.AddCommentResponse.class, + com.zimbra.soap.mail.message.AddMsgRequest.class, + com.zimbra.soap.mail.message.AddMsgResponse.class, + com.zimbra.soap.mail.message.AddTaskInviteRequest.class, + com.zimbra.soap.mail.message.AddTaskInviteResponse.class, + com.zimbra.soap.mail.message.AnnounceOrganizerChangeRequest.class, + com.zimbra.soap.mail.message.AnnounceOrganizerChangeResponse.class, + com.zimbra.soap.mail.message.ApplyFilterRulesRequest.class, + com.zimbra.soap.mail.message.ApplyFilterRulesResponse.class, + com.zimbra.soap.mail.message.ApplyOutgoingFilterRulesRequest.class, + com.zimbra.soap.mail.message.ApplyOutgoingFilterRulesResponse.class, + com.zimbra.soap.mail.message.AutoCompleteRequest.class, + com.zimbra.soap.mail.message.AutoCompleteResponse.class, + com.zimbra.soap.mail.message.BeginTrackingIMAPRequest.class, + com.zimbra.soap.mail.message.BeginTrackingIMAPResponse.class, + com.zimbra.soap.mail.message.BounceMsgRequest.class, + com.zimbra.soap.mail.message.BounceMsgResponse.class, + com.zimbra.soap.mail.message.BrowseRequest.class, + com.zimbra.soap.mail.message.BrowseResponse.class, + com.zimbra.soap.mail.message.CancelAppointmentRequest.class, + com.zimbra.soap.mail.message.CancelAppointmentResponse.class, + com.zimbra.soap.mail.message.CancelTaskRequest.class, + com.zimbra.soap.mail.message.CancelTaskResponse.class, + com.zimbra.soap.mail.message.CheckDeviceStatusRequest.class, + com.zimbra.soap.mail.message.CheckDeviceStatusResponse.class, + com.zimbra.soap.mail.message.CheckPermissionRequest.class, + com.zimbra.soap.mail.message.CheckPermissionResponse.class, + com.zimbra.soap.mail.message.CheckRecurConflictsRequest.class, + com.zimbra.soap.mail.message.CheckRecurConflictsResponse.class, + com.zimbra.soap.mail.message.CheckSpellingRequest.class, + com.zimbra.soap.mail.message.CheckSpellingResponse.class, + com.zimbra.soap.mail.message.CompleteTaskInstanceRequest.class, + com.zimbra.soap.mail.message.CompleteTaskInstanceResponse.class, + com.zimbra.soap.mail.message.ContactActionRequest.class, + com.zimbra.soap.mail.message.ContactActionResponse.class, + com.zimbra.soap.mail.message.ConvActionRequest.class, + com.zimbra.soap.mail.message.ConvActionResponse.class, + com.zimbra.soap.mail.message.CounterAppointmentRequest.class, + com.zimbra.soap.mail.message.CounterAppointmentResponse.class, + com.zimbra.soap.mail.message.CreateAppointmentExceptionRequest.class, + com.zimbra.soap.mail.message.CreateAppointmentExceptionResponse.class, + com.zimbra.soap.mail.message.CreateAppointmentRequest.class, + com.zimbra.soap.mail.message.CreateAppointmentResponse.class, + com.zimbra.soap.mail.message.CreateContactRequest.class, + com.zimbra.soap.mail.message.CreateContactResponse.class, + com.zimbra.soap.mail.message.CreateDataSourceRequest.class, + com.zimbra.soap.mail.message.CreateDataSourceResponse.class, + com.zimbra.soap.mail.message.CreateFolderRequest.class, + com.zimbra.soap.mail.message.CreateFolderResponse.class, + com.zimbra.soap.mail.message.CreateMountpointRequest.class, + com.zimbra.soap.mail.message.CreateMountpointResponse.class, + com.zimbra.soap.mail.message.CreateNoteRequest.class, + com.zimbra.soap.mail.message.CreateNoteResponse.class, + com.zimbra.soap.mail.message.CreateSearchFolderRequest.class, + com.zimbra.soap.mail.message.CreateSearchFolderResponse.class, + com.zimbra.soap.mail.message.CreateTagRequest.class, + com.zimbra.soap.mail.message.CreateTagResponse.class, + com.zimbra.soap.mail.message.CreateTaskExceptionRequest.class, + com.zimbra.soap.mail.message.CreateTaskExceptionResponse.class, + com.zimbra.soap.mail.message.CreateTaskRequest.class, + com.zimbra.soap.mail.message.CreateTaskResponse.class, + com.zimbra.soap.mail.message.CreateWaitSetRequest.class, + com.zimbra.soap.mail.message.CreateWaitSetResponse.class, + com.zimbra.soap.mail.message.DeclineCounterAppointmentRequest.class, + com.zimbra.soap.mail.message.DeclineCounterAppointmentResponse.class, + com.zimbra.soap.mail.message.DeleteDataSourceRequest.class, + com.zimbra.soap.mail.message.DeleteDataSourceResponse.class, + com.zimbra.soap.mail.message.DeleteDeviceRequest.class, + com.zimbra.soap.mail.message.DeleteDeviceResponse.class, + com.zimbra.soap.mail.message.DestroyWaitSetRequest.class, + com.zimbra.soap.mail.message.DestroyWaitSetResponse.class, + com.zimbra.soap.mail.message.DiffDocumentRequest.class, + com.zimbra.soap.mail.message.DiffDocumentResponse.class, + com.zimbra.soap.mail.message.DismissCalendarItemAlarmRequest.class, + com.zimbra.soap.mail.message.DismissCalendarItemAlarmResponse.class, + com.zimbra.soap.mail.message.DocumentActionRequest.class, + com.zimbra.soap.mail.message.DocumentActionResponse.class, + com.zimbra.soap.mail.message.EmptyDumpsterRequest.class, + com.zimbra.soap.mail.message.EmptyDumpsterResponse.class, + com.zimbra.soap.mail.message.EnableSharedReminderRequest.class, + com.zimbra.soap.mail.message.EnableSharedReminderResponse.class, + com.zimbra.soap.mail.message.ExpandRecurRequest.class, + com.zimbra.soap.mail.message.ExpandRecurResponse.class, + com.zimbra.soap.mail.message.ExportContactsRequest.class, + com.zimbra.soap.mail.message.ExportContactsResponse.class, + com.zimbra.soap.mail.message.FolderActionRequest.class, + com.zimbra.soap.mail.message.FolderActionResponse.class, + com.zimbra.soap.mail.message.ForwardAppointmentInviteRequest.class, + com.zimbra.soap.mail.message.ForwardAppointmentInviteResponse.class, + com.zimbra.soap.mail.message.ForwardAppointmentRequest.class, + com.zimbra.soap.mail.message.ForwardAppointmentResponse.class, + com.zimbra.soap.mail.message.GenerateUUIDRequest.class, + com.zimbra.soap.mail.message.GenerateUUIDResponse.class, + com.zimbra.soap.mail.message.GetActivityStreamRequest.class, + com.zimbra.soap.mail.message.GetActivityStreamResponse.class, + com.zimbra.soap.mail.message.GetAllDevicesRequest.class, + com.zimbra.soap.mail.message.GetAllDevicesResponse.class, + com.zimbra.soap.mail.message.GetAppointmentRequest.class, + com.zimbra.soap.mail.message.GetAppointmentResponse.class, + com.zimbra.soap.mail.message.GetApptSummariesRequest.class, + com.zimbra.soap.mail.message.GetApptSummariesResponse.class, + com.zimbra.soap.mail.message.GetCalendarItemSummariesRequest.class, + com.zimbra.soap.mail.message.GetCalendarItemSummariesResponse.class, + com.zimbra.soap.mail.message.GetCommentsRequest.class, + com.zimbra.soap.mail.message.GetCommentsResponse.class, + com.zimbra.soap.mail.message.GetContactBackupListRequest.class, + com.zimbra.soap.mail.message.GetContactBackupListResponse.class, + com.zimbra.soap.mail.message.GetContactsRequest.class, + com.zimbra.soap.mail.message.GetContactsResponse.class, + com.zimbra.soap.mail.message.GetConvRequest.class, + com.zimbra.soap.mail.message.GetConvResponse.class, + com.zimbra.soap.mail.message.GetCustomMetadataRequest.class, + com.zimbra.soap.mail.message.GetCustomMetadataResponse.class, + com.zimbra.soap.mail.message.GetDataSourceUsageRequest.class, + com.zimbra.soap.mail.message.GetDataSourceUsageResponse.class, + com.zimbra.soap.mail.message.GetDataSourcesRequest.class, + com.zimbra.soap.mail.message.GetDataSourcesResponse.class, + com.zimbra.soap.mail.message.GetDocumentShareURLRequest.class, + com.zimbra.soap.mail.message.GetDocumentShareURLResponse.class, + com.zimbra.soap.mail.message.GetEffectiveFolderPermsRequest.class, + com.zimbra.soap.mail.message.GetEffectiveFolderPermsResponse.class, + com.zimbra.soap.mail.message.GetFilterRulesRequest.class, + com.zimbra.soap.mail.message.GetFilterRulesResponse.class, + com.zimbra.soap.mail.message.GetFolderRequest.class, + com.zimbra.soap.mail.message.GetFolderResponse.class, + com.zimbra.soap.mail.message.GetFreeBusyRequest.class, + com.zimbra.soap.mail.message.GetFreeBusyResponse.class, + com.zimbra.soap.mail.message.GetICalRequest.class, + com.zimbra.soap.mail.message.GetICalResponse.class, + com.zimbra.soap.mail.message.GetIMAPRecentCutoffRequest.class, + com.zimbra.soap.mail.message.GetIMAPRecentCutoffResponse.class, + com.zimbra.soap.mail.message.GetIMAPRecentRequest.class, + com.zimbra.soap.mail.message.GetIMAPRecentResponse.class, + com.zimbra.soap.mail.message.GetImportStatusRequest.class, + com.zimbra.soap.mail.message.GetImportStatusResponse.class, + com.zimbra.soap.mail.message.GetItemRequest.class, + com.zimbra.soap.mail.message.GetItemResponse.class, + com.zimbra.soap.mail.message.GetLastItemIdInMailboxRequest.class, + com.zimbra.soap.mail.message.GetLastItemIdInMailboxResponse.class, + com.zimbra.soap.mail.message.GetMailboxMetadataRequest.class, + com.zimbra.soap.mail.message.GetMailboxMetadataResponse.class, + com.zimbra.soap.mail.message.GetMiniCalRequest.class, + com.zimbra.soap.mail.message.GetMiniCalResponse.class, + com.zimbra.soap.mail.message.GetModifiedItemsIDsRequest.class, + com.zimbra.soap.mail.message.GetModifiedItemsIDsResponse.class, + com.zimbra.soap.mail.message.GetMsgMetadataRequest.class, + com.zimbra.soap.mail.message.GetMsgMetadataResponse.class, + com.zimbra.soap.mail.message.GetMsgRequest.class, + com.zimbra.soap.mail.message.GetMsgResponse.class, + com.zimbra.soap.mail.message.GetNoteRequest.class, + com.zimbra.soap.mail.message.GetNoteResponse.class, + com.zimbra.soap.mail.message.GetNotificationsRequest.class, + com.zimbra.soap.mail.message.GetNotificationsResponse.class, + com.zimbra.soap.mail.message.GetOutgoingFilterRulesRequest.class, + com.zimbra.soap.mail.message.GetOutgoingFilterRulesResponse.class, + com.zimbra.soap.mail.message.GetPermissionRequest.class, + com.zimbra.soap.mail.message.GetPermissionResponse.class, + com.zimbra.soap.mail.message.GetRecurRequest.class, + com.zimbra.soap.mail.message.GetRecurResponse.class, + com.zimbra.soap.mail.message.GetSearchFolderRequest.class, + com.zimbra.soap.mail.message.GetSearchFolderResponse.class, + com.zimbra.soap.mail.message.GetShareDetailsRequest.class, + com.zimbra.soap.mail.message.GetShareDetailsResponse.class, + com.zimbra.soap.mail.message.GetShareNotificationsRequest.class, + com.zimbra.soap.mail.message.GetShareNotificationsResponse.class, + com.zimbra.soap.mail.message.GetSpellDictionariesRequest.class, + com.zimbra.soap.mail.message.GetSpellDictionariesResponse.class, + com.zimbra.soap.mail.message.GetSystemRetentionPolicyRequest.class, + com.zimbra.soap.mail.message.GetSystemRetentionPolicyResponse.class, + com.zimbra.soap.mail.message.GetTagRequest.class, + com.zimbra.soap.mail.message.GetTagResponse.class, + com.zimbra.soap.mail.message.GetTaskRequest.class, + com.zimbra.soap.mail.message.GetTaskResponse.class, + com.zimbra.soap.mail.message.GetTaskSummariesRequest.class, + com.zimbra.soap.mail.message.GetTaskSummariesResponse.class, + com.zimbra.soap.mail.message.GetWatchersRequest.class, + com.zimbra.soap.mail.message.GetWatchersResponse.class, + com.zimbra.soap.mail.message.GetWatchingItemsRequest.class, + com.zimbra.soap.mail.message.GetWatchingItemsResponse.class, + com.zimbra.soap.mail.message.GetWorkingHoursRequest.class, + com.zimbra.soap.mail.message.GetWorkingHoursResponse.class, + com.zimbra.soap.mail.message.GetYahooAuthTokenRequest.class, + com.zimbra.soap.mail.message.GetYahooAuthTokenResponse.class, + com.zimbra.soap.mail.message.GetYahooCookieRequest.class, + com.zimbra.soap.mail.message.GetYahooCookieResponse.class, + com.zimbra.soap.mail.message.GrantPermissionRequest.class, + com.zimbra.soap.mail.message.GrantPermissionResponse.class, + com.zimbra.soap.mail.message.ICalReplyRequest.class, + com.zimbra.soap.mail.message.ICalReplyResponse.class, + com.zimbra.soap.mail.message.IMAPCopyRequest.class, + com.zimbra.soap.mail.message.IMAPCopyResponse.class, + com.zimbra.soap.mail.message.ImportAppointmentsRequest.class, + com.zimbra.soap.mail.message.ImportAppointmentsResponse.class, + com.zimbra.soap.mail.message.ImportContactsRequest.class, + com.zimbra.soap.mail.message.ImportContactsResponse.class, + com.zimbra.soap.mail.message.ImportDataRequest.class, + com.zimbra.soap.mail.message.ImportDataResponse.class, + com.zimbra.soap.mail.message.InvalidateReminderDeviceRequest.class, + com.zimbra.soap.mail.message.InvalidateReminderDeviceResponse.class, + com.zimbra.soap.mail.message.ItemActionRequest.class, + com.zimbra.soap.mail.message.ItemActionResponse.class, + com.zimbra.soap.mail.message.ListDocumentRevisionsRequest.class, + com.zimbra.soap.mail.message.ListDocumentRevisionsResponse.class, + com.zimbra.soap.mail.message.ListIMAPSubscriptionsRequest.class, + com.zimbra.soap.mail.message.ListIMAPSubscriptionsResponse.class, + com.zimbra.soap.mail.message.ModifyAppointmentRequest.class, + com.zimbra.soap.mail.message.ModifyAppointmentResponse.class, + com.zimbra.soap.mail.message.ModifyContactRequest.class, + com.zimbra.soap.mail.message.ModifyContactResponse.class, + com.zimbra.soap.mail.message.ModifyDataSourceRequest.class, + com.zimbra.soap.mail.message.ModifyDataSourceResponse.class, + com.zimbra.soap.mail.message.ModifyFilterRulesRequest.class, + com.zimbra.soap.mail.message.ModifyFilterRulesResponse.class, + com.zimbra.soap.mail.message.ModifyMailboxMetadataRequest.class, + com.zimbra.soap.mail.message.ModifyMailboxMetadataResponse.class, + com.zimbra.soap.mail.message.ModifyOutgoingFilterRulesRequest.class, + com.zimbra.soap.mail.message.ModifyOutgoingFilterRulesResponse.class, + com.zimbra.soap.mail.message.ModifySearchFolderRequest.class, + com.zimbra.soap.mail.message.ModifySearchFolderResponse.class, + com.zimbra.soap.mail.message.ModifyTaskRequest.class, + com.zimbra.soap.mail.message.ModifyTaskResponse.class, + com.zimbra.soap.mail.message.MsgActionRequest.class, + com.zimbra.soap.mail.message.MsgActionResponse.class, + com.zimbra.soap.mail.message.NoOpRequest.class, + com.zimbra.soap.mail.message.NoOpResponse.class, + com.zimbra.soap.mail.message.NoteActionRequest.class, + com.zimbra.soap.mail.message.NoteActionResponse.class, + com.zimbra.soap.mail.message.OpenIMAPFolderRequest.class, + com.zimbra.soap.mail.message.OpenIMAPFolderResponse.class, + com.zimbra.soap.mail.message.PurgeRevisionRequest.class, + com.zimbra.soap.mail.message.PurgeRevisionResponse.class, + com.zimbra.soap.mail.message.RankingActionRequest.class, + com.zimbra.soap.mail.message.RankingActionResponse.class, + com.zimbra.soap.mail.message.RecordIMAPSessionRequest.class, + com.zimbra.soap.mail.message.RecordIMAPSessionResponse.class, + com.zimbra.soap.mail.message.RegisterDeviceRequest.class, + com.zimbra.soap.mail.message.RegisterDeviceResponse.class, + com.zimbra.soap.mail.message.RemoveAttachmentsRequest.class, + com.zimbra.soap.mail.message.RemoveAttachmentsResponse.class, + com.zimbra.soap.mail.message.ResetRecentMessageCountRequest.class, + com.zimbra.soap.mail.message.ResetRecentMessageCountResponse.class, + com.zimbra.soap.mail.message.RestoreContactsRequest.class, + com.zimbra.soap.mail.message.RestoreContactsResponse.class, + com.zimbra.soap.mail.message.RevokePermissionRequest.class, + com.zimbra.soap.mail.message.RevokePermissionResponse.class, + com.zimbra.soap.mail.message.SaveDocumentRequest.class, + com.zimbra.soap.mail.message.SaveDocumentResponse.class, + com.zimbra.soap.mail.message.SaveDraftRequest.class, + com.zimbra.soap.mail.message.SaveDraftResponse.class, + com.zimbra.soap.mail.message.SaveIMAPSubscriptionsRequest.class, + com.zimbra.soap.mail.message.SaveIMAPSubscriptionsResponse.class, + com.zimbra.soap.mail.message.SearchConvRequest.class, + com.zimbra.soap.mail.message.SearchConvResponse.class, + com.zimbra.soap.mail.message.SearchRequest.class, + com.zimbra.soap.mail.message.SearchResponse.class, + com.zimbra.soap.mail.message.SearchActionRequest.class, + com.zimbra.soap.mail.message.SearchActionResponse.class, + com.zimbra.soap.mail.message.SendDeliveryReportRequest.class, + com.zimbra.soap.mail.message.SendDeliveryReportResponse.class, + com.zimbra.soap.mail.message.SendInviteReplyRequest.class, + com.zimbra.soap.mail.message.SendInviteReplyResponse.class, + com.zimbra.soap.mail.message.SendMsgRequest.class, + com.zimbra.soap.mail.message.SendMsgResponse.class, + com.zimbra.soap.mail.message.SendSecureMsgRequest.class, + com.zimbra.soap.mail.message.SendSecureMsgResponse.class, + com.zimbra.soap.mail.message.SendShareNotificationRequest.class, + com.zimbra.soap.mail.message.SendShareNotificationResponse.class, + com.zimbra.soap.mail.message.SendVerificationCodeRequest.class, + com.zimbra.soap.mail.message.SendVerificationCodeResponse.class, + com.zimbra.soap.mail.message.SetAppointmentRequest.class, + com.zimbra.soap.mail.message.SetAppointmentResponse.class, + com.zimbra.soap.mail.message.SetCustomMetadataRequest.class, + com.zimbra.soap.mail.message.SetCustomMetadataResponse.class, + com.zimbra.soap.mail.message.SetMailboxMetadataRequest.class, + com.zimbra.soap.mail.message.SetMailboxMetadataResponse.class, + com.zimbra.soap.mail.message.SetTaskRequest.class, + com.zimbra.soap.mail.message.SetTaskResponse.class, + com.zimbra.soap.mail.message.SnoozeCalendarItemAlarmRequest.class, + com.zimbra.soap.mail.message.SnoozeCalendarItemAlarmResponse.class, + com.zimbra.soap.mail.message.SyncRequest.class, + com.zimbra.soap.mail.message.SyncResponse.class, + com.zimbra.soap.mail.message.TagActionRequest.class, + com.zimbra.soap.mail.message.TagActionResponse.class, + com.zimbra.soap.mail.message.TestDataSourceRequest.class, + com.zimbra.soap.mail.message.TestDataSourceResponse.class, + com.zimbra.soap.mail.message.UpdateDeviceStatusRequest.class, + com.zimbra.soap.mail.message.UpdateDeviceStatusResponse.class, + com.zimbra.soap.mail.message.VerifyCodeRequest.class, + com.zimbra.soap.mail.message.VerifyCodeResponse.class, + com.zimbra.soap.mail.message.WaitSetRequest.class, + com.zimbra.soap.mail.message.WaitSetResponse.class, + com.zimbra.soap.replication.message.BecomeMasterRequest.class, + com.zimbra.soap.replication.message.BecomeMasterResponse.class, + com.zimbra.soap.replication.message.BringDownServiceIPRequest.class, + com.zimbra.soap.replication.message.BringDownServiceIPResponse.class, + com.zimbra.soap.replication.message.BringUpServiceIPRequest.class, + com.zimbra.soap.replication.message.BringUpServiceIPResponse.class, + com.zimbra.soap.replication.message.ReplicationStatusRequest.class, + com.zimbra.soap.replication.message.ReplicationStatusResponse.class, + com.zimbra.soap.replication.message.StartCatchupRequest.class, + com.zimbra.soap.replication.message.StartCatchupResponse.class, + com.zimbra.soap.replication.message.StartFailoverClientRequest.class, + com.zimbra.soap.replication.message.StartFailoverClientResponse.class, + com.zimbra.soap.replication.message.StartFailoverDaemonRequest.class, + com.zimbra.soap.replication.message.StartFailoverDaemonResponse.class, + com.zimbra.soap.replication.message.StopFailoverClientRequest.class, + com.zimbra.soap.replication.message.StopFailoverClientResponse.class, + com.zimbra.soap.replication.message.StopFailoverDaemonRequest.class, + com.zimbra.soap.replication.message.StopFailoverDaemonResponse.class, + com.zimbra.soap.sync.message.CancelPendingRemoteWipeRequest.class, + com.zimbra.soap.sync.message.CancelPendingRemoteWipeResponse.class, + com.zimbra.soap.sync.message.GetDeviceStatusRequest.class, + com.zimbra.soap.sync.message.GetDeviceStatusResponse.class, + com.zimbra.soap.sync.message.RemoteWipeRequest.class, + com.zimbra.soap.sync.message.RemoteWipeResponse.class, + com.zimbra.soap.sync.message.RemoveDeviceRequest.class, + com.zimbra.soap.sync.message.RemoveDeviceResponse.class, + com.zimbra.soap.sync.message.ResumeDeviceRequest.class, + com.zimbra.soap.sync.message.ResumeDeviceResponse.class, com.zimbra.soap.sync.message.SuspendDeviceRequest.class, com.zimbra.soap.sync.message.SuspendDeviceResponse.class, - - // zimbraVoice com.zimbra.soap.voice.message.ChangeUCPasswordRequest.class, com.zimbra.soap.voice.message.ChangeUCPasswordResponse.class, com.zimbra.soap.voice.message.GetUCInfoRequest.class, @@ -1074,51 +1085,7 @@ public final class JaxbUtil { com.zimbra.soap.voice.message.UploadVoiceMailRequest.class, com.zimbra.soap.voice.message.UploadVoiceMailResponse.class, com.zimbra.soap.voice.message.VoiceMsgActionRequest.class, - com.zimbra.soap.voice.message.VoiceMsgActionResponse.class, - - //zimbra mobile gateway - com.zimbra.soap.account.message.BootstrapMobileGatewayAppRequest.class, - com.zimbra.soap.account.message.BootstrapMobileGatewayAppResponse.class, - com.zimbra.soap.account.message.RenewMobileGatewayAppTokenRequest.class, - com.zimbra.soap.account.message.RenewMobileGatewayAppTokenResponse.class, - com.zimbra.soap.account.message.RegisterMobileGatewayAppRequest.class, - com.zimbra.soap.account.message.RegisterMobileGatewayAppResponse.class, - com.zimbra.soap.account.message.GetGcmSenderIdRequest.class, - com.zimbra.soap.account.message.GetGcmSenderIdResponse.class, - - //Oauth - com.zimbra.soap.account.message.GetOAuthConsumersRequest.class, - com.zimbra.soap.account.message.GetOAuthConsumersResponse.class, - com.zimbra.soap.account.message.RevokeOAuthConsumerRequest.class, - com.zimbra.soap.account.message.RevokeOAuthConsumerResponse.class, - - //smime - com.zimbra.soap.mail.message.SendSecureMsgRequest.class, - com.zimbra.soap.mail.message.SendSecureMsgResponse.class, - com.zimbra.soap.account.message.GetSmimeCertificateInfoRequest.class, - com.zimbra.soap.account.message.GetSmimeCertificateInfoResponse.class, - com.zimbra.soap.account.message.SaveSmimeCertificateRequest.class, - com.zimbra.soap.account.message.SaveSmimeCertificateResponse.class, - - //IMAP - com.zimbra.soap.mail.message.ListIMAPSubscriptionsRequest.class, - com.zimbra.soap.mail.message.ListIMAPSubscriptionsResponse.class, - com.zimbra.soap.mail.message.SaveIMAPSubscriptionsRequest.class, - com.zimbra.soap.mail.message.SaveIMAPSubscriptionsResponse.class, - com.zimbra.soap.mail.message.ResetRecentMessageCountRequest.class, - com.zimbra.soap.mail.message.ResetRecentMessageCountResponse.class, - com.zimbra.soap.mail.message.OpenIMAPFolderRequest.class, - com.zimbra.soap.mail.message.OpenIMAPFolderResponse.class, - com.zimbra.soap.mail.message.GetModifiedItemsIDsRequest.class, - com.zimbra.soap.mail.message.GetModifiedItemsIDsResponse.class, - com.zimbra.soap.mail.message.GetLastItemIdInMailboxRequest.class, - com.zimbra.soap.mail.message.GetLastItemIdInMailboxResponse.class, - com.zimbra.soap.mail.message.BeginTrackingIMAPRequest.class, - com.zimbra.soap.mail.message.BeginTrackingIMAPResponse.class, - - //Contacts API - com.zimbra.soap.mail.message.RestoreContactsRequest.class, - com.zimbra.soap.mail.message.RestoreContactsResponse.class + com.zimbra.soap.voice.message.VoiceMsgActionResponse.class }; try { diff --git a/soap/src/java/com/zimbra/soap/mail/message/CreateDataSourceRequest.java b/soap/src/java/com/zimbra/soap/mail/message/CreateDataSourceRequest.java index a9add74c6d8..6a9c801f75d 100644 --- a/soap/src/java/com/zimbra/soap/mail/message/CreateDataSourceRequest.java +++ b/soap/src/java/com/zimbra/soap/mail/message/CreateDataSourceRequest.java @@ -27,11 +27,11 @@ import com.zimbra.common.soap.MailConstants; import com.zimbra.soap.mail.type.MailCalDataSource; import com.zimbra.soap.mail.type.MailCaldavDataSource; +import com.zimbra.soap.mail.type.MailDataSource; import com.zimbra.soap.mail.type.MailGalDataSource; import com.zimbra.soap.mail.type.MailImapDataSource; import com.zimbra.soap.mail.type.MailPop3DataSource; import com.zimbra.soap.mail.type.MailRssDataSource; -import com.zimbra.soap.mail.type.MailUnknownDataSource; import com.zimbra.soap.mail.type.MailYabDataSource; import com.zimbra.soap.type.DataSource; @@ -56,7 +56,7 @@ public class CreateDataSourceRequest { @XmlElement(name=MailConstants.E_DS_RSS /* rss */, type=MailRssDataSource.class), @XmlElement(name=MailConstants.E_DS_GAL /* gal */, type=MailGalDataSource.class), @XmlElement(name=MailConstants.E_DS_CAL /* cal */, type=MailCalDataSource.class), - @XmlElement(name=MailConstants.E_DS_UNKNOWN /* unknown */, type=MailUnknownDataSource.class) + @XmlElement(name=MailConstants.E_DS_UNKNOWN /* unknown */, type=MailDataSource.class) }) private DataSource dataSource; diff --git a/soap/src/java/com/zimbra/soap/mail/message/DeleteDataSourceRequest.java b/soap/src/java/com/zimbra/soap/mail/message/DeleteDataSourceRequest.java index e79174e3d39..a34fea6617a 100644 --- a/soap/src/java/com/zimbra/soap/mail/message/DeleteDataSourceRequest.java +++ b/soap/src/java/com/zimbra/soap/mail/message/DeleteDataSourceRequest.java @@ -60,7 +60,7 @@ public class DeleteDataSourceRequest { @XmlElement(name=MailConstants.E_DS_RSS /* rss */, type=RssDataSourceNameOrId.class), @XmlElement(name=MailConstants.E_DS_GAL /* gal */, type=GalDataSourceNameOrId.class), @XmlElement(name=MailConstants.E_DS_CAL /* cal */, type=CalDataSourceNameOrId.class), - @XmlElement(name=MailConstants.E_DS_UNKNOWN /* unknown */, type=UnknownDataSourceNameOrId.class) + @XmlElement(name=MailConstants.E_DS_UNKNOWN /* unknown */, type=DataSourceNameOrId.class) }) private List dataSources = Lists.newArrayList(); diff --git a/soap/src/java/com/zimbra/soap/mail/message/GetDataSourcesResponse.java b/soap/src/java/com/zimbra/soap/mail/message/GetDataSourcesResponse.java index 971c866d43b..2eb75f70644 100644 --- a/soap/src/java/com/zimbra/soap/mail/message/GetDataSourcesResponse.java +++ b/soap/src/java/com/zimbra/soap/mail/message/GetDataSourcesResponse.java @@ -32,11 +32,11 @@ import com.zimbra.common.soap.MailConstants; import com.zimbra.soap.mail.type.MailCalDataSource; import com.zimbra.soap.mail.type.MailCaldavDataSource; +import com.zimbra.soap.mail.type.MailDataSource; import com.zimbra.soap.mail.type.MailGalDataSource; import com.zimbra.soap.mail.type.MailImapDataSource; import com.zimbra.soap.mail.type.MailPop3DataSource; import com.zimbra.soap.mail.type.MailRssDataSource; -import com.zimbra.soap.mail.type.MailUnknownDataSource; import com.zimbra.soap.mail.type.MailYabDataSource; import com.zimbra.soap.type.DataSource; @@ -55,7 +55,7 @@ public class GetDataSourcesResponse { @XmlElement(name=MailConstants.E_DS_RSS /* rss */, type=MailRssDataSource.class), @XmlElement(name=MailConstants.E_DS_GAL /* gal */, type=MailGalDataSource.class), @XmlElement(name=MailConstants.E_DS_CAL /* cal */, type=MailCalDataSource.class), - @XmlElement(name=MailConstants.E_DS_UNKNOWN /* unknown */, type=MailUnknownDataSource.class) + @XmlElement(name=MailConstants.E_DS_UNKNOWN /* unknown */, type=MailDataSource.class) }) private List dataSources = Lists.newArrayList(); diff --git a/soap/src/java/com/zimbra/soap/mail/message/GetIMAPRecentCutoffRequest.java b/soap/src/java/com/zimbra/soap/mail/message/GetIMAPRecentCutoffRequest.java new file mode 100644 index 00000000000..78cb88b1397 --- /dev/null +++ b/soap/src/java/com/zimbra/soap/mail/message/GetIMAPRecentCutoffRequest.java @@ -0,0 +1,55 @@ +/* + * ***** BEGIN LICENSE BLOCK ***** + * Zimbra Collaboration Suite Server + * Copyright (C) 2017 Synacor, Inc. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software Foundation, + * version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with this program. + * If not, see . + * ***** END LICENSE BLOCK ***** + */ + +package com.zimbra.soap.mail.message; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.zimbra.common.soap.MailConstants; + +/** + * @zm-api-command-auth-required true + * @zm-api-command-admin-auth-required false + * @zm-api-command-description Return the count of recent items in the specified folder + */ + +@XmlRootElement(name=MailConstants.E_GET_IMAP_RECENT_CUTOFF_REQUEST) +public class GetIMAPRecentCutoffRequest { + + /** + * @zm-api-field-tag folder-id + * @zm-api-field-description Folder ID + */ + @XmlAttribute(name=MailConstants.A_ID /* id */, required=true) + private final String id; + + /** + * no-argument constructor wanted by JAXB + */ + @SuppressWarnings("unused") + private GetIMAPRecentCutoffRequest() { + this((String) null); + } + + public GetIMAPRecentCutoffRequest(String id) { + this.id = id; + } + + public String getId() { return id; } + +} diff --git a/soap/src/java/com/zimbra/soap/mail/message/GetIMAPRecentCutoffResponse.java b/soap/src/java/com/zimbra/soap/mail/message/GetIMAPRecentCutoffResponse.java new file mode 100644 index 00000000000..5b35a37689e --- /dev/null +++ b/soap/src/java/com/zimbra/soap/mail/message/GetIMAPRecentCutoffResponse.java @@ -0,0 +1,41 @@ +package com.zimbra.soap.mail.message; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.zimbra.common.soap.MailConstants; + +/** + * @zm-api-command-auth-required true + * @zm-api-command-admin-auth-required false + * @zm-api-command-description Return the count of recent items in the folder + */ +@XmlAccessorType(XmlAccessType.NONE) +@XmlRootElement(name=MailConstants.E_GET_IMAP_RECENT_CUTOFF_RESPONSE) +public class GetIMAPRecentCutoffResponse { + + /** + * @zm-api-field-tag imap-recent-cutoff + * @zm-api-field-description The last recorded assigned item ID in the enclosing + * Mailbox the last time the folder was accessed via a read/write IMAP session. + * Note that this value is only updated on session closes + */ + @XmlAttribute(name=MailConstants.A_IMAP_RECENT_CUTOFF /* cutoff */, required=true) + private final int cutoff; + + /** + * no-argument constructor wanted by JAXB + */ + @SuppressWarnings("unused") + private GetIMAPRecentCutoffResponse() { + this(0); + } + + public GetIMAPRecentCutoffResponse(int recentCutoff) { + this.cutoff = recentCutoff; + } + + public int getCutoff() { return cutoff; } +} diff --git a/soap/src/java/com/zimbra/soap/mail/message/GetIMAPRecentRequest.java b/soap/src/java/com/zimbra/soap/mail/message/GetIMAPRecentRequest.java index 6d5851584ea..2105daf1d8b 100644 --- a/soap/src/java/com/zimbra/soap/mail/message/GetIMAPRecentRequest.java +++ b/soap/src/java/com/zimbra/soap/mail/message/GetIMAPRecentRequest.java @@ -1,3 +1,20 @@ +/* + * ***** BEGIN LICENSE BLOCK ***** + * Zimbra Collaboration Suite Server + * Copyright (C) 2017 Synacor, Inc. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software Foundation, + * version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with this program. + * If not, see . + * ***** END LICENSE BLOCK ***** + */ + package com.zimbra.soap.mail.message; import javax.xml.bind.annotation.XmlAttribute; diff --git a/soap/src/java/com/zimbra/soap/mail/message/ImportDataRequest.java b/soap/src/java/com/zimbra/soap/mail/message/ImportDataRequest.java index f4b1a8af5d6..c468d36367f 100644 --- a/soap/src/java/com/zimbra/soap/mail/message/ImportDataRequest.java +++ b/soap/src/java/com/zimbra/soap/mail/message/ImportDataRequest.java @@ -37,7 +37,6 @@ import com.zimbra.soap.mail.type.ImapDataSourceNameOrId; import com.zimbra.soap.mail.type.Pop3DataSourceNameOrId; import com.zimbra.soap.mail.type.RssDataSourceNameOrId; -import com.zimbra.soap.mail.type.UnknownDataSourceNameOrId; import com.zimbra.soap.mail.type.YabDataSourceNameOrId; /** @@ -63,7 +62,7 @@ public class ImportDataRequest { @XmlElement(name=MailConstants.E_DS_RSS /* rss */, type=RssDataSourceNameOrId.class), @XmlElement(name=MailConstants.E_DS_GAL /* gal */, type=GalDataSourceNameOrId.class), @XmlElement(name=MailConstants.E_DS_CAL /* cal */, type=CalDataSourceNameOrId.class), - @XmlElement(name=MailConstants.E_DS_UNKNOWN /* unknown */, type=UnknownDataSourceNameOrId.class) + @XmlElement(name=MailConstants.E_DS_UNKNOWN /* unknown */, type=DataSourceNameOrId.class) }) private List dataSources = Lists.newArrayList(); diff --git a/soap/src/java/com/zimbra/soap/mail/message/ModifyDataSourceRequest.java b/soap/src/java/com/zimbra/soap/mail/message/ModifyDataSourceRequest.java index d9d15ce4887..632c92bb169 100644 --- a/soap/src/java/com/zimbra/soap/mail/message/ModifyDataSourceRequest.java +++ b/soap/src/java/com/zimbra/soap/mail/message/ModifyDataSourceRequest.java @@ -27,11 +27,11 @@ import com.zimbra.common.soap.MailConstants; import com.zimbra.soap.mail.type.MailCalDataSource; import com.zimbra.soap.mail.type.MailCaldavDataSource; +import com.zimbra.soap.mail.type.MailDataSource; import com.zimbra.soap.mail.type.MailGalDataSource; import com.zimbra.soap.mail.type.MailImapDataSource; import com.zimbra.soap.mail.type.MailPop3DataSource; import com.zimbra.soap.mail.type.MailRssDataSource; -import com.zimbra.soap.mail.type.MailUnknownDataSource; import com.zimbra.soap.mail.type.MailYabDataSource; import com.zimbra.soap.type.DataSource; @@ -58,7 +58,7 @@ public class ModifyDataSourceRequest { @XmlElement(name=MailConstants.E_DS_RSS /* rss */, type=MailRssDataSource.class), @XmlElement(name=MailConstants.E_DS_GAL /* gal */, type=MailGalDataSource.class), @XmlElement(name=MailConstants.E_DS_CAL /* cal */, type=MailCalDataSource.class), - @XmlElement(name=MailConstants.E_DS_UNKNOWN /* unknown */, type=MailUnknownDataSource.class) + @XmlElement(name=MailConstants.E_DS_UNKNOWN /* unknown */, type=MailDataSource.class) }) private DataSource dataSource; diff --git a/soap/src/java/com/zimbra/soap/mail/message/SearchActionRequest.java b/soap/src/java/com/zimbra/soap/mail/message/SearchActionRequest.java new file mode 100644 index 00000000000..c9670cd4a37 --- /dev/null +++ b/soap/src/java/com/zimbra/soap/mail/message/SearchActionRequest.java @@ -0,0 +1,65 @@ +/* + * ***** BEGIN LICENSE BLOCK ***** + * Zimbra Collaboration Suite Server + * Copyright (C) 2017 Synacor, Inc. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software Foundation, + * version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with this program. + * If not, see . + * ***** END LICENSE BLOCK ***** + */ +package com.zimbra.soap.mail.message; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.zimbra.common.soap.MailConstants; +import com.zimbra.soap.mail.type.BulkAction; + +/** + * @zm-api-command-auth-required true + * @zm-api-command-admin-auth-required false + * @zm-api-command-description SearchAction + */ +@XmlAccessorType(XmlAccessType.NONE) +@XmlRootElement(name = MailConstants.E_SEARCH_ACTION_REQUEST) +final public class SearchActionRequest { + + /** + * @zm-api-field-tag search-request + * @zm-api-field-description Search request + */ + @XmlElement(name = MailConstants.E_SEARCH_REQUEST /* SearchRequest */ , required = true) + private SearchRequest searchRequest; + + /** + * @zm-api-field-tag bulk-action + * @zm-api-field-description Bulk action + */ + @XmlElement(name = MailConstants.E_BULK_ACTION /* BulkAction */, required = true) + private BulkAction bulkAction; + + public SearchRequest getSearchRequest() { + return searchRequest; + } + + public void setSearchRequest(SearchRequest searchRequest) { + this.searchRequest = searchRequest; + } + + public BulkAction getBulkAction() { + return bulkAction; + } + + public void setBulkAction(BulkAction bulkAction) { + this.bulkAction = bulkAction; + } +} diff --git a/soap/src/java/com/zimbra/soap/mail/message/SearchActionResponse.java b/soap/src/java/com/zimbra/soap/mail/message/SearchActionResponse.java new file mode 100644 index 00000000000..600d3fa9f1b --- /dev/null +++ b/soap/src/java/com/zimbra/soap/mail/message/SearchActionResponse.java @@ -0,0 +1,29 @@ +/* + * ***** BEGIN LICENSE BLOCK ***** + * Zimbra Collaboration Suite Server + * Copyright (C) 2017 Synacor, Inc. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software Foundation, + * version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with this program. + * If not, see . + * ***** END LICENSE BLOCK ***** + */ +package com.zimbra.soap.mail.message; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; + +import com.zimbra.common.soap.MailConstants; + +@XmlAccessorType(XmlAccessType.NONE) +@XmlRootElement(name=MailConstants.E_SEARCH_ACTION_RESPONSE) +public class SearchActionResponse { + +} diff --git a/soap/src/java/com/zimbra/soap/mail/message/TestDataSourceRequest.java b/soap/src/java/com/zimbra/soap/mail/message/TestDataSourceRequest.java index 55c6d3d3544..454ae3edd9c 100644 --- a/soap/src/java/com/zimbra/soap/mail/message/TestDataSourceRequest.java +++ b/soap/src/java/com/zimbra/soap/mail/message/TestDataSourceRequest.java @@ -27,11 +27,11 @@ import com.zimbra.common.soap.MailConstants; import com.zimbra.soap.mail.type.MailCalDataSource; import com.zimbra.soap.mail.type.MailCaldavDataSource; +import com.zimbra.soap.mail.type.MailDataSource; import com.zimbra.soap.mail.type.MailGalDataSource; import com.zimbra.soap.mail.type.MailImapDataSource; import com.zimbra.soap.mail.type.MailPop3DataSource; import com.zimbra.soap.mail.type.MailRssDataSource; -import com.zimbra.soap.mail.type.MailUnknownDataSource; import com.zimbra.soap.mail.type.MailYabDataSource; import com.zimbra.soap.type.DataSource; @@ -57,7 +57,7 @@ public class TestDataSourceRequest { @XmlElement(name=MailConstants.E_DS_RSS /* rss */, type=MailRssDataSource.class), @XmlElement(name=MailConstants.E_DS_GAL /* gal */, type=MailGalDataSource.class), @XmlElement(name=MailConstants.E_DS_CAL /* cal */, type=MailCalDataSource.class), - @XmlElement(name=MailConstants.E_DS_UNKNOWN /* unknown */, type=MailUnknownDataSource.class) + @XmlElement(name=MailConstants.E_DS_UNKNOWN /* unknown */, type=MailDataSource.class) }) private DataSource dataSource; diff --git a/soap/src/java/com/zimbra/soap/mail/type/BulkAction.java b/soap/src/java/com/zimbra/soap/mail/type/BulkAction.java new file mode 100644 index 00000000000..44b3a7f0742 --- /dev/null +++ b/soap/src/java/com/zimbra/soap/mail/type/BulkAction.java @@ -0,0 +1,75 @@ +/* + * ***** BEGIN LICENSE BLOCK ***** + * Zimbra Collaboration Suite Server + * Copyright (C) 2017 Synacor, Inc. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software Foundation, + * version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with this program. + * If not, see . + * ***** END LICENSE BLOCK ***** + */ +package com.zimbra.soap.mail.type; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlEnum; + +import com.zimbra.common.service.ServiceException; +import com.zimbra.common.soap.MailConstants; + +@XmlAccessorType(XmlAccessType.NONE) +public class BulkAction { + + @XmlEnum + public static enum Operation { + move; + + public static Operation fromString(String s) throws ServiceException { + try { + return Operation.valueOf(s); + } catch (IllegalArgumentException e) { + throw ServiceException.INVALID_REQUEST("unknown operation: "+s, e); + } + } + } + + /** + * @zm-api-field-tag operation + * @zm-api-field-description Operation to perform + * + * move move the search result to specified folder location + * + */ + @XmlAttribute(name = MailConstants.A_OPERATION /* op */, required = true) + private Operation op; + + /** + * @zm-api-field-tag folder-path + * @zm-api-field-description Folder pathname + */ + @XmlAttribute(name = MailConstants.A_FOLDER /* l */, required = false) + private String folder; + + public Operation getOp() { + return op; + } + + public void setOp(Operation op) { + this.op = op; + } + + public String getFolder() { + return folder; + } + + public void setFolder(String folder) { + this.folder = folder; + } +} diff --git a/soap/src/java/com/zimbra/soap/mail/type/MailGalDataSource.java b/soap/src/java/com/zimbra/soap/mail/type/MailGalDataSource.java index 814cb81e9d1..5ce5dbc6ede 100644 --- a/soap/src/java/com/zimbra/soap/mail/type/MailGalDataSource.java +++ b/soap/src/java/com/zimbra/soap/mail/type/MailGalDataSource.java @@ -20,7 +20,6 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; -import com.zimbra.common.soap.MailConstants; import com.zimbra.soap.type.DataSource; @XmlAccessorType(XmlAccessType.NONE) diff --git a/soap/src/java/com/zimbra/soap/mail/type/MailImapDataSource.java b/soap/src/java/com/zimbra/soap/mail/type/MailImapDataSource.java index 17f9fc039a2..166fb0d3b4f 100644 --- a/soap/src/java/com/zimbra/soap/mail/type/MailImapDataSource.java +++ b/soap/src/java/com/zimbra/soap/mail/type/MailImapDataSource.java @@ -49,20 +49,6 @@ public class MailImapDataSource @XmlAttribute(name = MailConstants.A_DS_CLIENT_SECRET /* clientSecret */, required = false) private String clientSecret; - /** - * @zm-api-field-tag data-source-refreshToken - * @zm-api-field-description refresh token for refreshing data source oauth token - */ - @XmlAttribute(name = MailConstants.A_DS_REFRESH_TOKEN /* refreshToken */, required = false) - private String refreshToken; - - /** - * @zm-api-field-tag data-source-refreshTokenUrl - * @zm-api-field-description refreshTokenUrl for refreshing data source oauth token - */ - @XmlAttribute(name = MailConstants.A_DS_REFRESH_TOKEN_URL /* refreshTokenUrl */, required = false) - private String refreshTokenUrl; - /** * @zm-api-field-tag test-data-source * @zm-api-field-description boolean field for client to denote if it wants @@ -79,8 +65,6 @@ public MailImapDataSource(ImapDataSource data) { setOAuthToken(((MailImapDataSource)data).getOAuthToken()); setClientId(((MailImapDataSource)data).getClientId()); setClientSecret(((MailImapDataSource)data).getClientSecret()); - setRefreshToken(((MailImapDataSource)data).getRefreshToken()); - setRefreshTokenUrl(((MailImapDataSource)data).getRefreshTokenUrl()); } public void setOAuthToken(String oauthToken) { this.oauthToken = oauthToken; } @@ -92,12 +76,6 @@ public MailImapDataSource(ImapDataSource data) { public void setClientSecret(String clientSecret) { this.clientSecret = clientSecret; } public String getClientSecret() { return clientSecret; } - public void setRefreshToken(String refreshToken) { this.refreshToken = refreshToken; } - public String getRefreshToken() { return refreshToken; } - - public void setRefreshTokenUrl(String refreshTokenUrl) { this.refreshTokenUrl = refreshTokenUrl; } - public String getRefreshTokenUrl() { return refreshTokenUrl; } - public void setTest(boolean test) { this.test = ZmBoolean.fromBool(test, false); } public boolean isTest() { return ZmBoolean.toBool(test, false); } @@ -108,8 +86,8 @@ public Objects.ToStringHelper addToStringInfo(Objects.ToStringHelper helper) { .add("oauthToken", oauthToken) .add("clientId", clientId) .add("clientSecret", clientSecret) - .add("refreshToken", refreshToken) - .add("refreshTokenUrl", refreshTokenUrl); + .add("refreshToken", this.getRefreshToken()) + .add("refreshTokenUrl", this.getRefreshTokenUrl()); } @Override diff --git a/soap/src/java/com/zimbra/soap/mail/type/MailUnknownDataSource.java b/soap/src/java/com/zimbra/soap/mail/type/MailUnknownDataSource.java index 667d9b4b92b..c2d98fd8323 100644 --- a/soap/src/java/com/zimbra/soap/mail/type/MailUnknownDataSource.java +++ b/soap/src/java/com/zimbra/soap/mail/type/MailUnknownDataSource.java @@ -20,7 +20,6 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; -import com.zimbra.common.soap.MailConstants; import com.zimbra.soap.type.DataSource; @XmlAccessorType(XmlAccessType.NONE) diff --git a/soap/src/java/com/zimbra/soap/mail/type/MdsConnectionType.java b/soap/src/java/com/zimbra/soap/mail/type/MdsConnectionType.java index 26cceb6148d..0714f34465b 100644 --- a/soap/src/java/com/zimbra/soap/mail/type/MdsConnectionType.java +++ b/soap/src/java/com/zimbra/soap/mail/type/MdsConnectionType.java @@ -32,7 +32,7 @@ public enum MdsConnectionType { @XmlEnumValue("cleartext") cleartext, @XmlEnumValue("ssl") ssl, @XmlEnumValue("tls") tls, - @XmlEnumValue("tls_is_available") tls_if_available; + @XmlEnumValue("tls_if_available") tls_if_available; public static MdsConnectionType fromString(String s) throws ServiceException { try { diff --git a/soap/src/java/com/zimbra/soap/type/LoggingLevel.java b/soap/src/java/com/zimbra/soap/type/LoggingLevel.java index 3028dd59672..30d6d1daba1 100644 --- a/soap/src/java/com/zimbra/soap/type/LoggingLevel.java +++ b/soap/src/java/com/zimbra/soap/type/LoggingLevel.java @@ -21,6 +21,7 @@ import java.util.Locale; import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; import com.zimbra.common.service.ServiceException; @@ -30,7 +31,30 @@ @XmlEnum public enum LoggingLevel { // keep in sync with com.zimbra.common.util.Log.Level - error, warn, info, debug, trace; + @XmlEnumValue("error") error(com.zimbra.common.util.Log.Level.error), + @XmlEnumValue("warn") warn(com.zimbra.common.util.Log.Level.warn), + @XmlEnumValue("info") info(com.zimbra.common.util.Log.Level.info), + @XmlEnumValue("debug") debug(com.zimbra.common.util.Log.Level.debug), + @XmlEnumValue("trace") trace(com.zimbra.common.util.Log.Level.trace); + + private final com.zimbra.common.util.Log.Level commonLevel; + + private LoggingLevel(com.zimbra.common.util.Log.Level commonLvl) { + this.commonLevel = commonLvl; + } + + public com.zimbra.common.util.Log.Level fromJaxb() { + return commonLevel; + } + + public static LoggingLevel toJaxb(com.zimbra.common.util.Log.Level commonLvl) { + for (LoggingLevel ll : LoggingLevel.values()) { + if (ll.fromJaxb() == commonLvl) { + return ll; + } + } + throw new IllegalArgumentException("Unrecognised Level:" + commonLvl); + } public static LoggingLevel fromString(String s) throws ServiceException { try { diff --git a/store/conf/attrs/zimbra-attrs.xml b/store/conf/attrs/zimbra-attrs.xml index afe63263d49..efc8ee8e53f 100755 --- a/store/conf/attrs/zimbra-attrs.xml +++ b/store/conf/attrs/zimbra-attrs.xml @@ -6624,10 +6624,11 @@ TODO: delete them permanently from here additional domains considered as internal w.r.t. recipient - + ALL Specifies the meaning of an external sender. "ALL" means users whose domain doesn't match the recipient's or zimbraInternalSendersDomain. "ALLNOTINAB" means "ALL" minus users who are in the recipient's address book. - "INAB" Users/Addresses whose domain doesn't match the recipient's domain or zimbraInternalSendersDomain and which are present in recipient's address book. + "INAB" Users/Addresses whose domain doesn't match the recipient's domain or zimbraInternalSendersDomain and which are present in recipient's address book. + "INSD" means users whose domain matches the specific domain @@ -9409,7 +9410,7 @@ TODO: delete them permanently from here - 1d + 0 Sleep time between subsequent contact backups. 0 means that contact backup is disabled. @@ -9446,6 +9447,13 @@ TODO: delete them permanently from here Whether to enable zimbra network new generation admin module. + + FALSE + Enable contact backup feature + + + Specific domains to which custom out of office message is to be sent + URL of ephemeral storage backend ldap://default @@ -9557,8 +9565,8 @@ TODO: delete them permanently from here - ClientIpHash - Determines the load-balancing algorithm used to select an IMAP server from the pool of available zimbraReverseProxyUpstreamImapServers. Valid values are ClientIpHash, custom:{handler-algorithm} [arg1 arg2 ...] + AccountIdHash + Determines the load-balancing algorithm used to select an IMAP server from the pool of available zimbraReverseProxyUpstreamImapServers. Valid values are AccountIdHash, custom:{handler-algorithm} [arg1 arg2 ...] @@ -9609,4 +9617,10 @@ TODO: delete them permanently from here Information about the latest run of zmmigrateattrs. Includes the URL of the destination ephemeral store and the state of the migration (in progress, completed, failed) + + TRUE + Configure the default server block in 'nginx.conf.web.https?.default.template' to return a default HTTP response + for all unconfigured host names. See also related attributes 'zimbraVirtualHostname' and 'zimbraVirtualIPAddress'. + + diff --git a/store/docs/soap.txt b/store/docs/soap.txt index 2aaef1bbfa9..d2cd44207f8 100644 --- a/store/docs/soap.txt +++ b/store/docs/soap.txt @@ -1011,6 +1011,8 @@ The JSON version is different: } } +For adding an profile image, you need to upload the image first and provide the upload id (aid) as value in 'zimbraPrefAccountProfileImage' pref name. + --------- @@ -4724,3 +4726,17 @@ Api to get list of available contact backup files ... ] + +----------------------------- +API to search for mail items and take some bulk action on the search result + + + + + +Note: element is nothing but old search request having same attributes and elements. +In BulkAction, l={folder-path} attribute is optional, it will only be used in actions such as 'move'. +Valid 'op' values: move + + + diff --git a/store/ivy.xml b/store/ivy.xml index b7223e3dc02..31af963cd5d 100644 --- a/store/ivy.xml +++ b/store/ivy.xml @@ -72,7 +72,6 @@ - diff --git a/store/src/java-test/com/zimbra/cs/account/GenerateEphemeralGettersTest.java b/store/src/java-test/com/zimbra/cs/account/GenerateEphemeralGettersTest.java index c2367fbd541..d3e2781d767 100644 --- a/store/src/java-test/com/zimbra/cs/account/GenerateEphemeralGettersTest.java +++ b/store/src/java-test/com/zimbra/cs/account/GenerateEphemeralGettersTest.java @@ -160,7 +160,7 @@ public void testBooleanGetters() throws Exception { " }"; String setter = " public void setEphemeralAttribute(boolean zimbraEphemeralAttribute) throws com.zimbra.common.service.ServiceException {\n" + - " modifyEphemeralAttr(Provisioning.A_zimbraEphemeralAttribute, null, zimbraEphemeralAttribute ? Provisioning.TRUE : Provisioning.FALSE, false, null);\n" + + " modifyEphemeralAttr(Provisioning.A_zimbraEphemeralAttribute, null, zimbraEphemeralAttribute ? TRUE : FALSE, false, null);\n" + " }"; String unsetter = " public void unsetEphemeralAttribute() throws com.zimbra.common.service.ServiceException {\n" + @@ -313,6 +313,8 @@ public void testBinaryGetters() throws Exception { } private void testGeneratedMethod(StringBuilder generated, String shouldContain) { - assertTrue(generated.toString().contains(shouldContain)); + assertTrue(String.format( + "String '%s' should contain string '%s'", generated.toString(), shouldContain), + generated.toString().contains(shouldContain)); } } diff --git a/store/src/java-test/com/zimbra/cs/account/MockProvisioning.java b/store/src/java-test/com/zimbra/cs/account/MockProvisioning.java index 17715545584..1cbaaf23a53 100644 --- a/store/src/java-test/com/zimbra/cs/account/MockProvisioning.java +++ b/store/src/java-test/com/zimbra/cs/account/MockProvisioning.java @@ -109,7 +109,7 @@ public Account createAccount(String email, String password, Map attrs.put(A_zimbraAccountStatus, ACCOUNT_STATUS_ACTIVE); } if (!attrs.containsKey(A_zimbraDumpsterEnabled)) { - attrs.put(A_zimbraDumpsterEnabled, TRUE); + attrs.put(A_zimbraDumpsterEnabled, ProvisioningConstants.TRUE); } attrs.put(A_zimbraBatchedIndexingSize, Integer.MAX_VALUE); // suppress indexing Account account = new Account(email, email, attrs, null, this); @@ -686,7 +686,12 @@ public void deleteIdentity(Account account, String identityName) { @Override public List getAllIdentities(Account account) { - throw new UnsupportedOperationException(); + List result = new ArrayList(); + Map attrs = new HashMap(); + attrs.put(A_zimbraPrefIdentityName, ProvisioningConstants.DEFAULT_IDENTITY_NAME); + attrs.put(A_zimbraPrefIdentityId, account.getId()); + result.add(new Identity(account, ProvisioningConstants.DEFAULT_IDENTITY_NAME, account.getId(), attrs, this)); + return result; } @Override @@ -860,4 +865,8 @@ public List getAllServers(String service, String clusterId) throw new UnsupportedOperationException(); } + @Override + public void refreshUserCredentials(Account account) { + // Does nothing + } } diff --git a/store/src/java-test/com/zimbra/cs/filter/DeleteHeaderTest.java b/store/src/java-test/com/zimbra/cs/filter/DeleteHeaderTest.java index 01b4a667c72..80ebd2d9df1 100644 --- a/store/src/java-test/com/zimbra/cs/filter/DeleteHeaderTest.java +++ b/store/src/java-test/com/zimbra/cs/filter/DeleteHeaderTest.java @@ -35,7 +35,6 @@ import com.google.common.collect.Maps; import com.zimbra.common.account.Key; import com.zimbra.cs.account.Account; -import com.zimbra.cs.account.MockProvisioning; import com.zimbra.cs.account.Provisioning; import com.zimbra.cs.mailbox.DeliveryContext; import com.zimbra.cs.mailbox.MailItem; @@ -44,7 +43,6 @@ import com.zimbra.cs.mailbox.MailboxTestUtil; import com.zimbra.cs.mailbox.Message; import com.zimbra.cs.mailbox.OperationContext; -import com.zimbra.cs.mailbox.Flag.FlagInfo; import com.zimbra.cs.mime.MPartInfo; import com.zimbra.cs.mime.Mime; import com.zimbra.cs.mime.ParsedMessage; diff --git a/store/src/java-test/com/zimbra/cs/filter/EnvelopeTest.java b/store/src/java-test/com/zimbra/cs/filter/EnvelopeTest.java index 14f4b42a419..1930fde54c2 100644 --- a/store/src/java-test/com/zimbra/cs/filter/EnvelopeTest.java +++ b/store/src/java-test/com/zimbra/cs/filter/EnvelopeTest.java @@ -23,16 +23,19 @@ import java.util.List; import java.util.Map; +import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Ignore; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.MethodRule; +import org.junit.rules.TestName; import com.google.common.collect.Maps; import com.zimbra.common.util.ArrayUtil; import com.zimbra.cs.account.Account; -import com.zimbra.cs.account.MockProvisioning; import com.zimbra.cs.account.Provisioning; import com.zimbra.cs.lmtpserver.LmtpAddress; import com.zimbra.cs.lmtpserver.LmtpEnvelope; @@ -44,24 +47,31 @@ import com.zimbra.cs.mailbox.OperationContext; import com.zimbra.cs.mime.ParsedMessage; import com.zimbra.cs.service.util.ItemId; +import com.zimbra.cs.util.ZTestWatchman; public class EnvelopeTest { private static String sampleMsg = "from: tim@example.com\n" - + "to: test@zimbra.com\n" + + "to: testEnv@zimbra.com\n" + "Subject: Example\n"; + @Rule public TestName testName = new TestName(); + @Rule public MethodRule watchman = new ZTestWatchman(); + + @BeforeClass public static void init() throws Exception { MailboxTestUtil.initServer(); - Provisioning prov = Provisioning.getInstance(); - prov.createAccount("test@zimbra.com", "secret", new HashMap()); - prov.createAccount("original@zimbra.com", "secret", new HashMap()); + } @Before public void setUp() throws Exception { - MailboxTestUtil.clearData(); + System.out.println(testName.getMethodName()); + Provisioning prov = Provisioning.getInstance(); + HashMap attrs = new HashMap(); + prov.createAccount("testEnv@zimbra.com", "secret", attrs); + prov.createAccount("original@zimbra.com", "secret", attrs); } @Test @@ -74,13 +84,12 @@ public void testFrom() { LmtpEnvelope env = new LmtpEnvelope(); LmtpAddress sender = new LmtpAddress("", new String[] { "BODY", "SIZE" }, null); - LmtpAddress recipient = new LmtpAddress("", null, null); + LmtpAddress recipient = new LmtpAddress("", null, null); env.setSender(sender); env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount( account); @@ -94,6 +103,7 @@ public void testFrom() { Mailbox.ID_FOLDER_INBOX, true); Assert.assertEquals(0, ids.size()); } catch (Exception e) { + e.printStackTrace(); fail("No exception should be thrown"); } } @@ -101,25 +111,24 @@ public void testFrom() { @Test public void testTo() { String filterScript = "require \"envelope\";\n" - + "if envelope :all :is \"to\" \"test@zimbra.com\" {\n" + + "if envelope :all :is \"to\" \"testEnv@zimbra.com\" {\n" + " tag \"To\";\n" + "}"; LmtpEnvelope env = new LmtpEnvelope(); LmtpAddress sender = new LmtpAddress("", new String[] { "BODY", "SIZE" }, null); - LmtpAddress recipient = new LmtpAddress("", null, null); + LmtpAddress recipient = new LmtpAddress("", null, null); env.setSender(sender); env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount( account); account.setMailSieveScript(filterScript); - account.setMail("test@zimbra.com"); + account.setMail("testEnv@zimbra.com"); List ids = RuleManager.applyRulesToIncomingMessage( new OperationContext(mbox), mbox, new ParsedMessage(sampleMsg.getBytes(), false), 0, @@ -156,15 +165,14 @@ public void testTo_BccTo() { env.setSender(sender); // To address - LmtpAddress recipient = new LmtpAddress("", null, null); + LmtpAddress recipient = new LmtpAddress("", null, null); env.addLocalRecipient(recipient); // Bcc address recipient = new LmtpAddress("", null, null); env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount( account); @@ -201,8 +209,7 @@ public void testMailFrom() { env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount( account); @@ -236,8 +243,7 @@ public void testMailFromBackslash() { env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount( account); @@ -271,8 +277,7 @@ public void testMailFromDot() { env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount( account); @@ -306,8 +311,7 @@ public void testMailFromDoubleQuote() { env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount( account); @@ -341,8 +345,7 @@ public void testMailFromSingleQuote() { env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount( account); @@ -376,8 +379,7 @@ public void testMailFromQuestionMark() { env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount( account); @@ -411,8 +413,7 @@ public void testMailFromComma() { env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount( account); @@ -493,7 +494,7 @@ public void testVariable(String filterScript) { + "Subject: Example\n"; String[] expectedTagName = {"env_envelope_from@example.com", - "env_test@zimbra.com", + "env_testEnv@zimbra.com", "adr_message_header_from@example.com", "adr_message_header_to@zimbra.com", "hdr_message_header_from@example.com", @@ -501,13 +502,12 @@ public void testVariable(String filterScript) { LmtpEnvelope env = new LmtpEnvelope(); LmtpAddress sender = new LmtpAddress("", new String[] { "BODY", "SIZE" }, null); - LmtpAddress recipient = new LmtpAddress("", null, null); + LmtpAddress recipient = new LmtpAddress("", null, null); env.setSender(sender); env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); Map attrs = Maps.newHashMap(); attrs = Maps.newHashMap(); Provisioning.getInstance().getServer(account).modify(attrs); @@ -556,8 +556,7 @@ public void testMailFrom_nullReverse_path() { env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount( account); @@ -589,8 +588,7 @@ public void testOutgoingFilter() { + "}"; try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount( account); @@ -621,12 +619,12 @@ public void testCompareEmptyStringWithAsciiNumeric() { LmtpEnvelope env = new LmtpEnvelope(); LmtpAddress sender = new LmtpAddress("", new String[] { "BODY", "SIZE" }, null); - LmtpAddress recipient = new LmtpAddress("", null, null); + LmtpAddress recipient = new LmtpAddress("", null, null); env.setSender(sender); env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount(MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(account); @@ -757,19 +755,18 @@ public void testNumericNegativeValueCount() { LmtpEnvelope env = new LmtpEnvelope(); LmtpAddress sender = new LmtpAddress("", new String[] { "BODY", "SIZE" }, null); - LmtpAddress recipient = new LmtpAddress("", null, null); + LmtpAddress recipient = new LmtpAddress("", null, null); env.setSender(sender); env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount( account); account.setMailSieveScript(filterScript); - account.setMail("test@zimbra.com"); + account.setMail("testEnv@zimbra.com"); List ids = RuleManager.applyRulesToIncomingMessage( new OperationContext(mbox), mbox, new ParsedMessage(sampleMsg.getBytes(), false), 0, @@ -1028,8 +1025,7 @@ public void testMissingComparatorNumericDeclaration() throws Exception { env.addLocalRecipient(recipient); try { - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testEnv@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(account); @@ -1050,4 +1046,13 @@ public void testMissingComparatorNumericDeclaration() throws Exception { fail("No exception should be thrown" + e); } } + + @After + public void tearDown() { + try { + MailboxTestUtil.clearData(); + } catch (Exception e) { + e.printStackTrace(); + } + } } diff --git a/store/src/java-test/com/zimbra/cs/filter/FileIntoCopyTest.java b/store/src/java-test/com/zimbra/cs/filter/FileIntoCopyTest.java index 44e14de51ce..6b6dfc673b2 100644 --- a/store/src/java-test/com/zimbra/cs/filter/FileIntoCopyTest.java +++ b/store/src/java-test/com/zimbra/cs/filter/FileIntoCopyTest.java @@ -543,4 +543,33 @@ mbox, new ParsedMessage(raw.getBytes(), false), 0, account.getName(), fail("No exception should be thrown"); } } + + @Test + public void testPlainFileIntoWithSpaces() { + String filterScript = "require [\"fileinto\"];\n" + + "fileinto \" abc\";" // final destination folder = " abc" + + "fileinto \"abc \";" // final destination folder = "abc" + + "fileinto \" abc \";"; // final destination folder = " abc" + try { + Account account = Provisioning.getInstance().get(Key.AccountBy.name, "test@zimbra.com"); + RuleManager.clearCachedRules(account); + Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(account); + account.setMailSieveScript(filterScript); + String raw = "From: sender@zimbra.com\n" + "To: test1@zimbra.com\n" + "Subject: Test\n" + + "\n" + "Hello World."; + List ids = RuleManager.applyRulesToIncomingMessage(new OperationContext(mbox), + mbox, new ParsedMessage(raw.getBytes(), false), 0, account.getName(), + new DeliveryContext(), Mailbox.ID_FOLDER_INBOX, true); + assertEquals(2, ids.size()); + Message msg = mbox.getMessageById(null, ids.get(0).getId()); + Folder folder = mbox.getFolderById(null, msg.getFolderId()); + assertEquals(" abc", folder.getName()); + msg = mbox.getMessageById(null, ids.get(1).getId()); + folder = mbox.getFolderById(null, msg.getFolderId()); + assertEquals("abc", folder.getName()); + } catch (Exception e) { + e.printStackTrace(); + fail("No exception should be thrown"); + } + } } diff --git a/store/src/java-test/com/zimbra/cs/filter/FlagTest.java b/store/src/java-test/com/zimbra/cs/filter/FlagTest.java index b68b12bdd8a..2830f70c196 100644 --- a/store/src/java-test/com/zimbra/cs/filter/FlagTest.java +++ b/store/src/java-test/com/zimbra/cs/filter/FlagTest.java @@ -19,10 +19,14 @@ import java.util.HashMap; import java.util.List; +import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.MethodRule; +import org.junit.rules.TestName; import com.zimbra.common.filter.Sieve.Flag; import com.zimbra.cs.account.Account; @@ -37,6 +41,7 @@ import com.zimbra.cs.mailbox.OperationContext; import com.zimbra.cs.mime.ParsedMessage; import com.zimbra.cs.service.util.ItemId; +import com.zimbra.cs.util.ZTestWatchman; /** * Unit test for {@link Flag}. @@ -45,6 +50,9 @@ */ public final class FlagTest { + @Rule public TestName testName = new TestName(); + @Rule public MethodRule watchman = new ZTestWatchman(); + @BeforeClass public static void init() throws Exception { MailboxTestUtil.initServer(); @@ -54,7 +62,7 @@ public static void init() throws Exception { @Before public void setUp() throws Exception { - MailboxTestUtil.clearData(); + System.out.println(testName.getMethodName()); } @Test @@ -72,5 +80,14 @@ public void priority() throws Exception { Message msg = mbox.getMessageById(null, ids.get(0).getId()); Assert.assertTrue(msg.isTagged(FlagInfo.PRIORITY)); } + + @After + public void tearDown() { + try { + MailboxTestUtil.clearData(); + } catch (Exception e) { + e.printStackTrace(); + } + } } diff --git a/store/src/java-test/com/zimbra/cs/filter/HeaderTest.java b/store/src/java-test/com/zimbra/cs/filter/HeaderTest.java index 8eac937c06a..d150db84e15 100644 --- a/store/src/java-test/com/zimbra/cs/filter/HeaderTest.java +++ b/store/src/java-test/com/zimbra/cs/filter/HeaderTest.java @@ -18,23 +18,24 @@ import static org.junit.Assert.fail; -import java.io.File; import java.io.InputStream; import java.util.HashMap; import java.util.List; import javax.mail.internet.MimeMessage; +import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.MethodRule; +import org.junit.rules.TestName; import com.zimbra.common.util.ArrayUtil; -import com.zimbra.common.util.ByteUtil; import com.zimbra.common.zmime.ZMimeMessage; import com.zimbra.cs.account.Account; -import com.zimbra.cs.account.MockProvisioning; import com.zimbra.cs.account.Provisioning; import com.zimbra.cs.lmtpserver.LmtpAddress; import com.zimbra.cs.lmtpserver.LmtpEnvelope; @@ -45,12 +46,15 @@ import com.zimbra.cs.mailbox.MailboxTestUtil; import com.zimbra.cs.mailbox.Message; import com.zimbra.cs.mailbox.OperationContext; -import com.zimbra.cs.mailbox.Tag; import com.zimbra.cs.mime.ParsedMessage; import com.zimbra.cs.service.util.ItemId; import com.zimbra.cs.util.JMSession; +import com.zimbra.cs.util.ZTestWatchman; public class HeaderTest { + @Rule public TestName testName = new TestName(); + @Rule public MethodRule watchman = new ZTestWatchman(); + private static String sampleMsg = "Received: from edge01e.zimbra.com ([127.0.0.1])\n" + "\tby localhost (edge01e.zimbra.com [127.0.0.1]) (amavisd-new, port 10032)\n" + "\twith ESMTP id DN6rfD1RkHD7; Fri, 24 Jun 2016 01:45:31 -0400 (EDT)\n" @@ -68,13 +72,14 @@ public class HeaderTest { @BeforeClass public static void init() throws Exception { MailboxTestUtil.initServer(); - Provisioning prov = Provisioning.getInstance(); - prov.createAccount("test@zimbra.com", "secret", new HashMap()); + } @Before public void setUp() throws Exception { - MailboxTestUtil.clearData(); + System.out.println(testName.getMethodName()); + Provisioning prov = Provisioning.getInstance(); + prov.createAccount("testHdr@zimbra.com", "secret", new HashMap()); } @Test @@ -168,8 +173,7 @@ public void testNumericEmptyIs() { private void doTest(String filterScript, String expectedResult) { try { LmtpEnvelope env = setEnvelopeInfo(); - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testHdr@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(account); @@ -203,12 +207,12 @@ private LmtpEnvelope setEnvelopeInfo() { } public void singleMimePart() throws Exception { - Account account = Provisioning.getInstance().getAccount(MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testHdr@zimbra.com"); RuleManager.clearCachedRules(account); account.setMailSieveScript("if header \"Subject\" \"important\" { flag \"priority\"; }"); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(account); - String msgContent = "From: test@zimbra.com\nSubject: important"; + String msgContent = "From: testHdr@zimbra.com\nSubject: important"; List ids = RuleManager.applyRulesToIncomingMessage(new OperationContext(mbox), mbox, new ParsedMessage(msgContent.getBytes(), false), 0, account.getName(), new DeliveryContext(), Mailbox.ID_FOLDER_INBOX, true); @@ -219,7 +223,7 @@ public void singleMimePart() throws Exception { @Test public void RFC822Attached() throws Exception { - Account account = Provisioning.getInstance().getAccount(MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testHdr@zimbra.com"); RuleManager.clearCachedRules(account); account.setMailSieveScript("if header :is \"Subject\" \"Attached HTML message\" { flag \"priority\"; }"); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(account); @@ -236,7 +240,7 @@ public void RFC822Attached() throws Exception { @Test public void fileAttached() throws Exception { - Account account = Provisioning.getInstance().getAccount(MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testHdr@zimbra.com"); RuleManager.clearCachedRules(account); account.setMailSieveScript("if header :contains \"Content-Disposition\" \"attachment.txt\" { flag \"priority\"; }"); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(account); @@ -293,7 +297,7 @@ public void testBackslash() throws Exception { + "X-Header4: sample\\\\\\\\pattern\n" + "X-Header5: sample\\\\\\\\\\\n"; try { - Account account = Provisioning.getInstance().getAccount(MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testHdr@zimbra.com"); RuleManager.clearCachedRules(account); account.setAdminSieveScriptBefore(script); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(account); @@ -360,7 +364,7 @@ public void testHeaderMatchWithItself() throws Exception { String sourceMsg = "X-Header1: sample\\\\pattern\n"; try { - Account account = Provisioning.getInstance().getAccount(MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testHdr@zimbra.com"); RuleManager.clearCachedRules(account); account.setAdminSieveScriptBefore(script); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(account); @@ -401,7 +405,7 @@ public void testHeaderNamesWithSpaces() throws Exception { String sourceMsg = "X-Header1: sample\\\\pattern\n"; try { - Account account = Provisioning.getInstance().getAccount(MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testHdr@zimbra.com"); RuleManager.clearCachedRules(account); account.setAdminSieveScriptBefore(script); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(account); @@ -424,7 +428,7 @@ public void testMalencodedHeader() throws Exception { String script = "if header :matches [\"Subject\"] \"*\" { tag \"321321\"; }"; String sourceMsg = "Subject: =?ABC?A?GyRCJFskMhsoQg==?="; try { - Account account = Provisioning.getInstance().getAccount(MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testHdr@zimbra.com"); RuleManager.clearCachedRules(account); account.unsetAdminSieveScriptBefore(); account.unsetMailSieveScript(); @@ -459,8 +463,7 @@ public void testMissingComparatorNumericDeclaration() throws Exception { + "}"; try { LmtpEnvelope env = setEnvelopeInfo(); - Account account = Provisioning.getInstance().getAccount( - MockProvisioning.DEFAULT_ACCOUNT_ID); + Account account = Provisioning.getInstance().getAccountByName("testHdr@zimbra.com"); RuleManager.clearCachedRules(account); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(account); @@ -481,4 +484,13 @@ public void testMissingComparatorNumericDeclaration() throws Exception { fail("No exception should be thrown" + e); } } + + @After + public void tearDown() { + try { + MailboxTestUtil.clearData(); + } catch (Exception e) { + e.printStackTrace(); + } + } } diff --git a/store/src/java-test/com/zimbra/cs/filter/RejectTest.java b/store/src/java-test/com/zimbra/cs/filter/RejectTest.java index 574cf78f8fd..fd4d91b8fb2 100644 --- a/store/src/java-test/com/zimbra/cs/filter/RejectTest.java +++ b/store/src/java-test/com/zimbra/cs/filter/RejectTest.java @@ -22,11 +22,15 @@ import java.util.Map; import java.util.UUID; +import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Ignore; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.MethodRule; +import org.junit.rules.TestName; import com.google.common.collect.Maps; import com.zimbra.common.account.Key; @@ -44,22 +48,26 @@ import com.zimbra.cs.mime.ParsedMessage; import com.zimbra.cs.service.mail.SendMsgTest.DirectInsertionMailboxManager; import com.zimbra.cs.service.util.ItemId; +import com.zimbra.cs.util.ZTestWatchman; public class RejectTest { + @Rule public TestName testName = new TestName(); + @Rule public MethodRule watchman = new ZTestWatchman(); + private static String sampleBaseMsg = "Received: from edge01e.zimbra.com ([127.0.0.1])\n" + "\tby localhost (edge01e.zimbra.com [127.0.0.1]) (amavisd-new, port 10032)\n" + "\twith ESMTP id DN6rfD1RkHD7; Fri, 24 Jun 2016 01:45:31 -0400 (EDT)\n" + "Received: from localhost (localhost [127.0.0.1])\n" + "\tby edge01e.zimbra.com (Postfix) with ESMTP id 9245B13575C;\n" + "\tFri, 24 Jun 2016 01:45:31 -0400 (EDT)\n" - + "from: test2@zimbra.com\n" + + "from: testRej2@zimbra.com\n" + "Subject: example\n" - + "to: test@zimbra.com\n"; + + "to: testRej@zimbra.com\n"; // RFC 5429 2.2.1 private String filterScript = "require [\"reject\"];\n" - + "if header :contains \"from\" \"test2@zimbra.com\" {\n" + + "if header :contains \"from\" \"testRej2@zimbra.com\" {\n" + " reject text:\r\n" + "I am not taking mail from you, and I don’t\n" + "want your birdseed, either!\r\n" @@ -70,40 +78,38 @@ public class RejectTest { @BeforeClass public static void init() throws Exception { MailboxTestUtil.initServer(); - MailboxTestUtil.clearData(); - Provisioning prov = Provisioning.getInstance(); - Map attrs = Maps.newHashMap(); - prov.createDomain("zimbra.com", attrs); + // this MailboxManager does everything except actually send mail + MailboxManager.setInstance(new DirectInsertionMailboxManager()); + + } + @Before + public void setUp() throws Exception { + System.out.println(testName.getMethodName()); + Provisioning prov = Provisioning.getInstance(); + Map attrs = Maps.newHashMap(); + attrs = Maps.newHashMap(); attrs.put(Provisioning.A_zimbraId, UUID.randomUUID().toString()); attrs.put(Provisioning.A_zimbraSieveRejectMailEnabled, "TRUE"); - prov.createAccount("test@zimbra.com", "secret", attrs); + prov.createAccount("testRej@zimbra.com", "secret", attrs); attrs = Maps.newHashMap(); attrs.put(Provisioning.A_zimbraId, UUID.randomUUID().toString()); attrs.put(Provisioning.A_zimbraSieveRejectMailEnabled, "TRUE"); - prov.createAccount("test2@zimbra.com", "secret", attrs); - - // this MailboxManager does everything except actually send mail - MailboxManager.setInstance(new DirectInsertionMailboxManager()); + prov.createAccount("testRej2@zimbra.com", "secret", attrs); } - @Before - public void setUp() throws Exception { - MailboxTestUtil.clearData(); - } - /* - * MDN should be sent to the envelope from (test2@zimbra.com) + * MDN should be sent to the envelope from (testRej2@zimbra.com) */ @Ignore /*Bug ZCS-1708 */ public void testNotemptyEnvelopeFrom() { try { - Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "test@zimbra.com"); - Account acct2 = Provisioning.getInstance().get(Key.AccountBy.name, "test2@zimbra.com"); + Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "testRej@zimbra.com"); + Account acct2 = Provisioning.getInstance().get(Key.AccountBy.name, "testRej2@zimbra.com"); Mailbox mbox1 = MailboxManager.getInstance().getMailboxByAccount(acct1); Mailbox mbox2 = MailboxManager.getInstance().getMailboxByAccount(acct2); @@ -111,8 +117,8 @@ public void testNotemptyEnvelopeFrom() { RuleManager.clearCachedRules(acct1); LmtpEnvelope env = new LmtpEnvelope(); - LmtpAddress sender = new LmtpAddress("", new String[] { "BODY", "SIZE" }, null); - LmtpAddress recipient = new LmtpAddress("", null, null); + LmtpAddress sender = new LmtpAddress("", new String[] { "BODY", "SIZE" }, null); + LmtpAddress recipient = new LmtpAddress("", null, null); env.setSender(sender); env.addLocalRecipient(recipient); @@ -136,7 +142,7 @@ env, new DeliveryContext(), } /* - * MDN should be sent to the envelope from (test2@zimbra.com) + * MDN should be sent to the envelope from (testRej2@zimbra.com) */ @Test public void testNotemptyEnvelopeFromAndUsingVariables() { @@ -146,7 +152,7 @@ public void testNotemptyEnvelopeFromAndUsingVariables() { + "if envelope :matches [\"To\"] \"*\" {" + "set \"rcptto\" \"hello\";}\n" + "if header :matches [\"From\"] \"*\" {" - + "set \"fromheader\" \"test2@zimbra.com\";}\n" + + "set \"fromheader\" \"testRej2@zimbra.com\";}\n" + "if header :matches [\"Subject\"] \"*\" {" + "set \"subjectheader\" \"New Subject\";}\n" + "set \"bodyparam\" text: # This is a comment\r\n" @@ -157,8 +163,8 @@ public void testNotemptyEnvelopeFromAndUsingVariables() { + ";\n" +"log \"Subject: ${subjectheader}\"; \n" +"reject \"${bodyparam}\"; \n"; - Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "test@zimbra.com"); - Account acct2 = Provisioning.getInstance().get(Key.AccountBy.name, "test2@zimbra.com"); + Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "testRej@zimbra.com"); + Account acct2 = Provisioning.getInstance().get(Key.AccountBy.name, "testRej2@zimbra.com"); Mailbox mbox1 = MailboxManager.getInstance().getMailboxByAccount(acct1); Mailbox mbox2 = MailboxManager.getInstance().getMailboxByAccount(acct2); @@ -166,24 +172,23 @@ public void testNotemptyEnvelopeFromAndUsingVariables() { RuleManager.clearCachedRules(acct1); LmtpEnvelope env = new LmtpEnvelope(); - LmtpAddress sender = new LmtpAddress("", new String[] { "BODY", "SIZE" }, null); - LmtpAddress recipient = new LmtpAddress("", null, null); + LmtpAddress sender = new LmtpAddress("", new String[] { "BODY", "SIZE" }, null); + LmtpAddress recipient = new LmtpAddress("", null, null); env.setSender(sender); env.addLocalRecipient(recipient); - String raw = "From: sender@in.telligent.com\n" - + "To: coyote@ACME.Example.COM\n" - + "Subject: test\n" + "\n" + "Hello World."; +// String raw = "From: sender@in.telligent.com\n" +// + "To: coyote@ACME.Example.COM\n" +// + "Subject: test\n" + "\n" + "Hello World."; acct1.setMailSieveScript(filterScript); - acct1.setMail("test@zimbra.com"); + acct1.setMail("testRej@zimbra.com"); List ids = RuleManager.applyRulesToIncomingMessage( new OperationContext(mbox1), mbox1, new ParsedMessage( sampleBaseMsg.getBytes(), false), 0, acct1.getName(), env, new DeliveryContext(), Mailbox.ID_FOLDER_INBOX, true); Assert.assertEquals(0, ids.size()); - List ll = mbox2.getItemIds(null, Mailbox.ID_FOLDER_INBOX) - .getIds(MailItem.Type.MESSAGE); + Integer item = mbox2.getItemIds(null, Mailbox.ID_FOLDER_INBOX) .getIds(MailItem.Type.MESSAGE).get(0); Message mdnMsg = mbox2.getMessageById(null, item); @@ -198,15 +203,15 @@ env, new DeliveryContext(), } /* - * MDN should be sent to the return-path from (test2@zimbra.com) + * MDN should be sent to the return-path from (testRej2@zimbra.com) */ @Test public void testEmptyEnvelopeFrom() { - String sampleMsg = "Return-Path: test2@zimbra.com\n" + sampleBaseMsg; + String sampleMsg = "Return-Path: testRej2@zimbra.com\n" + sampleBaseMsg; try { - Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "test@zimbra.com"); - Account acct2 = Provisioning.getInstance().get(Key.AccountBy.name, "test2@zimbra.com"); + Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "testRej@zimbra.com"); + Account acct2 = Provisioning.getInstance().get(Key.AccountBy.name, "testRej2@zimbra.com"); Mailbox mbox1 = MailboxManager.getInstance().getMailboxByAccount(acct1); Mailbox mbox2 = MailboxManager.getInstance().getMailboxByAccount(acct2); @@ -215,7 +220,7 @@ public void testEmptyEnvelopeFrom() { LmtpEnvelope env = new LmtpEnvelope(); LmtpAddress sender = new LmtpAddress("<>", new String[] { "BODY", "SIZE" }, null); - LmtpAddress recipient = new LmtpAddress("", null, null); + LmtpAddress recipient = new LmtpAddress("", null, null); env.setSender(sender); env.addLocalRecipient(recipient); @@ -239,7 +244,7 @@ env, new DeliveryContext(), } /* - * MDN should not to be sent, and the message should be delivered to test@zimbra.com + * MDN should not to be sent, and the message should be delivered to testRej@zimbra.com * * The following exception will be thrown: * javax.mail.MessagingException: Neither 'envelope from' nor 'Return-Path' specified. Can't locate the address to reject to (No MDN sent) @@ -247,8 +252,8 @@ env, new DeliveryContext(), @Test public void testEmptyEnvelopeFromAndEmptyReturnPath() { try { - Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "test@zimbra.com"); - Account acct2 = Provisioning.getInstance().get(Key.AccountBy.name, "test2@zimbra.com"); + Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "testRej@zimbra.com"); + Account acct2 = Provisioning.getInstance().get(Key.AccountBy.name, "testRej2@zimbra.com"); Mailbox mbox1 = MailboxManager.getInstance().getMailboxByAccount(acct1); Mailbox mbox2 = MailboxManager.getInstance().getMailboxByAccount(acct2); @@ -257,7 +262,7 @@ public void testEmptyEnvelopeFromAndEmptyReturnPath() { LmtpEnvelope env = new LmtpEnvelope(); LmtpAddress sender = new LmtpAddress("<>", new String[] { "BODY", "SIZE" }, null); - LmtpAddress recipient = new LmtpAddress("", null, null); + LmtpAddress recipient = new LmtpAddress("", null, null); env.setSender(sender); env.addLocalRecipient(recipient); @@ -279,18 +284,16 @@ env, new DeliveryContext(), @Test public void testSieveRejectEnabledIsFalse() { try { - Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "test@zimbra.com"); + Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "testRej@zimbra.com"); acct1.setSieveRejectMailEnabled(false); - Account acct2 = Provisioning.getInstance().get(Key.AccountBy.name, "test2@zimbra.com"); - + Mailbox mbox1 = MailboxManager.getInstance().getMailboxByAccount(acct1); - Mailbox mbox2 = MailboxManager.getInstance().getMailboxByAccount(acct2); RuleManager.clearCachedRules(acct1); LmtpEnvelope env = new LmtpEnvelope(); - LmtpAddress sender = new LmtpAddress("", new String[] { "BODY", "SIZE" }, null); - LmtpAddress recipient = new LmtpAddress("", null, null); + LmtpAddress sender = new LmtpAddress("", new String[] { "BODY", "SIZE" }, null); + LmtpAddress recipient = new LmtpAddress("", null, null); env.setSender(sender); env.addLocalRecipient(recipient); @@ -309,4 +312,13 @@ env, new DeliveryContext(), fail("No exception should be thrown: " + e.getMessage()); } } + + @After + public void tearDown() { + try { + MailboxTestUtil.clearData(); + } catch (Exception e) { + e.printStackTrace(); + } + } } diff --git a/store/src/java-test/com/zimbra/cs/filter/RuleManagerWithCustomActionFilterTest.java b/store/src/java-test/com/zimbra/cs/filter/RuleManagerWithCustomActionFilterTest.java index 669adceda63..adb27e1897f 100644 --- a/store/src/java-test/com/zimbra/cs/filter/RuleManagerWithCustomActionFilterTest.java +++ b/store/src/java-test/com/zimbra/cs/filter/RuleManagerWithCustomActionFilterTest.java @@ -16,26 +16,37 @@ */ package com.zimbra.cs.filter; -import com.zimbra.cs.account.Account; -import com.zimbra.cs.account.MockProvisioning; -import com.zimbra.cs.account.Provisioning; -import com.zimbra.cs.extension.*; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.List; + import org.apache.jsieve.SieveFactory; import org.apache.jsieve.commands.AbstractActionCommand; -import com.zimbra.cs.mailbox.*; -import com.zimbra.cs.mime.ParsedMessage; -import com.zimbra.cs.service.util.ItemId; +import org.junit.After; +import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.AfterClass; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.MethodRule; +import org.junit.rules.TestName; -import java.util.HashMap; -import java.util.List; - -import java.lang.reflect.Method; -import java.lang.reflect.Field; +import com.zimbra.cs.account.Account; +import com.zimbra.cs.account.MockProvisioning; +import com.zimbra.cs.account.Provisioning; +import com.zimbra.cs.extension.ExtensionTestUtil; +import com.zimbra.cs.extension.ExtensionUtil; +import com.zimbra.cs.mailbox.DeliveryContext; +import com.zimbra.cs.mailbox.Mailbox; +import com.zimbra.cs.mailbox.MailboxManager; +import com.zimbra.cs.mailbox.MailboxTestUtil; +import com.zimbra.cs.mailbox.Message; +import com.zimbra.cs.mailbox.OperationContext; +import com.zimbra.cs.mime.ParsedMessage; +import com.zimbra.cs.service.util.ItemId; +import com.zimbra.cs.util.ZTestWatchman; /** * Unit test for {@link com.zimbra.cs.filter.RuleManager} @@ -43,7 +54,11 @@ */ public final class RuleManagerWithCustomActionFilterTest { + @Rule public TestName testName = new TestName(); + @Rule public MethodRule watchman = new ZTestWatchman(); + private static SieveFactory original_sf; + @BeforeClass public static void init() throws Exception { @@ -104,7 +119,7 @@ public static void cleanUp() throws Exception{ @Before public void setUp() throws Exception { - MailboxTestUtil.clearData(); + System.out.println(testName.getMethodName()); } @Test @@ -195,5 +210,14 @@ public void customDicardAndCustomTag() throws Exception { //tag_ext2.destroy(); } + + @After + public void tearDown() { + try { + MailboxTestUtil.clearData(); + } catch (Exception e) { + e.printStackTrace(); + } + } } diff --git a/store/src/java-test/com/zimbra/cs/filter/SetVariableTest.java b/store/src/java-test/com/zimbra/cs/filter/SetVariableTest.java index 2d540a6b91d..fdba4edcb7d 100644 --- a/store/src/java-test/com/zimbra/cs/filter/SetVariableTest.java +++ b/store/src/java-test/com/zimbra/cs/filter/SetVariableTest.java @@ -1111,6 +1111,10 @@ public void testSetMatchVarAndFileInto() { Assert.assertEquals("test", folder.getName()); RuleManager.clearCachedRules(account); + account.unsetAdminSieveScriptBefore(); + account.unsetMailSieveScript(); + account.unsetAdminSieveScriptAfter(); + filterScript = "require [\"fileinto\", \"log\", \"variables\"];\n" + "set \"sub\" \"test\";\n" + "if header :contains \"subject\" \"Hello ${sub}\" {\n" @@ -1133,12 +1137,40 @@ public void testSetMatchVarAndFileInto() { folder = mbox.getFolderById(null, msg.getFolderId()); Assert.assertEquals("test", folder.getName()); + RuleManager.clearCachedRules(account); + account.unsetAdminSieveScriptBefore(); + account.unsetMailSieveScript(); + account.unsetAdminSieveScriptAfter(); + filterScript = "require [\"fileinto\", \"variables\"];\n" + + "set \"var5\" \"var test 5\";\n" + + "if allof (header :matches [\"subject\"] \"${var5}*\") {\n" + + " fileinto \"${var5}\";\n" + + " set \"var6\" \"var test 6\";\n" + + " if allof (header :matches [\"subject\"] \"*${var6}\") {\n" + + " fileinto \"${1}\";\n" + + " }\n" + + "}"; + + System.out.println(filterScript); + account.setMailSieveScript(filterScript); + raw = "From: sender@in.telligent.com\n" + + "To: coyote@ACME.Example.COM\n" + + "Subject: var test 5 var test 6\n" + + "\n" + + "Hello World."; + ids = RuleManager.applyRulesToIncomingMessage(new OperationContext(mbox), mbox, + new ParsedMessage(raw.getBytes(), false), 0, account.getName(), new DeliveryContext(), + Mailbox.ID_FOLDER_INBOX, true); + Assert.assertEquals(1, ids.size()); + msg = mbox.getMessageById(null, ids.get(0).getId()); + folder = mbox.getFolderById(null, msg.getFolderId()); + Assert.assertEquals("var test 5", folder.getName()); } catch (Exception e) { fail("No exception should be thrown"); } } - + @Ignore public void testSetMatchVarWithEnvelope() { LmtpEnvelope env = new LmtpEnvelope(); diff --git a/store/src/java-test/com/zimbra/cs/filter/ZimbraMailAdapterTest.java b/store/src/java-test/com/zimbra/cs/filter/ZimbraMailAdapterTest.java index a3e186791ff..bb1b7df51c5 100644 --- a/store/src/java-test/com/zimbra/cs/filter/ZimbraMailAdapterTest.java +++ b/store/src/java-test/com/zimbra/cs/filter/ZimbraMailAdapterTest.java @@ -15,6 +15,7 @@ import com.zimbra.cs.mailbox.Mailbox; import com.zimbra.cs.mailbox.MailboxTestUtil; import com.zimbra.cs.mime.ParsedMessage; +import com.zimbra.cs.store.Blob; import junit.framework.Assert; @@ -55,5 +56,21 @@ public void testUpdateIncomingBlob() throws Exception{ Assert.assertNull(nonSharedDeliveryCtxt.getMailBoxSpecificBlob(mboxId)); Assert.assertNotNull(nonSharedDeliveryCtxt.getIncomingBlob()); + + Mockito.when(handler.getDeliveryContext()).thenReturn(sharedDeliveryCtxt); + Blob blobFile = sharedDeliveryCtxt.getMailBoxSpecificBlob(mboxId); + mailAdapter.cloneParsedMessage(); + mailAdapter.updateIncomingBlob(); + Assert.assertNotNull(sharedDeliveryCtxt.getMailBoxSpecificBlob(mboxId)); + Assert.assertNull(sharedDeliveryCtxt.getIncomingBlob()); + Assert.assertNotSame(blobFile, sharedDeliveryCtxt.getMailBoxSpecificBlob(mboxId)); + + Mockito.when(handler.getDeliveryContext()).thenReturn(nonSharedDeliveryCtxt); + blobFile = nonSharedDeliveryCtxt.getMailBoxSpecificBlob(mboxId); + mailAdapter.cloneParsedMessage(); + mailAdapter.updateIncomingBlob(); + Assert.assertNull(nonSharedDeliveryCtxt.getMailBoxSpecificBlob(mboxId)); + Assert.assertNotNull(nonSharedDeliveryCtxt.getIncomingBlob()); + Assert.assertEquals(blobFile, nonSharedDeliveryCtxt.getMailBoxSpecificBlob(mboxId)); } } diff --git a/store/src/java-test/com/zimbra/cs/imap/ImapHandlerTest.java b/store/src/java-test/com/zimbra/cs/imap/ImapHandlerTest.java index a182c1665dd..4fb8b90baab 100644 --- a/store/src/java-test/com/zimbra/cs/imap/ImapHandlerTest.java +++ b/store/src/java-test/com/zimbra/cs/imap/ImapHandlerTest.java @@ -1,6 +1,7 @@ package com.zimbra.cs.imap; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; import java.util.Arrays; import java.util.HashMap; @@ -10,7 +11,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.MethodRule; +import org.junit.rules.TestName; import com.zimbra.common.localconfig.LC; import com.zimbra.common.mailbox.FolderStore; @@ -24,15 +28,18 @@ import com.zimbra.cs.mailbox.Message; import com.zimbra.cs.mailbox.SearchFolder; import com.zimbra.cs.server.ServerThrottle; +import com.zimbra.cs.util.ZTestWatchman; import com.zimbra.qa.unittest.TestUtil; import junit.framework.Assert; + public class ImapHandlerTest { private static final String LOCAL_USER = "localimaptest@zimbra.com"; - private Account acct = null; - private Mailbox mbox = null; + @Rule public TestName testName = new TestName(); + @Rule public MethodRule watchman = new ZTestWatchman(); + @BeforeClass public static void init() throws Exception { LC.imap_use_ehcache.setDefault(false); @@ -43,13 +50,12 @@ public static void init() throws Exception { @Before public void setUp() throws Exception { - MailboxTestUtil.clearData(); + System.out.println(testName.getMethodName()); Provisioning prov = Provisioning.getInstance(); HashMap attrs = new HashMap(); attrs.put(Provisioning.A_zimbraId, "12aa345b-2b47-44e6-8cb8-7fdfa18c1a9f"); - acct = prov.createAccount(LOCAL_USER, "secret", attrs); - mbox = MailboxManager.getInstance().getMailboxByAccount(acct); - acct.setFeatureAntispamEnabled(true); + attrs.put(Provisioning.A_zimbraFeatureAntispamEnabled , "true"); + prov.createAccount(LOCAL_USER, "secret", attrs); } @After @@ -58,14 +64,18 @@ public void tearDown() throws Exception { } @Test - public void testDoCOPYByUID() throws Exception { + public void testDoCOPYByUID() { + + try { + Account acct = Provisioning.getInstance().getAccount("12aa345b-2b47-44e6-8cb8-7fdfa18c1a9f"); + acct.setFeatureAntispamEnabled(true); + Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(acct); Message m1 = TestUtil.addMessage(mbox, "Message 1"); Message m2 = TestUtil.addMessage(mbox, "Message 2"); Message m3 = TestUtil.addMessage(mbox, "Message 3"); Assert.assertEquals(Mailbox.ID_FOLDER_INBOX, mbox.getMessageById(null, m1.getId()).getFolderId()); Assert.assertEquals(Mailbox.ID_FOLDER_INBOX, mbox.getMessageById(null, m2.getId()).getFolderId()); Assert.assertEquals(Mailbox.ID_FOLDER_INBOX, mbox.getMessageById(null, m3.getId()).getFolderId()); - ImapHandler handler = new MockImapHandler(); ImapCredentials creds = new ImapCredentials(acct, ImapCredentials.EnabledHack.NONE); ImapPath pathSpam = new MockImapPath(null,mbox.getFolderById(null, Mailbox.ID_FOLDER_SPAM), creds); @@ -105,10 +115,18 @@ public void testDoCOPYByUID() throws Exception { Assert.assertEquals("original messages should have stayed in inbox", Mailbox.ID_FOLDER_INBOX, mbox.getMessageById(null, m1.getId()).getFolderId()); Assert.assertEquals("original messages should have stayed in inbox", Mailbox.ID_FOLDER_INBOX, mbox.getMessageById(null, m2.getId()).getFolderId()); Assert.assertEquals("original messages should have stayed in inbox", Mailbox.ID_FOLDER_INBOX, mbox.getMessageById(null, m3.getId()).getFolderId()); + } catch (Exception e) { + fail("No error should be thrown"); + e.printStackTrace(); + } } @Test public void testDoCOPYByNumber() throws Exception { + + Account acct = Provisioning.getInstance().getAccount("12aa345b-2b47-44e6-8cb8-7fdfa18c1a9f"); + acct.setFeatureAntispamEnabled(true); + Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(acct); Message m1 = TestUtil.addMessage(mbox, "Message 1"); Message m2 = TestUtil.addMessage(mbox, "Message 2"); Message m3 = TestUtil.addMessage(mbox, "Message 3"); @@ -162,6 +180,10 @@ public void testDoCOPYByNumber() throws Exception { @Test public void testDoSearch() throws Exception { + + Account acct = Provisioning.getInstance().getAccount("12aa345b-2b47-44e6-8cb8-7fdfa18c1a9f"); + acct.setFeatureAntispamEnabled(true); + Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(acct); Message m1 = TestUtil.addMessage(mbox, "Message 1 blue"); Message m2 = TestUtil.addMessage(mbox, "Message 2 green red"); Message m3 = TestUtil.addMessage(mbox, "Message 3 green white"); @@ -169,6 +191,7 @@ public void testDoSearch() throws Exception { Assert.assertEquals(Mailbox.ID_FOLDER_INBOX, mbox.getMessageById(null, m2.getId()).getFolderId()); Assert.assertEquals(Mailbox.ID_FOLDER_INBOX, mbox.getMessageById(null, m3.getId()).getFolderId()); + Thread.sleep(500); ImapHandler handler = new MockImapHandler(); ImapCredentials creds = new ImapCredentials(acct, ImapCredentials.EnabledHack.NONE); ImapPath pathInbox = new MockImapPath(null,mbox.getFolderById(null, Mailbox.ID_FOLDER_INBOX), creds); @@ -189,6 +212,10 @@ public void testDoSearch() throws Exception { @Test public void testSearchInSearchFolder() throws Exception { + + Account acct = Provisioning.getInstance().getAccount("12aa345b-2b47-44e6-8cb8-7fdfa18c1a9f"); + acct.setFeatureAntispamEnabled(true); + Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(acct); Message m1 = TestUtil.addMessage(mbox, "Message 1 blue"); Message m2 = TestUtil.addMessage(mbox, "Message 2 green red"); Message m3 = TestUtil.addMessage(mbox, "Message 3 green white"); @@ -243,4 +270,4 @@ protected boolean isWritable(short rights) throws ServiceException { return true; } } -} \ No newline at end of file +} diff --git a/store/src/java-test/com/zimbra/cs/imap/ImapLoadBalancingMechanismTest.java b/store/src/java-test/com/zimbra/cs/imap/ImapLoadBalancingMechanismTest.java index d350af42825..748ef00e9a1 100644 --- a/store/src/java-test/com/zimbra/cs/imap/ImapLoadBalancingMechanismTest.java +++ b/store/src/java-test/com/zimbra/cs/imap/ImapLoadBalancingMechanismTest.java @@ -1,7 +1,7 @@ /* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server - * Copyright (C) 2011, 2013, 2014, 2016 Synacor, Inc. + * Copyright (C) 2017 Synacor, Inc. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software Foundation, @@ -16,20 +16,25 @@ */ package com.zimbra.cs.imap; +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertNotNull; +import static junit.framework.Assert.assertNull; +import static junit.framework.Assert.assertTrue; +import static junit.framework.Assert.fail; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import javax.servlet.http.HttpServletRequest; -import junit.framework.Assert; - import org.junit.BeforeClass; import org.junit.Test; import com.zimbra.common.service.ServiceException; import com.zimbra.cs.account.MockServer; import com.zimbra.cs.account.Server; +import com.zimbra.cs.imap.ImapLoadBalancingMechanism.AccountIdHashMechanism; import com.zimbra.cs.imap.ImapLoadBalancingMechanism.CustomLBMech; import com.zimbra.cs.mailbox.MailboxTestUtil; import com.zimbra.cs.service.MockHttpServletRequest; @@ -46,80 +51,69 @@ public static void init() throws Exception { } @Test - public void ClientIpHashMechanismEmptyServerList() + public void accountIdHashMechanismEmptyServerList() throws Exception { try { - ImapLoadBalancingMechanism mech = ImapLoadBalancingMechanism.newInstance(ImapLoadBalancingMechanism.ImapLBMech.ClientIpHash.name()); + ImapLoadBalancingMechanism mech = ImapLoadBalancingMechanism.newInstance( + ImapLoadBalancingMechanism.ImapLBMech.AccountIdHash.name()); ArrayList pool = new ArrayList(); - mech.getImapServerFromPool(null, pool); - Assert.fail("should have raised ServiceException"); - - } - catch (Exception e) { - Assert.assertTrue("expected ServiceException", e instanceof ServiceException); + mech.getImapServerFromPool(null, "dummyAccountId", pool); + fail("should have raised ServiceException"); + } catch (ServiceException se) { + /* this is what we expect */ + } catch (Exception e) { + fail(String.format("Unexpected exception thrown %s", e.getMessage())); } } @Test - public void ClientIpHashMechanismIpHashFromPool() + public void accountIdHashMechanismHashFromPool() throws Exception { - ImapLoadBalancingMechanism mech = ImapLoadBalancingMechanism.newInstance(ImapLoadBalancingMechanism.ImapLBMech.ClientIpHash.name()); + ImapLoadBalancingMechanism mech = ImapLoadBalancingMechanism.newInstance( + ImapLoadBalancingMechanism.ImapLBMech.AccountIdHash.name()); ArrayList pool = new ArrayList(); - Server s0 = new MockServer("server-0", "0"); - Server s1 = new MockServer("server-1", "1"); - Server s2 = new MockServer("server-2", "2"); - // Add to pool out-of-order to verify that we are sorting correctly + Server s0 = new MockServer("server-0", "0"); + Server s1 = new MockServer("server-1", "1"); + Server s2 = new MockServer("server-2", "2"); + // Add to pool out-of-order to verify that we are sorting correctly pool.add(s1); pool.add(s0); pool.add(s2); HashMap headers = new HashMap(); - /** - * For IPV4, Java uses the 32bit value of an IPV4 address as the hashCode of an IPV4 - * address, so with the current test setup, and a pool size of 3: - * 127.0.0.2 == (0x7f << 24) + 2 == 2130706434 - * And 2130706434 % 3 = 0 - * So 127.0.0.2 should return server 0 in our 3 node pool, - * 127.0.0.3 should return server 1 in our 3 node pool, - * 127.0.0.4 should return server 2 in our 3 node pool - */ - headers.put(ImapLoadBalancingMechanism.ClientIpHashMechanism.CLIENT_IP, "127.0.0.2"); HttpServletRequest req = new MockHttpServletRequest(null, null, null, 123, "127.0.0.1", headers); - Assert.assertEquals(s0, mech.getImapServerFromPool(req, pool)); - headers.put(ImapLoadBalancingMechanism.ClientIpHashMechanism.CLIENT_IP, "127.0.0.3"); - Assert.assertEquals(s1, mech.getImapServerFromPool(req, pool)); - headers.put(ImapLoadBalancingMechanism.ClientIpHashMechanism.CLIENT_IP, "127.0.0.4"); - Assert.assertEquals(s2, mech.getImapServerFromPool(req, pool)); - headers.put(ImapLoadBalancingMechanism.ClientIpHashMechanism.CLIENT_IP, "192.168.56.1"); - req = new MockHttpServletRequest(null, null, null, 123, "127.0.0.1", headers); - Assert.assertEquals("Expected address 192.168.56.1 to hash to s1", s1, mech.getImapServerFromPool(req, pool)); - - - /* Verify we get the same results using IPV6 */ - headers.put(ImapLoadBalancingMechanism.ClientIpHashMechanism.CLIENT_IP, "::FFFF:127.0.0.2"); - Assert.assertEquals(s0, mech.getImapServerFromPool(req, pool)); - headers.put(ImapLoadBalancingMechanism.ClientIpHashMechanism.CLIENT_IP, "::FFFF:127.0.0.3"); - Assert.assertEquals(s1, mech.getImapServerFromPool(req, pool)); - headers.put(ImapLoadBalancingMechanism.ClientIpHashMechanism.CLIENT_IP, "::FFFF:127.0.0.4"); - Assert.assertEquals(s2, mech.getImapServerFromPool(req, pool)); - headers.put(ImapLoadBalancingMechanism.ClientIpHashMechanism.CLIENT_IP, "2001:db8:cafe:f9::6"); - Assert.assertEquals("Expected address 2001:db8:cafe:f9::6 to hash to s2", s2, mech.getImapServerFromPool(req, pool)); + String acctId0 = "79e9a595-c34b-469a-a1ee-e2b9d03f9aa7"; /* hash=1536494685, hash % 3 = 0 */ + String acctId1 = "615922e5-2318-4b8b-8734-d209a99f8252"; /* hash=454270162, hash % 3 = 1 */ + String acctId2 = "f5c68357-61d9-4658-a7fc-e7273929ca0c"; /* hash=1373626454, hash % 3 = 2 */ + assertEquals("Should have got 0th entry from sorted pool", + s0, mech.getImapServerFromPool(req, acctId0, pool)); + assertEquals("Should have got 1st entry from sorted pool", + s1, mech.getImapServerFromPool(req, acctId1, pool)); + assertEquals("Should have got 2nd entry from sorted pool", + s2, mech.getImapServerFromPool(req, acctId2, pool)); } @Test public void testCustomLoadBalancingMech() throws Exception { CustomLBMech.register("testmech",TestCustomLBMech.class); ImapLoadBalancingMechanism mech = CustomLBMech.loadCustomLBMech("custom:testmech foo bar"); - Assert.assertTrue((mech instanceof TestCustomLBMech)); + assertNotNull("Loaded mechanism should be a TestCustomLBMech", mech); + assertTrue(String.format("Loaded mechanism '%s' should be a TestCustomLBMech", + mech.getClass().getName()), (mech instanceof TestCustomLBMech)); CustomLBMech customMech = (CustomLBMech) mech; - Assert.assertEquals(customMech.args.get(0), "foo"); - Assert.assertEquals(customMech.args.get(1), "bar"); + assertEquals("Custom Mech arg[0]", customMech.args.get(0), "foo"); + assertEquals("Custom Mech arg[1]", customMech.args.get(1), "bar"); mech = CustomLBMech.loadCustomLBMech("custom:testmech"); - Assert.assertTrue((mech instanceof TestCustomLBMech)); - Assert.assertNull(((CustomLBMech) mech).args); + assertNotNull("2nd Loaded mechanism should be a TestCustomLBMech", mech); + assertTrue(String.format("2nd Loaded mechanism '%s' should be a TestCustomLBMech", + mech.getClass().getName()), (mech instanceof TestCustomLBMech)); + assertNull("Args for custom mech after 2nd load", ((CustomLBMech) mech).args); mech = CustomLBMech.loadCustomLBMech("custom:unregisteredmech"); - Assert.assertTrue((mech instanceof ImapLoadBalancingMechanism.ClientIpHashMechanism)); + assertNotNull("3rd Loaded mechanism should be AccountIdHashMechanism", mech); + assertTrue(String.format( + "Loaded mechanism '%s' when configured bad custom mech should be AccountIdHashMechanism", + mech.getClass().getName()), (mech instanceof AccountIdHashMechanism)); } public static class TestCustomLBMech extends CustomLBMech { @@ -129,7 +123,7 @@ protected TestCustomLBMech(List args) { } @Override - public Server getImapServerFromPool(HttpServletRequest httpReq, + public Server getImapServerFromPool(HttpServletRequest httpReq, String accountID, List pool) throws ServiceException { return null; } diff --git a/store/src/java-test/com/zimbra/cs/imap/NioImapDecoderTest.java b/store/src/java-test/com/zimbra/cs/imap/NioImapDecoderTest.java index 4982589d687..3da16e00a19 100644 --- a/store/src/java-test/com/zimbra/cs/imap/NioImapDecoderTest.java +++ b/store/src/java-test/com/zimbra/cs/imap/NioImapDecoderTest.java @@ -28,7 +28,7 @@ import org.junit.Test; import com.google.common.base.Charsets; -import com.zimbra.cs.imap.NioImapDecoder.InvalidLiteralFormatException; +import com.zimbra.common.service.ServiceException; import com.zimbra.cs.imap.NioImapDecoder.TooBigLiteralException; import com.zimbra.cs.imap.NioImapDecoder.TooLongLineException; @@ -41,12 +41,41 @@ public final class NioImapDecoderTest { private static final CharsetEncoder CHARSET = Charsets.ISO_8859_1.newEncoder(); private static final IoBuffer IN = IoBuffer.allocate(1024).setAutoExpand(true); + private TestImapConfig imapConfig; private NioImapDecoder decoder; private ProtocolCodecSession session; + private static final class TestImapConfig extends ImapConfig { + private long maxMessageSize; + TestImapConfig(boolean ssl) throws ServiceException { + super(ssl); + maxMessageSize = -1L; /* means "no limit" */ + } + + public void setMaxMessageSize(long l) { + maxMessageSize = l; + } + + @Override + public long getMaxMessageSize() { + return maxMessageSize; + } + + @Override + public int getMaxRequestSize() { + return 1024; + } + + @Override + public int getWriteChunkSize() { + return 1024; + } + } + @Before - public void setUp() { - decoder = new NioImapDecoder(); + public void setUp() throws ServiceException { + imapConfig = new TestImapConfig(false); + decoder = new NioImapDecoder(imapConfig); session = new ProtocolCodecSession(); session.setTransportMetadata(new DefaultTransportMetadata("test", "test", false, true, // Enable fragmentation SocketAddress.class, IoSessionConfig.class, Object.class)); @@ -109,7 +138,7 @@ public void maxLineLength() throws Exception { IN.clear().fill(1024).putString("\r\nrecover\r\n", CHARSET).flip(); try { decoder.decode(session, IN, session.getDecoderOutput()); - Assert.fail(); + Assert.fail("decoder.decode did NOT throw TooLongLineException as expected"); } catch (TooLongLineException expected) { } Assert.assertEquals(0, session.getDecoderOutputQueue().size()); @@ -139,7 +168,7 @@ public void badLiteral() throws Exception { @Test public void maxLiteralSize() throws Exception { - decoder.setMaxLiteralSize(1024L); + imapConfig.setMaxMessageSize(1024L); IN.clear().putString("XXX {1025}\r\nrecover\r\n", CHARSET).flip(); try { decoder.decode(session, IN, session.getDecoderOutput()); @@ -171,5 +200,4 @@ public void emptyLiteral() throws Exception { Assert.assertEquals("A003 APPEND Drafts {0}", session.getDecoderOutputQueue().poll()); Assert.assertEquals(0, session.getDecoderOutputQueue().size()); } - } diff --git a/store/src/java-test/com/zimbra/cs/mailbox/ContactAutoCompleteTest.java b/store/src/java-test/com/zimbra/cs/mailbox/ContactAutoCompleteTest.java index a136c5879fe..fc771433d53 100644 --- a/store/src/java-test/com/zimbra/cs/mailbox/ContactAutoCompleteTest.java +++ b/store/src/java-test/com/zimbra/cs/mailbox/ContactAutoCompleteTest.java @@ -23,13 +23,18 @@ import javax.mail.internet.InternetAddress; +import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Ignore; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.MethodRule; +import org.junit.rules.TestName; import com.google.common.collect.ImmutableMap; +import com.zimbra.common.account.Key; import com.zimbra.common.mailbox.ContactConstants; import com.zimbra.cs.account.Account; import com.zimbra.cs.account.MockProvisioning; @@ -37,6 +42,7 @@ import com.zimbra.cs.mailbox.ContactAutoComplete.AutoCompleteResult; import com.zimbra.cs.mailbox.ContactAutoComplete.ContactEntry; import com.zimbra.cs.mime.ParsedContact; +import com.zimbra.cs.util.ZTestWatchman; /** * Unit test for {@link ContactAutoComplete}. @@ -45,18 +51,22 @@ */ public final class ContactAutoCompleteTest { + @Rule public TestName testName = new TestName(); + @Rule public MethodRule watchman = new ZTestWatchman(); + @BeforeClass public static void init() throws Exception { System.setProperty("zimbra.config", "../store/src/java-test/localconfig-test.xml"); MailboxTestUtil.initServer(); Provisioning prov = Provisioning.getInstance(); prov.createAccount("test@zimbra.com", "secret", new HashMap()); + prov.createAccount("test2@zimbra.com", "secret", new HashMap()); Provisioning.setInstance(prov); } @Before public void setUp() throws Exception { - MailboxTestUtil.clearData(); + System.out.println(testName.getMethodName()); } @Test @@ -75,6 +85,15 @@ public void hitContact() throws Exception { result.addEntry(contact); Assert.assertEquals(result.entries.size(), 2); } + + @After + public void tearDown() { + try { + MailboxTestUtil.clearData(); + } catch (Exception e) { + e.printStackTrace(); + } + } @Test public void lastNameFirstName() throws Exception { @@ -129,6 +148,7 @@ public void dash() throws Exception { fields.put(ContactConstants.A_email, "test@zimbra.com"); mbox.createContact(null, new ParsedContact(fields), Mailbox.ID_FOLDER_CONTACTS, null); + Thread.sleep(500); ContactAutoComplete autocomplete = new ContactAutoComplete(mbox.getAccount(), new OperationContext(mbox)); Assert.assertEquals(1, autocomplete.query("conf -", null, 100).entries.size()); Assert.assertEquals(1, autocomplete.query("conf - h", null, 100).entries.size()); @@ -139,7 +159,9 @@ public void dash() throws Exception { @Test public void hitGroup() throws Exception { ContactAutoComplete.AutoCompleteResult result = new ContactAutoComplete.AutoCompleteResult(10); - result.rankings = new ContactRankings(MockProvisioning.DEFAULT_ACCOUNT_ID); + Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "test2@zimbra.com"); +// result.rankings = new ContactRankings(MockProvisioning.DEFAULT_ACCOUNT_ID); + result.rankings = new ContactRankings(acct1.getId()); ContactAutoComplete.ContactEntry group = new ContactAutoComplete.ContactEntry(); group.mDisplayName = "G1"; group.mIsContactGroup = true; diff --git a/store/src/java-test/com/zimbra/cs/mailbox/ContactTest.java b/store/src/java-test/com/zimbra/cs/mailbox/ContactTest.java index b9c7eb5a64a..b569ccd1bcb 100644 --- a/store/src/java-test/com/zimbra/cs/mailbox/ContactTest.java +++ b/store/src/java-test/com/zimbra/cs/mailbox/ContactTest.java @@ -31,10 +31,14 @@ import javax.mail.internet.MimeMessage; import javax.mail.internet.MimePart; +import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.MethodRule; +import org.junit.rules.TestName; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; @@ -65,6 +69,7 @@ import com.zimbra.cs.service.mail.ToXML; import com.zimbra.cs.service.util.ItemIdFormatter; import com.zimbra.cs.util.JMSession; +import com.zimbra.cs.util.ZTestWatchman; /** * Unit test for {@link Contact}. @@ -73,6 +78,9 @@ */ public final class ContactTest { + @Rule public TestName testName = new TestName(); + @Rule public MethodRule watchman = new ZTestWatchman(); + @BeforeClass public static void init() throws Exception { MailboxTestUtil.initServer(); @@ -82,7 +90,7 @@ public static void init() throws Exception { @Before public void setUp() throws Exception { - MailboxTestUtil.clearData(); + System.out.println(testName.getMethodName()); } @Test @@ -160,7 +168,7 @@ public void existsInContacts() throws Exception { mbox.createContact(null, new ParsedContact(Collections.singletonMap( ContactConstants.A_email, "test1@zimbra.com")), Mailbox.ID_FOLDER_CONTACTS, null); MailboxTestUtil.index(mbox); - + Thread.sleep(500); Assert.assertTrue(mbox.index.existsInContacts(ImmutableList.of( new InternetAddress("Test "), new InternetAddress("Test ")))); Assert.assertFalse(mbox.index.existsInContacts(ImmutableList.of( @@ -305,7 +313,8 @@ public void testEncodeContact() throws Exception { @Test public void testTruncatedContactsTgzImport() throws IOException { - File file = new File("src/java-test/Truncated.tgz"); + File file = new File(MailboxTestUtil.getZimbraServerDir("") + "src/java-test/Truncated.tgz"); + System.out.println(file.getAbsolutePath()); InputStream is = new FileInputStream(file); ArchiveInputStream ais = new TarArchiveInputStream(new GZIPInputStream(is), "UTF-8"); ArchiveInputEntry aie; @@ -314,10 +323,20 @@ public void testTruncatedContactsTgzImport() throws IOException { try { ArchiveFormatter.readArchiveEntry(ais, aie); } catch (IOException e) { + e.printStackTrace(); errorCaught = true; break; } } Assert.assertTrue(errorCaught); } + + @After + public void tearDown() { + try { + MailboxTestUtil.clearData(); + } catch (Exception e) { + e.printStackTrace(); + } + } } diff --git a/store/src/java-test/com/zimbra/cs/mailbox/NotificationTest.java b/store/src/java-test/com/zimbra/cs/mailbox/NotificationTest.java new file mode 100644 index 00000000000..e6e953a55e3 --- /dev/null +++ b/store/src/java-test/com/zimbra/cs/mailbox/NotificationTest.java @@ -0,0 +1,114 @@ +/* + * ***** BEGIN LICENSE BLOCK ***** + * Zimbra Collaboration Suite Server + * Copyright (C) 2017 Synacor, Inc. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software Foundation, + * version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with this program. + * If not, see . + * ***** END LICENSE BLOCK ***** + */ +package com.zimbra.cs.mailbox; + +import java.util.Map; +import java.util.UUID; + +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.MethodRule; +import org.junit.rules.TestName; + +import com.google.common.collect.Maps; +import com.zimbra.common.account.Key; +import com.zimbra.common.account.ZAttrProvisioning.PrefExternalSendersType; +import com.zimbra.cs.account.Account; +import com.zimbra.cs.account.Provisioning; +import com.zimbra.cs.util.ZTestWatchman; + +import junit.framework.Assert; + +public class NotificationTest { + + @Rule public TestName testName = new TestName(); + @Rule public MethodRule watchman = new ZTestWatchman(); + + @BeforeClass + public static void init() throws Exception { + MailboxTestUtil.initServer(); + Provisioning prov = Provisioning.getInstance(); + Map attrs = Maps.newHashMap(); + + attrs = Maps.newHashMap(); + attrs.put(Provisioning.A_zimbraId, UUID.randomUUID().toString()); + prov.createAccount("testZCS3546@zimbra.com", "secret", attrs); + } + + @Before + public void setUp() throws Exception { + System.out.println(testName.getMethodName()); + MailboxTestUtil.clearData(); + } + + @After + public void tearDown() throws Exception { + MailboxTestUtil.clearData(); + + } + + @Test + public void testOOOWhenSpecificDomainSenderNotSet() throws Exception { + Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "testZCS3546@zimbra.com"); + acct1.setPrefOutOfOfficeSuppressExternalReply(true); + acct1.unsetInternalSendersDomain(); + acct1.unsetPrefExternalSendersType(); + Mailbox mbox1 = MailboxManager.getInstance().getMailboxByAccount(acct1); + boolean skipOOO = Notification.skipOutOfOfficeMsg("test3@synacor.com", acct1, mbox1); + Assert.assertEquals(true, skipOOO); + } + + @Test + public void testOOOWhenSpecificDomainSenderIsSet() throws Exception { + Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "testZCS3546@zimbra.com"); + acct1.setPrefOutOfOfficeSuppressExternalReply(true); + acct1.setPrefExternalSendersType(PrefExternalSendersType.INSD); + String[] domains = {"synacor.com"}; + acct1.setPrefOutOfOfficeSpecificDomains(domains); + Mailbox mbox1 = MailboxManager.getInstance().getMailboxByAccount(acct1); + boolean skipOOO = Notification.skipOutOfOfficeMsg("test3@synacor.com", acct1, mbox1); + Assert.assertEquals(false, skipOOO); + } + + @Test + public void testOOOMsgWhenSpecificDomainSenderIsSetWithSpecificDomainSender() throws Exception { + Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "testZCS3546@zimbra.com"); + acct1.setPrefOutOfOfficeExternalReplyEnabled(true); + acct1.setPrefExternalSendersType(PrefExternalSendersType.INSD); + String[] domains = {"synacor.com"}; + acct1.setPrefOutOfOfficeSpecificDomains(domains); + acct1.setInternalSendersDomain(domains); + Mailbox mbox1 = MailboxManager.getInstance().getMailboxByAccount(acct1); + boolean customMsg = Notification.sendOutOfOfficeExternalReply("test3@synacor.com", acct1, mbox1); + Assert.assertEquals(true, customMsg); + } + + @Test + public void testOOOMsgWhenSpecificDomainSenderIsSetWithInternalSender() throws Exception { + Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "testZCS3546@zimbra.com"); + acct1.setPrefOutOfOfficeExternalReplyEnabled(true); + acct1.setPrefExternalSendersType(PrefExternalSendersType.INSD); + String[] domains = {"synacor.com"}; + acct1.setPrefOutOfOfficeSpecificDomains(domains); + Mailbox mbox1 = MailboxManager.getInstance().getMailboxByAccount(acct1); + boolean customMsg = Notification.sendOutOfOfficeExternalReply("test2@zimbra.com", acct1, mbox1); + Assert.assertEquals(false, customMsg); + } +} diff --git a/store/src/java-test/com/zimbra/cs/service/ExternalUserProvServletTest.java b/store/src/java-test/com/zimbra/cs/service/ExternalUserProvServletTest.java index 9cc1f62d5d2..ab5886fb88c 100644 --- a/store/src/java-test/com/zimbra/cs/service/ExternalUserProvServletTest.java +++ b/store/src/java-test/com/zimbra/cs/service/ExternalUserProvServletTest.java @@ -21,9 +21,13 @@ import javax.servlet.http.HttpServletRequest; +import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.MethodRule; +import org.junit.rules.TestName; import com.google.common.collect.Maps; import com.zimbra.common.account.Key; @@ -31,10 +35,13 @@ import com.zimbra.cs.account.Account; import com.zimbra.cs.account.Provisioning; import com.zimbra.cs.mailbox.MailboxTestUtil; +import com.zimbra.cs.util.ZTestWatchman; import junit.framework.Assert; public class ExternalUserProvServletTest { + @Rule public TestName testName = new TestName(); + @Rule public MethodRule watchman = new ZTestWatchman(); @BeforeClass public static void init() throws Exception { @@ -45,12 +52,13 @@ public static void init() throws Exception { attrs = Maps.newHashMap(); prov.createAccount("test@zimbra.com", "secret", attrs); } - + @Before - public void setUp() throws Exception { - MailboxTestUtil.clearData(); + public void before() { + System.out.println(testName.getMethodName()); } + @Test public void testHandleAddressVerificationExpired() throws Exception { Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "test@zimbra.com"); @@ -74,4 +82,13 @@ public void testHandleAddressVerificationSuccess() throws Exception { Assert.assertEquals("test2@zimbra.com", acct1.getPrefMailForwardingAddress()); Assert.assertEquals(FeatureAddressVerificationStatus.verified, acct1.getFeatureAddressVerificationStatus()); } + + @After + public void tearDown() { + try { + MailboxTestUtil.clearData(); + } catch (Exception e) { + e.printStackTrace(); + } + } } diff --git a/store/src/java-test/com/zimbra/cs/service/ModifyPrefsTest.java b/store/src/java-test/com/zimbra/cs/service/ModifyPrefsTest.java index e5111e53379..b6f1656ca69 100644 --- a/store/src/java-test/com/zimbra/cs/service/ModifyPrefsTest.java +++ b/store/src/java-test/com/zimbra/cs/service/ModifyPrefsTest.java @@ -18,6 +18,7 @@ package com.zimbra.cs.service; import java.io.IOException; +import java.io.InputStream; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -26,13 +27,25 @@ import javax.mail.Address; import javax.mail.internet.MimeMessage; +import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.MethodRule; +import org.junit.rules.TestName; +import org.junit.runner.RunWith; +import org.junit.runners.model.FrameworkMethod; +import org.junit.rules.TestWatchman; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PowerMockIgnore; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; import com.google.common.collect.Maps; import com.zimbra.common.account.Key; import com.zimbra.common.account.ZAttrProvisioning.FeatureAddressVerificationStatus; +import com.zimbra.common.mime.MimeDetect; import com.zimbra.common.soap.Element; import com.zimbra.common.util.L10nUtil; import com.zimbra.cs.account.Account; @@ -50,10 +63,23 @@ import junit.framework.Assert; +@RunWith(PowerMockRunner.class) +@PrepareForTest(MimeDetect.class) +@PowerMockIgnore({ "javax.crypto.*", "javax.xml.bind.annotation.*" }) public class ModifyPrefsTest { public static String zimbraServerDir = ""; + @Rule + public TestName testName = new TestName(); + @Rule + public MethodRule watchman = new TestWatchman() { + @Override + public void failed(Throwable e, FrameworkMethod method) { + System.out.println(method.getName() + " " + e.getClass().getSimpleName()); + } + }; + @BeforeClass public static void init() throws Exception { MailboxTestUtil.initServer(); @@ -96,11 +122,17 @@ protected Collection sendMessage(Mailbox mbox, MimeMessage mm, @Before public void setUp() throws Exception { + System.out.println(testName.getMethodName()); + MailboxTestUtil.clearData(); + } + + @After + public void tearDown() throws Exception { MailboxTestUtil.clearData(); } @Test - public void testMsgMaxAttr() throws Exception { + public void testZCS2670() throws Exception { Account acct1 = Provisioning.getInstance().get(Key.AccountBy.name, "test@zimbra.com"); Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(acct1); acct1.setFeatureMailForwardingEnabled(true); diff --git a/store/src/java-test/com/zimbra/cs/service/mail/GetContactBackupListTest.java b/store/src/java-test/com/zimbra/cs/service/mail/GetContactBackupListTest.java index 3847c213b03..3bbaa8ca84d 100644 --- a/store/src/java-test/com/zimbra/cs/service/mail/GetContactBackupListTest.java +++ b/store/src/java-test/com/zimbra/cs/service/mail/GetContactBackupListTest.java @@ -15,6 +15,7 @@ */ package com.zimbra.cs.service.mail; +import java.io.ByteArrayInputStream; import java.net.URL; import java.util.HashMap; import java.util.Map; @@ -25,12 +26,18 @@ import com.google.common.collect.Maps; import com.zimbra.common.account.Key; +import com.zimbra.common.mime.MimeConstants; import com.zimbra.common.soap.Element; import com.zimbra.common.soap.MailConstants; import com.zimbra.common.soap.SoapProtocol; import com.zimbra.cs.account.Account; import com.zimbra.cs.account.Provisioning; +import com.zimbra.cs.mailbox.Folder; +import com.zimbra.cs.mailbox.MailItem; +import com.zimbra.cs.mailbox.Mailbox; +import com.zimbra.cs.mailbox.MailboxManager; import com.zimbra.cs.mailbox.MailboxTestUtil; +import com.zimbra.cs.mailbox.OperationContext; import com.zimbra.cs.service.AuthProvider; import com.zimbra.cs.service.MockHttpServletRequest; import com.zimbra.soap.MockSoapEngine; @@ -57,16 +64,24 @@ public void setUp() throws Exception { @Test public void testGetContactBackupListXML() throws Exception { Account acct = Provisioning.getInstance().get(Key.AccountBy.name, "test@zimbra.com"); - + Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(acct); + Folder folder = mbox.createFolder(null, "Briefcase/ContactsBackup", + new Folder.FolderOptions().setDefaultView(MailItem.Type.DOCUMENT)); + OperationContext octxt = new OperationContext(acct); + // Upload the contacts backup file to ContactsBackup folder in briefcase + mbox.createDocument(octxt, folder.getId(), "backup_dummy_test1.tgz", + MimeConstants.CT_APPLICATION_ZIMBRA_DOC, "author", "description", + new ByteArrayInputStream("dummy data".getBytes())); + mbox.createDocument(octxt, folder.getId(), "backup_dummy_test2.tgz", + MimeConstants.CT_APPLICATION_ZIMBRA_DOC, "author", "description", + new ByteArrayInputStream("dummy data".getBytes())); Element request = new Element.XMLElement(MailConstants.E_GET_CONTACT_BACKUP_LIST_REQUEST); Element response = new GetContactBackupList().handle(request, ServiceTestUtil.getRequestContext(acct)); String expectedResponse = "\n" + " \n" - + " file1.tgz\n" - + " file2.tgz\n" - + " file3.tgz\n" - + " file4.tgz\n" + + " backup_dummy_test1.tgz\n" + + " backup_dummy_test2.tgz\n" + " \n" + ""; @@ -76,30 +91,31 @@ public void testGetContactBackupListXML() throws Exception { @Test public void testGetContactBackupListJSON() throws Exception { Account acct = Provisioning.getInstance().get(Key.AccountBy.name, "test@zimbra.com"); - + Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(acct); + Folder folder = mbox.createFolder(null, "Briefcase/ContactsBackup", + new Folder.FolderOptions().setDefaultView(MailItem.Type.DOCUMENT)); + OperationContext octxt = new OperationContext(acct); + // Upload the contacts backup file to ContactsBackup folder in briefcase + mbox.createDocument(octxt, folder.getId(), "backup_dummy_test1.tgz", + MimeConstants.CT_APPLICATION_ZIMBRA_DOC, "author", "description", + new ByteArrayInputStream("dummy data".getBytes())); + mbox.createDocument(octxt, folder.getId(), "backup_dummy_test2.tgz", + MimeConstants.CT_APPLICATION_ZIMBRA_DOC, "author", "description", + new ByteArrayInputStream("dummy data".getBytes())); + Element request = new Element.JSONElement(MailConstants.E_GET_CONTACT_BACKUP_LIST_REQUEST); Map context = new HashMap(); context.put(SoapEngine.ZIMBRA_CONTEXT, new ZimbraSoapContext(AuthProvider.getAuthToken(acct), acct.getId(), SoapProtocol.Soap12, SoapProtocol.SoapJS)); context.put(SoapServlet.SERVLET_REQUEST, new MockHttpServletRequest("test".getBytes("UTF-8"), new URL("http://localhost:7070/service/FooRequest"), "")); context.put(SoapEngine.ZIMBRA_ENGINE, new MockSoapEngine(new MailService())); - - - Element request = new Element.JSONElement(MailConstants.E_GET_CONTACT_BACKUP_LIST_REQUEST); Element response = new GetContactBackupList().handle(request, context); - String expectedResponse = "{\n" + " \"backups\": [{\n" + " \"backup\": [\n" + " {\n" - + " \"_content\": \"file1.tgz\"\n" - + " },\n" - + " {\n" - + " \"_content\": \"file2.tgz\"\n" - + " },\n" - + " {\n" - + " \"_content\": \"file3.tgz\"\n" + + " \"_content\": \"backup_dummy_test1.tgz\"\n" + " },\n" + " {\n" - + " \"_content\": \"file4.tgz\"\n" + + " \"_content\": \"backup_dummy_test2.tgz\"\n" + " }]\n" + " }],\n" + " \"_jsns\": \"urn:zimbraMail\"\n" diff --git a/store/src/java-test/com/zimbra/cs/service/mail/RestoreContactsTest.java b/store/src/java-test/com/zimbra/cs/service/mail/RestoreContactsTest.java deleted file mode 100644 index 0c73c2b0727..00000000000 --- a/store/src/java-test/com/zimbra/cs/service/mail/RestoreContactsTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * ***** BEGIN LICENSE BLOCK ***** - * Zimbra Collaboration Suite Server - * Copyright (C) 2017 Synacor, Inc. - * - * This program is free software: you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software Foundation, - * version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * You should have received a copy of the GNU General Public License along with this program. - * If not, see . - * ***** END LICENSE BLOCK ***** - */ -package com.zimbra.cs.service.mail; - -import java.io.ByteArrayInputStream; -import java.util.Map; - -import org.apache.http.StatusLine; -import org.apache.http.HttpResponse; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mockito; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - -import com.google.common.collect.Maps; -import com.zimbra.common.account.Key; -import com.zimbra.common.mime.MimeConstants; -import com.zimbra.common.service.ServiceException; -import com.zimbra.common.soap.Element; -import com.zimbra.common.soap.MailConstants; -import com.zimbra.cs.account.Account; -import com.zimbra.cs.account.Provisioning; -import com.zimbra.cs.mailbox.Folder; -import com.zimbra.cs.mailbox.MailItem; -import com.zimbra.cs.mailbox.Mailbox; -import com.zimbra.cs.mailbox.MailboxManager; -import com.zimbra.cs.mailbox.MailboxTestUtil; -import com.zimbra.cs.mailbox.OperationContext; -import com.zimbra.cs.store.file.FileBlobStore; - -@RunWith(PowerMockRunner.class) -@PrepareForTest({ RestoreContacts.class, HttpResponse.class, StatusLine.class, - FileBlobStore.class }) -@PowerMockIgnore({ "javax.crypto.*", "javax.xml.bind.annotation.*" }) -public class RestoreContactsTest { - - private Account acct = null; - - @BeforeClass - public static void init() throws Exception { - MailboxTestUtil.initServer(); - Provisioning prov = Provisioning.getInstance(); - - Map attrs = Maps.newHashMap(); - prov.createAccount("test@zimbra.com", "secret", attrs); - } - - @Before - public void setUp() throws Exception { - MailboxTestUtil.clearData(); - acct = Provisioning.getInstance().get(Key.AccountBy.name, "test@zimbra.com"); - } - - @Test - public void testRestore() throws Exception { - Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(acct); - Folder folder = mbox.createFolder(null, "Briefcase/ContactsBackup", - new Folder.FolderOptions().setDefaultView(MailItem.Type.DOCUMENT)); - OperationContext octxt = new OperationContext(acct); - // Upload the contacts backup file to ContactsBackup folder in briefcase - mbox.createDocument(octxt, folder.getId(), "backup_dummy_test.tgz", - MimeConstants.CT_APPLICATION_ZIMBRA_DOC, "author", "description", - new ByteArrayInputStream("dummy data".getBytes())); - HttpResponse httpResponse = PowerMockito.mock(HttpResponse.class); - StatusLine httpStatusLine = PowerMockito.mock(StatusLine.class); - Mockito.when(httpStatusLine.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getStatusLine()).thenReturn(httpStatusLine); - PowerMockito.stub(PowerMockito.method(RestoreContacts.class, "httpPostBackup")) - .toReturn(httpResponse); - PowerMockito.stub(PowerMockito.method(FileBlobStore.class, "getBlobPath", Mailbox.class, - int.class, int.class, short.class)).toReturn("/"); - // RestoreContactRequest with valid backup file name - Element request = new Element.XMLElement(MailConstants.RESTORE_CONTACTS_REQUEST); - request.addAttribute("contactsBackupFileName", "backup_dummy_test.tgz"); - Map context = ServiceTestUtil.getRequestContext(acct); - Element response = new RestoreContacts().handle(request, context); - String expectedResponse = ""; - Assert.assertEquals(expectedResponse, response.prettyPrint()); - try { - // RestoreContactRequest with non-existing backup file name - Element request2 = new Element.XMLElement(MailConstants.RESTORE_CONTACTS_REQUEST); - request2.addAttribute("contactsBackupFileName", "backup_dummy_test_non_existing.tgz"); - new RestoreContacts().handle(request2, context); - Assert.fail("ServiceException was expected"); - } catch (ServiceException e) { - Assert.assertEquals("invalid request: No such file: backup_dummy_test_non_existing.tgz", - e.getMessage()); - Assert.assertEquals("service.INVALID_REQUEST", e.getCode()); - - } - } -} diff --git a/store/src/java-test/com/zimbra/cs/service/mail/SearchActionTest.java b/store/src/java-test/com/zimbra/cs/service/mail/SearchActionTest.java new file mode 100644 index 00000000000..3599b1f0216 --- /dev/null +++ b/store/src/java-test/com/zimbra/cs/service/mail/SearchActionTest.java @@ -0,0 +1,99 @@ +/* + * ***** BEGIN LICENSE BLOCK ***** + * Zimbra Collaboration Suite Server + * Copyright (C) 2017 Synacor, Inc. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software Foundation, + * version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with this program. + * If not, see . + * ***** END LICENSE BLOCK ***** + */ +package com.zimbra.cs.service.mail; + +import java.util.List; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.google.common.collect.Maps; +import com.zimbra.common.soap.Element; +import com.zimbra.cs.account.Account; +import com.zimbra.cs.account.MockProvisioning; +import com.zimbra.cs.account.Provisioning; +import com.zimbra.cs.mailbox.DeliveryOptions; +import com.zimbra.cs.mailbox.Flag; +import com.zimbra.cs.mailbox.MailItem; +import com.zimbra.cs.mailbox.Mailbox; +import com.zimbra.cs.mailbox.MailboxManager; +import com.zimbra.cs.mailbox.MailboxTestUtil; +import com.zimbra.cs.mailbox.util.TypedIdList; +import com.zimbra.soap.SoapEngine; +import com.zimbra.soap.ZimbraSoapContext; +import com.zimbra.soap.mail.message.SearchRequest; +import com.zimbra.soap.mail.type.BulkAction; +import com.zimbra.soap.type.SearchHit; + +public class SearchActionTest { + + @BeforeClass + public static void init() throws Exception { + MailboxTestUtil.initServer(); + + Provisioning prov = Provisioning.getInstance(); + prov.createAccount("test@zimbra.com", "secret", Maps. newHashMap()); + } + + @Before + public void setUp() throws Exception { + MailboxTestUtil.clearData(); + } + + @Test + public void testSearchAction() throws Exception { + Account acct = Provisioning.getInstance() + .getAccountById(MockProvisioning.DEFAULT_ACCOUNT_ID); + Mailbox mbox = MailboxManager.getInstance().getMailboxByAccount(acct); + // Add two messages to inbox, one with search match and other with no + // match + DeliveryOptions dopt = new DeliveryOptions().setFolderId(Mailbox.ID_FOLDER_INBOX) + .setFlags(Flag.BITMASK_UNREAD | Flag.BITMASK_MUTED); + mbox.addMessage(null, MailboxTestUtil.generateMessage("test subject"), dopt, null); + mbox.addMessage(null, MailboxTestUtil.generateMessage("unmatched subject"), dopt, null); + TypedIdList ids = mbox.getItemIds(null, 2); + Assert.assertEquals(2, ids.size()); + SearchRequest sRequest = new SearchRequest(); + sRequest.setSearchTypes("conversation"); + // search with query 'test' + sRequest.setQuery("test"); + BulkAction bAction = new BulkAction(); + // search action - move search result to 'Trash' + bAction.setOp(BulkAction.Operation.move); + bAction.setFolder("Trash"); + Map context = ServiceTestUtil.getRequestContext(acct); + ZimbraSoapContext zsc = (ZimbraSoapContext) context.get(SoapEngine.ZIMBRA_CONTEXT); + Element searchResponse = new Search().handle(zsc.jaxbToElement(sRequest), + ServiceTestUtil.getRequestContext(acct)); + com.zimbra.soap.mail.message.SearchResponse sResponse = zsc.elementToJaxb(searchResponse); + List searchHits = sResponse.getSearchHits(); + SearchAction.performAction(bAction, sRequest, searchHits, mbox, null); + // check inbox contains only 1 unmatched mail item after move + List mailItems = mbox.getItemList(null, MailItem.Type.MESSAGE, 2, + com.zimbra.cs.index.SortBy.DATE_DESC); + Assert.assertEquals(1, mailItems.size()); + Assert.assertEquals("unmatched subject", mailItems.get(0).getSubject()); + // check trash contains mail item having 'test subject' after move + mailItems = mbox.getItemList(null, MailItem.Type.MESSAGE, 3, + com.zimbra.cs.index.SortBy.DATE_DESC); + Assert.assertEquals(1, mailItems.size()); + Assert.assertEquals("test subject", mailItems.get(0).getSubject()); + } +} diff --git a/store/src/java-test/com/zimbra/cs/store/MockStoreManager.java b/store/src/java-test/com/zimbra/cs/store/MockStoreManager.java index 0a1e144afd3..b31c17f1d91 100644 --- a/store/src/java-test/com/zimbra/cs/store/MockStoreManager.java +++ b/store/src/java-test/com/zimbra/cs/store/MockStoreManager.java @@ -196,6 +196,16 @@ private static final class MockBlob extends Blob { content = new byte[0]; } + @Override + public void copy(Blob blob) throws IOException { + super.copy(blob); + if (blob instanceof MockBlob) { + setContent(((MockBlob)blob).getContent()); + } else { + setContent(null); + } + } + void setContent(byte[] content) { this.content = content; } @@ -214,6 +224,15 @@ public InputStream getInputStream() throws IOException { public long getRawSize() { return content.length; } + + @Override + public boolean isCompressed() throws IOException { + return false; + } + + public byte[] getContent() { + return content; + } } private static final class MockLocalBlob extends Blob { diff --git a/store/src/java-test/com/zimbra/cs/util/ZTestWatchman.java b/store/src/java-test/com/zimbra/cs/util/ZTestWatchman.java new file mode 100644 index 00000000000..cafe24304af --- /dev/null +++ b/store/src/java-test/com/zimbra/cs/util/ZTestWatchman.java @@ -0,0 +1,35 @@ +/* + * ***** BEGIN LICENSE BLOCK ***** + * Zimbra Collaboration Suite Server + * Copyright (C) 2017 Synacor, Inc. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software Foundation, + * version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with this program. + * If not, see . + * ***** END LICENSE BLOCK ***** + */ +package com.zimbra.cs.util; + +import org.junit.rules.TestWatchman; +import org.junit.runners.model.FrameworkMethod; + +/** + * @author zimbra + * + */ +public class ZTestWatchman extends TestWatchman{ + + @Override + public void failed(Throwable e, FrameworkMethod method) { + System.out.println(method.getName() + " " + e.getClass().getSimpleName() + " " + e.getMessage()); + e.printStackTrace(); + } + + +} diff --git a/store/src/java/com/zimbra/cs/account/Account.java b/store/src/java/com/zimbra/cs/account/Account.java index 190fe4f3d3c..b1fc13f8036 100644 --- a/store/src/java/com/zimbra/cs/account/Account.java +++ b/store/src/java/com/zimbra/cs/account/Account.java @@ -515,5 +515,16 @@ public static String encrypytUCPassword(String acctId, String plainPassword) public void cleanExpiredTokens() throws ServiceException { purgeAuthTokens(); } -} + /** + * Updates the values of the following attributes: + * - userPassword + * - zimbraAuthTokens + * - zimbraAuthTokenValidityValue + * + * @throws ServiceException + */ + public void refreshUserCredentials() throws ServiceException { + getProvisioning().refreshUserCredentials(this); + } +} diff --git a/store/src/java/com/zimbra/cs/account/AttributeManagerUtil.java b/store/src/java/com/zimbra/cs/account/AttributeManagerUtil.java index c6f147936d0..29c247929b2 100644 --- a/store/src/java/com/zimbra/cs/account/AttributeManagerUtil.java +++ b/store/src/java/com/zimbra/cs/account/AttributeManagerUtil.java @@ -1255,7 +1255,7 @@ public static void generateSetter(StringBuilder result, AttributeInfo ai, boolea switch (type) { case TYPE_BOOLEAN: javaType = "boolean"; - putParam = String.format("%s ? Provisioning.TRUE : Provisioning.FALSE", name); + putParam = String.format("%s ? TRUE : FALSE", name); break; case TYPE_BINARY: case TYPE_CERTIFICATE: diff --git a/store/src/java/com/zimbra/cs/account/Provisioning.java b/store/src/java/com/zimbra/cs/account/Provisioning.java index 0bd8e08be1f..2318a331695 100644 --- a/store/src/java/com/zimbra/cs/account/Provisioning.java +++ b/store/src/java/com/zimbra/cs/account/Provisioning.java @@ -76,12 +76,6 @@ */ public abstract class Provisioning extends ZAttrProvisioning { - - // The public versions of TRUE and FALSE were moved to ProvisioningConstants. - // These are used by ZAttr*. - static final String TRUE = "TRUE"; - static final String FALSE = "FALSE"; - public static final String DEFAULT_COS_NAME = "default"; public static final String DEFAULT_EXTERNAL_COS_NAME = "defaultExternal"; @@ -242,6 +236,63 @@ public static enum CacheMode { OFF } + /** + * return regular accounts from searchAccounts/searchDirectory; + * calendar resource accounts are excluded + */ + public static final int SD_ACCOUNT_FLAG = 0x1; + + /** return aliases from searchAccounts/searchDirectory */ + public static final int SD_ALIAS_FLAG = 0x2; + + /** return distribution lists from searchAccounts/searchDirectory */ + public static final int SD_DISTRIBUTION_LIST_FLAG = 0x4; + + /** return calendar resource accounts from searchAccounts/searchDirectory */ + public static final int SD_CALENDAR_RESOURCE_FLAG = 0x8; + + /** return domains from searchAccounts/searchDirectory. only valid with Provisioning.searchAccounts. */ + public static final int SD_DOMAIN_FLAG = 0x10; + + /** return coses from searchDirectory */ + public static final int SD_COS_FLAG = 0x20; + + public static final int SD_SERVER_FLAG = 0x40; + + public static final int SD_UC_SERVICE_FLAG = 0x80; + + /** return coses from searchDirectory */ + public static final int SD_DYNAMIC_GROUP_FLAG = 0x100; + + /** do not fixup objectclass in query for searchObject, only used from LdapUpgrade */ + public static final int SO_NO_FIXUP_OBJECTCLASS = 0x200; + + /** do not fixup return attrs for searchObject, onlt used from LdapUpgrade */ + public static final int SO_NO_FIXUP_RETURNATTRS = 0x400; + + /** + * do not set account defaults in makeAccount + * + * bug 36017, 41533 + * + * only used from the admin SearchDirectory and GetQuotaUsage SOAPs, where large number of accounts are + * returned from Provisioning.searchDirectory. In the extreme case where the accounts + * span many different domains, the admin console UI/zmprov would seem to be be unresponsive. + * + * Domain is needed for: + * - determine the cos if cos is not set on the account + * - account secondary default + * + * Caller is responsible for setting the defaults when it needs them. + */ + public static final int SO_NO_ACCOUNT_DEFAULTS = 0x200; // do not set defaults and secondary defaults in makeAccount + public static final int SO_NO_ACCOUNT_SECONDARY_DEFAULTS = 0x400; // do not set secondary defaults in makeAccount + public static final String SERVICE_WEBCLIENT = "zimbra"; + public static final String SERVICE_ADMINCLIENT = "zimbraAdmin"; + public static final String SERVICE_ZIMLET = "zimlet"; + public static final String SERVICE_MAILCLIENT = "service"; + public static final String SERVICE_IMAP = "imapd"; + public static Provisioning getInstance() { return getInstance(CacheMode.DEFAULT); } @@ -257,7 +308,8 @@ public static Provisioning getInstance() { * @param useCache * @return */ - public static Provisioning getInstance(CacheMode cacheMode) { + public static Provisioning getInstance(CacheMode origCacheMode) { + CacheMode cacheMode = origCacheMode; if (singleton == null) { synchronized (Provisioning.class) { if (singleton == null) { @@ -309,6 +361,15 @@ public synchronized static void setInstance(Provisioning prov) { singleton = prov; } + /** + * Updates the values of the following attributes in the provided account argument: + * - userPassword + * - zimbraAuthTokens + * - zimbraAuthTokenValidityValue + * @param account Account instance who's credentials are to be refreshed + */ + public abstract void refreshUserCredentials(Account account) throws ServiceException; + public boolean idIsUUID() { return true; } @@ -549,14 +610,12 @@ public String getEmailAddrByDomainAlias(String emailAddress) throws ServiceExcep String parts[] = emailAddress.split("@"); if (parts.length == 2) { Domain domain = getDomain(Key.DomainBy.name, parts[1], true); - if (domain != null) { - if (!domain.isLocal()) { - String targetDomainId = domain.getAttr(A_zimbraDomainAliasTargetId); - if (targetDomainId != null) { - domain = getDomainById(targetDomainId); - if (domain != null) { - addr = parts[0] + "@" + domain.getName(); - } + if ((domain != null) && (!domain.isLocal())) { + String targetDomainId = domain.getAttr(A_zimbraDomainAliasTargetId); + if (targetDomainId != null) { + domain = getDomainById(targetDomainId); + if (domain != null) { + addr = parts[0] + "@" + domain.getName(); } } } @@ -746,8 +805,8 @@ public String toString() { * */ public static class GroupMembershipAtTime { - final GroupMembership membership; - final long correctAtTime; + private final GroupMembership membership; + private final long correctAtTime; public GroupMembershipAtTime(GroupMembership members, long accurateAtTime) { membership = members; correctAtTime = accurateAtTime; @@ -761,8 +820,8 @@ public long getCorrectAtTime() { } public static class GroupMembership { - List mMemberOf; // list of MemberOf - List mGroupIds; // list of group ids + private final List mMemberOf; // list of MemberOf + private final List mGroupIds; // list of group ids public GroupMembership(List memberOf, List groupIds) { mMemberOf = memberOf; @@ -1164,63 +1223,6 @@ public Account getAccount(String key) throws ServiceException { return acct; } - /** - * return regular accounts from searchAccounts/searchDirectory; - * calendar resource accounts are excluded - */ - public static final int SD_ACCOUNT_FLAG = 0x1; - - /** return aliases from searchAccounts/searchDirectory */ - public static final int SD_ALIAS_FLAG = 0x2; - - /** return distribution lists from searchAccounts/searchDirectory */ - public static final int SD_DISTRIBUTION_LIST_FLAG = 0x4; - - /** return calendar resource accounts from searchAccounts/searchDirectory */ - public static final int SD_CALENDAR_RESOURCE_FLAG = 0x8; - - /** return domains from searchAccounts/searchDirectory. only valid with Provisioning.searchAccounts. */ - public static final int SD_DOMAIN_FLAG = 0x10; - - /** return coses from searchDirectory */ - public static final int SD_COS_FLAG = 0x20; - - public static final int SD_SERVER_FLAG = 0x40; - - public static final int SD_UC_SERVICE_FLAG = 0x80; - - /** return coses from searchDirectory */ - public static final int SD_DYNAMIC_GROUP_FLAG = 0x100; - - /** do not fixup objectclass in query for searchObject, only used from LdapUpgrade */ - public static final int SO_NO_FIXUP_OBJECTCLASS = 0x200; - - /** do not fixup return attrs for searchObject, onlt used from LdapUpgrade */ - public static final int SO_NO_FIXUP_RETURNATTRS = 0x400; - - /** - * do not set account defaults in makeAccount - * - * bug 36017, 41533 - * - * only used from the admin SearchDirectory and GetQuotaUsage SOAPs, where large number of accounts are - * returned from Provisioning.searchDirectory. In the extreme case where the accounts - * span many different domains, the admin console UI/zmprov would seem to be be unresponsive. - * - * Domain is needed for: - * - determine the cos if cos is not set on the account - * - account secondary default - * - * Caller is responsible for setting the defaults when it needs them. - */ - public static final int SO_NO_ACCOUNT_DEFAULTS = 0x200; // do not set defaults and secondary defaults in makeAccount - public static final int SO_NO_ACCOUNT_SECONDARY_DEFAULTS = 0x400; // do not set secondary defaults in makeAccount - public static final String SERVICE_WEBCLIENT = "zimbra"; - public static final String SERVICE_ADMINCLIENT = "zimbraAdmin"; - public static final String SERVICE_ZIMLET = "zimlet"; - public static final String SERVICE_MAILCLIENT = "service"; - public static final String SERVICE_IMAP = "imapd"; - public abstract List getAllAdminAccounts() throws ServiceException; public abstract void setCOS(Account acct, Cos cos) throws ServiceException; @@ -1265,7 +1267,7 @@ public abstract void ssoAuthAccount(Account acct, AuthContext.Protocol proto, Ma public abstract void changePassword(Account acct, String currentPassword, String newPassword) throws ServiceException; public static class SetPasswordResult { - String msg; + private String msg; public SetPasswordResult() { } @@ -1470,7 +1472,7 @@ public void getAllDomains(NamedEntry.Visitor visitor, String[] retAttrs) throws public abstract Server getLocalServerIfDefined(); public static final class Reasons { - StringBuilder sb = new StringBuilder(); + private final StringBuilder sb = new StringBuilder(); public void addReason(String reason) { if (0 < sb.length()) { sb.append('\n'); @@ -1515,35 +1517,44 @@ public static boolean canUseLocalIMAP(Account account) throws ServiceException { } public static List getPreferredIMAPServers(Account account) throws ServiceException { - Provisioning prov = getInstance(); - Server homeServer = account.getServer(); - if(homeServer == null) { + if (homeServer == null) { return Collections.emptyList(); } - String[] upstreamIMAPServers = homeServer.getReverseProxyUpstreamImapServers(); - List imapServers = new ArrayList(); - if(upstreamIMAPServers != null && upstreamIMAPServers.length > 0) { - for (String server: upstreamIMAPServers) { - imapServers.add(prov.getServerByServiceHostname(server)); - } - } else { - imapServers.add(prov.getServerByServiceHostname(account.getMailHost())); + List imapDaemonServers = getIMAPDaemonServers(homeServer); + if (!imapDaemonServers.isEmpty()) { + return imapDaemonServers; } + return Lists.newArrayList(getInstance().getServerByServiceHostname(account.getMailHost())); + } - return imapServers; + public static List getIMAPDaemonServers(Account account) throws ServiceException { + Server homeServer = account.getServer(); + if (homeServer == null) { + return Collections.emptyList(); + } + return getIMAPDaemonServers(homeServer); } - public static List getIMAPDaemonServersForLocalServer() throws ServiceException { + public static List getIMAPDaemonServers(Server server) throws ServiceException { + String[] upstreamIMAPServers = server.getReverseProxyUpstreamImapServers(); Provisioning prov = getInstance(); - String[] servers = prov.getLocalServer().getReverseProxyUpstreamImapServers(); - List imapServers = new ArrayList(); - for (String server: servers) { - imapServers.add(prov.getServerByServiceHostname(server)); + List imapServers = new ArrayList<>(upstreamIMAPServers.length); + for (String serverName : upstreamIMAPServers) { + Server svr = prov.getServerByServiceHostname(serverName); + if (svr == null) { + ZimbraLog.imap.warn("cannot find imap server by service hostname for '%s'", serverName); + continue; + } + imapServers.add(svr); } return imapServers; } + public static List getIMAPDaemonServersForLocalServer() throws ServiceException { + return getIMAPDaemonServers(getInstance().getLocalServer()); + } + private static boolean isAlwaysOn(Account account) throws ServiceException { return isAlwaysOn(account, null); } @@ -2072,6 +2083,19 @@ public static class SearchGalResult { private String ldapTimeStamp = ""; private String maxLdapTimeStamp = ""; + private int ldapMatchCount = 0; + private int limit = 0; + + /* + * for auto-complete and search only + * + * The Ajax client backtracks on GAL results assuming the results of a more + * specific key is the subset of a more generic key, and it checks cached + * results instead of issuing another SOAP request to the server. + * If search key was tokenized with AND or OR, this cannot be assumed. + */ + private String mTokenizeKey; + public String getMaxLdapTimeStamp() { return maxLdapTimeStamp; } @@ -2080,9 +2104,6 @@ public void setMaxLdapTimeStamp(String maxLdapTimeStamp) { this.maxLdapTimeStamp = maxLdapTimeStamp; } - private int ldapMatchCount = 0; - private int limit = 0; - public int getLimit() { return limit; } @@ -2091,16 +2112,6 @@ public void setLimit(int limit) { this.limit = limit; } - /* - * for auto-complete and search only - * - * The Ajax client backtracks on GAL results assuming the results of a more - * specific key is the subset of a more generic key, and it checks cached - * results instead of issuing another SOAP request to the server. - * If search key was tokenized with AND or OR, this cannot be assumed. - */ - private String mTokenizeKey; - public static SearchGalResult newSearchGalResult(GalContact.Visitor visitor) { if (visitor == null) return new SearchGalResult(); @@ -2343,9 +2354,9 @@ public Identity getDefaultIdentity(Account account) throws ServiceException { public abstract void deleteXMPPComponent(XMPPComponent comp) throws ServiceException; public static class RightsDoc { - String mCmd; - List mRights; - List mNotes; + private final String mCmd; + private final List mRights; + private final List mNotes; public RightsDoc(String cmd) { mCmd = cmd; @@ -2456,14 +2467,13 @@ public ShareLocator createShareLocator(String id, String ownerAccountId) throws return createShareLocator(id, attrs); } - public static class CacheEntry { + public Key.CacheEntryBy mEntryBy; + public String mEntryIdentity; public CacheEntry(Key.CacheEntryBy entryBy, String entryIdentity) { mEntryBy = entryBy; mEntryIdentity = entryIdentity; } - public Key.CacheEntryBy mEntryBy; - public String mEntryIdentity; } /** @@ -2476,7 +2486,12 @@ public CacheEntry(Key.CacheEntryBy entryBy, String entryIdentity) { public abstract void flushCache(CacheEntryType type, CacheEntry[] entries) throws ServiceException; public static class CountAccountResult { + private final List mCountAccountByCos = new ArrayList(); + public static class CountAccountByCos { + private final String mCosId; + private final String mCosName; + private final long mCount; CountAccountByCos(String cosId, String cosName, long count) { mCosId = cosId; @@ -2484,17 +2499,11 @@ public static class CountAccountByCos { mCount = count; } - private final String mCosId; - private final String mCosName; - private final long mCount; - public String getCosId() { return mCosId;} public String getCosName() { return mCosName; } public long getCount() { return mCount; } } - private final List mCountAccountByCos = new ArrayList(); - public void addCountAccountByCosResult(String cosId, String cosName, long count) { CountAccountByCos r = new CountAccountByCos(cosId, cosName, count); mCountAccountByCos.add(r); @@ -2595,9 +2604,9 @@ public static interface ProvisioningValidator { } public static class Result { - String code; - String message; - String detail; + private final String code; + private final String message; + private final String detail; public String getCode() { return code; } public String getMessage() { return message; } diff --git a/store/src/java/com/zimbra/cs/account/ZAttrAccount.java b/store/src/java/com/zimbra/cs/account/ZAttrAccount.java index 10de72146b1..b4e62ed58c3 100644 --- a/store/src/java/com/zimbra/cs/account/ZAttrAccount.java +++ b/store/src/java/com/zimbra/cs/account/ZAttrAccount.java @@ -16,6 +16,9 @@ */ package com.zimbra.cs.account; +import static com.zimbra.common.account.ProvisioningConstants.FALSE; +import static com.zimbra.common.account.ProvisioningConstants.TRUE; + import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -3574,7 +3577,7 @@ public boolean isAllowAnyFromAddress() { @ZAttr(id=427) public void setAllowAnyFromAddress(boolean zimbraAllowAnyFromAddress) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraAllowAnyFromAddress, zimbraAllowAnyFromAddress ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraAllowAnyFromAddress, zimbraAllowAnyFromAddress ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -3589,7 +3592,7 @@ public void setAllowAnyFromAddress(boolean zimbraAllowAnyFromAddress) throws com @ZAttr(id=427) public Map setAllowAnyFromAddress(boolean zimbraAllowAnyFromAddress, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraAllowAnyFromAddress, zimbraAllowAnyFromAddress ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraAllowAnyFromAddress, zimbraAllowAnyFromAddress ? TRUE : FALSE); return attrs; } @@ -4315,7 +4318,7 @@ public boolean isArchiveEnabled() { @ZAttr(id=1206) public void setArchiveEnabled(boolean zimbraArchiveEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraArchiveEnabled, zimbraArchiveEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraArchiveEnabled, zimbraArchiveEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -4331,7 +4334,7 @@ public void setArchiveEnabled(boolean zimbraArchiveEnabled) throws com.zimbra.co @ZAttr(id=1206) public Map setArchiveEnabled(boolean zimbraArchiveEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraArchiveEnabled, zimbraArchiveEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraArchiveEnabled, zimbraArchiveEnabled ? TRUE : FALSE); return attrs; } @@ -4383,7 +4386,7 @@ public boolean isAttachmentsBlocked() { @ZAttr(id=115) public void setAttachmentsBlocked(boolean zimbraAttachmentsBlocked) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraAttachmentsBlocked, zimbraAttachmentsBlocked ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraAttachmentsBlocked, zimbraAttachmentsBlocked ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -4397,7 +4400,7 @@ public void setAttachmentsBlocked(boolean zimbraAttachmentsBlocked) throws com.z @ZAttr(id=115) public Map setAttachmentsBlocked(boolean zimbraAttachmentsBlocked, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraAttachmentsBlocked, zimbraAttachmentsBlocked ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraAttachmentsBlocked, zimbraAttachmentsBlocked ? TRUE : FALSE); return attrs; } @@ -4445,7 +4448,7 @@ public boolean isAttachmentsIndexingEnabled() { @ZAttr(id=173) public void setAttachmentsIndexingEnabled(boolean zimbraAttachmentsIndexingEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraAttachmentsIndexingEnabled, zimbraAttachmentsIndexingEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraAttachmentsIndexingEnabled, zimbraAttachmentsIndexingEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -4459,7 +4462,7 @@ public void setAttachmentsIndexingEnabled(boolean zimbraAttachmentsIndexingEnabl @ZAttr(id=173) public Map setAttachmentsIndexingEnabled(boolean zimbraAttachmentsIndexingEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraAttachmentsIndexingEnabled, zimbraAttachmentsIndexingEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraAttachmentsIndexingEnabled, zimbraAttachmentsIndexingEnabled ? TRUE : FALSE); return attrs; } @@ -4507,7 +4510,7 @@ public boolean isAttachmentsViewInHtmlOnly() { @ZAttr(id=116) public void setAttachmentsViewInHtmlOnly(boolean zimbraAttachmentsViewInHtmlOnly) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraAttachmentsViewInHtmlOnly, zimbraAttachmentsViewInHtmlOnly ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraAttachmentsViewInHtmlOnly, zimbraAttachmentsViewInHtmlOnly ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -4521,7 +4524,7 @@ public void setAttachmentsViewInHtmlOnly(boolean zimbraAttachmentsViewInHtmlOnly @ZAttr(id=116) public Map setAttachmentsViewInHtmlOnly(boolean zimbraAttachmentsViewInHtmlOnly, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraAttachmentsViewInHtmlOnly, zimbraAttachmentsViewInHtmlOnly ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraAttachmentsViewInHtmlOnly, zimbraAttachmentsViewInHtmlOnly ? TRUE : FALSE); return attrs; } @@ -4887,7 +4890,7 @@ public boolean isAvailabilityServiceProvider() { @ZAttr(id=2072) public void setAvailabilityServiceProvider(boolean zimbraAvailabilityServiceProvider) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraAvailabilityServiceProvider, zimbraAvailabilityServiceProvider ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraAvailabilityServiceProvider, zimbraAvailabilityServiceProvider ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -4904,7 +4907,7 @@ public void setAvailabilityServiceProvider(boolean zimbraAvailabilityServiceProv @ZAttr(id=2072) public Map setAvailabilityServiceProvider(boolean zimbraAvailabilityServiceProvider, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraAvailabilityServiceProvider, zimbraAvailabilityServiceProvider ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraAvailabilityServiceProvider, zimbraAvailabilityServiceProvider ? TRUE : FALSE); return attrs; } @@ -5708,7 +5711,7 @@ public boolean isCalendarKeepExceptionsOnSeriesTimeChange() { @ZAttr(id=1240) public void setCalendarKeepExceptionsOnSeriesTimeChange(boolean zimbraCalendarKeepExceptionsOnSeriesTimeChange) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraCalendarKeepExceptionsOnSeriesTimeChange, zimbraCalendarKeepExceptionsOnSeriesTimeChange ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraCalendarKeepExceptionsOnSeriesTimeChange, zimbraCalendarKeepExceptionsOnSeriesTimeChange ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -5725,7 +5728,7 @@ public void setCalendarKeepExceptionsOnSeriesTimeChange(boolean zimbraCalendarKe @ZAttr(id=1240) public Map setCalendarKeepExceptionsOnSeriesTimeChange(boolean zimbraCalendarKeepExceptionsOnSeriesTimeChange, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraCalendarKeepExceptionsOnSeriesTimeChange, zimbraCalendarKeepExceptionsOnSeriesTimeChange ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraCalendarKeepExceptionsOnSeriesTimeChange, zimbraCalendarKeepExceptionsOnSeriesTimeChange ? TRUE : FALSE); return attrs; } @@ -6009,7 +6012,7 @@ public boolean isCalendarResourceDoubleBookingAllowed() { @ZAttr(id=1087) public void setCalendarResourceDoubleBookingAllowed(boolean zimbraCalendarResourceDoubleBookingAllowed) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraCalendarResourceDoubleBookingAllowed, zimbraCalendarResourceDoubleBookingAllowed ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraCalendarResourceDoubleBookingAllowed, zimbraCalendarResourceDoubleBookingAllowed ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -6025,7 +6028,7 @@ public void setCalendarResourceDoubleBookingAllowed(boolean zimbraCalendarResour @ZAttr(id=1087) public Map setCalendarResourceDoubleBookingAllowed(boolean zimbraCalendarResourceDoubleBookingAllowed, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraCalendarResourceDoubleBookingAllowed, zimbraCalendarResourceDoubleBookingAllowed ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraCalendarResourceDoubleBookingAllowed, zimbraCalendarResourceDoubleBookingAllowed ? TRUE : FALSE); return attrs; } @@ -6083,7 +6086,7 @@ public boolean isCalendarShowResourceTabs() { @ZAttr(id=1092) public void setCalendarShowResourceTabs(boolean zimbraCalendarShowResourceTabs) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraCalendarShowResourceTabs, zimbraCalendarShowResourceTabs ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraCalendarShowResourceTabs, zimbraCalendarShowResourceTabs ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -6100,7 +6103,7 @@ public void setCalendarShowResourceTabs(boolean zimbraCalendarShowResourceTabs) @ZAttr(id=1092) public Map setCalendarShowResourceTabs(boolean zimbraCalendarShowResourceTabs, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraCalendarShowResourceTabs, zimbraCalendarShowResourceTabs ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraCalendarShowResourceTabs, zimbraCalendarShowResourceTabs ? TRUE : FALSE); return attrs; } @@ -6158,7 +6161,7 @@ public boolean isChatHistoryEnabled() { @ZAttr(id=2103) public void setChatHistoryEnabled(boolean zimbraChatHistoryEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraChatHistoryEnabled, zimbraChatHistoryEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraChatHistoryEnabled, zimbraChatHistoryEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -6174,7 +6177,7 @@ public void setChatHistoryEnabled(boolean zimbraChatHistoryEnabled) throws com.z @ZAttr(id=2103) public Map setChatHistoryEnabled(boolean zimbraChatHistoryEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraChatHistoryEnabled, zimbraChatHistoryEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraChatHistoryEnabled, zimbraChatHistoryEnabled ? TRUE : FALSE); return attrs; } @@ -8253,7 +8256,7 @@ public boolean isDataSourceImportOnLogin() { @ZAttr(id=1418) public void setDataSourceImportOnLogin(boolean zimbraDataSourceImportOnLogin) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDataSourceImportOnLogin, zimbraDataSourceImportOnLogin ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDataSourceImportOnLogin, zimbraDataSourceImportOnLogin ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -8270,7 +8273,7 @@ public void setDataSourceImportOnLogin(boolean zimbraDataSourceImportOnLogin) th @ZAttr(id=1418) public Map setDataSourceImportOnLogin(boolean zimbraDataSourceImportOnLogin, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDataSourceImportOnLogin, zimbraDataSourceImportOnLogin ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDataSourceImportOnLogin, zimbraDataSourceImportOnLogin ? TRUE : FALSE); return attrs; } @@ -9660,7 +9663,7 @@ public boolean isDeviceFileOpenWithEnabled() { @ZAttr(id=1400) public void setDeviceFileOpenWithEnabled(boolean zimbraDeviceFileOpenWithEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDeviceFileOpenWithEnabled, zimbraDeviceFileOpenWithEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDeviceFileOpenWithEnabled, zimbraDeviceFileOpenWithEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -9676,7 +9679,7 @@ public void setDeviceFileOpenWithEnabled(boolean zimbraDeviceFileOpenWithEnabled @ZAttr(id=1400) public Map setDeviceFileOpenWithEnabled(boolean zimbraDeviceFileOpenWithEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDeviceFileOpenWithEnabled, zimbraDeviceFileOpenWithEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDeviceFileOpenWithEnabled, zimbraDeviceFileOpenWithEnabled ? TRUE : FALSE); return attrs; } @@ -9732,7 +9735,7 @@ public boolean isDeviceLockWhenInactive() { @ZAttr(id=1399) public void setDeviceLockWhenInactive(boolean zimbraDeviceLockWhenInactive) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDeviceLockWhenInactive, zimbraDeviceLockWhenInactive ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDeviceLockWhenInactive, zimbraDeviceLockWhenInactive ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -9748,7 +9751,7 @@ public void setDeviceLockWhenInactive(boolean zimbraDeviceLockWhenInactive) thro @ZAttr(id=1399) public Map setDeviceLockWhenInactive(boolean zimbraDeviceLockWhenInactive, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDeviceLockWhenInactive, zimbraDeviceLockWhenInactive ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDeviceLockWhenInactive, zimbraDeviceLockWhenInactive ? TRUE : FALSE); return attrs; } @@ -9804,7 +9807,7 @@ public boolean isDeviceOfflineCacheEnabled() { @ZAttr(id=1412) public void setDeviceOfflineCacheEnabled(boolean zimbraDeviceOfflineCacheEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDeviceOfflineCacheEnabled, zimbraDeviceOfflineCacheEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDeviceOfflineCacheEnabled, zimbraDeviceOfflineCacheEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -9820,7 +9823,7 @@ public void setDeviceOfflineCacheEnabled(boolean zimbraDeviceOfflineCacheEnabled @ZAttr(id=1412) public Map setDeviceOfflineCacheEnabled(boolean zimbraDeviceOfflineCacheEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDeviceOfflineCacheEnabled, zimbraDeviceOfflineCacheEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDeviceOfflineCacheEnabled, zimbraDeviceOfflineCacheEnabled ? TRUE : FALSE); return attrs; } @@ -9876,7 +9879,7 @@ public boolean isDevicePasscodeEnabled() { @ZAttr(id=1396) public void setDevicePasscodeEnabled(boolean zimbraDevicePasscodeEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDevicePasscodeEnabled, zimbraDevicePasscodeEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDevicePasscodeEnabled, zimbraDevicePasscodeEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -9892,7 +9895,7 @@ public void setDevicePasscodeEnabled(boolean zimbraDevicePasscodeEnabled) throws @ZAttr(id=1396) public Map setDevicePasscodeEnabled(boolean zimbraDevicePasscodeEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDevicePasscodeEnabled, zimbraDevicePasscodeEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDevicePasscodeEnabled, zimbraDevicePasscodeEnabled ? TRUE : FALSE); return attrs; } @@ -10060,7 +10063,7 @@ public boolean isDisableCrossAccountConversationThreading() { @ZAttr(id=2048) public void setDisableCrossAccountConversationThreading(boolean zimbraDisableCrossAccountConversationThreading) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDisableCrossAccountConversationThreading, zimbraDisableCrossAccountConversationThreading ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDisableCrossAccountConversationThreading, zimbraDisableCrossAccountConversationThreading ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -10079,7 +10082,7 @@ public void setDisableCrossAccountConversationThreading(boolean zimbraDisableCro @ZAttr(id=2048) public Map setDisableCrossAccountConversationThreading(boolean zimbraDisableCrossAccountConversationThreading, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDisableCrossAccountConversationThreading, zimbraDisableCrossAccountConversationThreading ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDisableCrossAccountConversationThreading, zimbraDisableCrossAccountConversationThreading ? TRUE : FALSE); return attrs; } @@ -10203,7 +10206,7 @@ public boolean isDumpsterEnabled() { @ZAttr(id=1128) public void setDumpsterEnabled(boolean zimbraDumpsterEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDumpsterEnabled, zimbraDumpsterEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDumpsterEnabled, zimbraDumpsterEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -10219,7 +10222,7 @@ public void setDumpsterEnabled(boolean zimbraDumpsterEnabled) throws com.zimbra. @ZAttr(id=1128) public Map setDumpsterEnabled(boolean zimbraDumpsterEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDumpsterEnabled, zimbraDumpsterEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDumpsterEnabled, zimbraDumpsterEnabled ? TRUE : FALSE); return attrs; } @@ -10275,7 +10278,7 @@ public boolean isDumpsterPurgeEnabled() { @ZAttr(id=1315) public void setDumpsterPurgeEnabled(boolean zimbraDumpsterPurgeEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDumpsterPurgeEnabled, zimbraDumpsterPurgeEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDumpsterPurgeEnabled, zimbraDumpsterPurgeEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -10291,7 +10294,7 @@ public void setDumpsterPurgeEnabled(boolean zimbraDumpsterPurgeEnabled) throws c @ZAttr(id=1315) public Map setDumpsterPurgeEnabled(boolean zimbraDumpsterPurgeEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraDumpsterPurgeEnabled, zimbraDumpsterPurgeEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraDumpsterPurgeEnabled, zimbraDumpsterPurgeEnabled ? TRUE : FALSE); return attrs; } @@ -10455,7 +10458,7 @@ public boolean isExcludeFromCMBSearch() { @ZAttr(id=501) public void setExcludeFromCMBSearch(boolean zimbraExcludeFromCMBSearch) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraExcludeFromCMBSearch, zimbraExcludeFromCMBSearch ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraExcludeFromCMBSearch, zimbraExcludeFromCMBSearch ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -10469,7 +10472,7 @@ public void setExcludeFromCMBSearch(boolean zimbraExcludeFromCMBSearch) throws c @ZAttr(id=501) public Map setExcludeFromCMBSearch(boolean zimbraExcludeFromCMBSearch, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraExcludeFromCMBSearch, zimbraExcludeFromCMBSearch ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraExcludeFromCMBSearch, zimbraExcludeFromCMBSearch ? TRUE : FALSE); return attrs; } @@ -11635,7 +11638,7 @@ public boolean isExternalShareDomainWhitelistEnabled() { @ZAttr(id=1264) public void setExternalShareDomainWhitelistEnabled(boolean zimbraExternalShareDomainWhitelistEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraExternalShareDomainWhitelistEnabled, zimbraExternalShareDomainWhitelistEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraExternalShareDomainWhitelistEnabled, zimbraExternalShareDomainWhitelistEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -11652,7 +11655,7 @@ public void setExternalShareDomainWhitelistEnabled(boolean zimbraExternalShareDo @ZAttr(id=1264) public Map setExternalShareDomainWhitelistEnabled(boolean zimbraExternalShareDomainWhitelistEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraExternalShareDomainWhitelistEnabled, zimbraExternalShareDomainWhitelistEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraExternalShareDomainWhitelistEnabled, zimbraExternalShareDomainWhitelistEnabled ? TRUE : FALSE); return attrs; } @@ -11962,7 +11965,7 @@ public boolean isExternalSharingEnabled() { @ZAttr(id=1261) public void setExternalSharingEnabled(boolean zimbraExternalSharingEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraExternalSharingEnabled, zimbraExternalSharingEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraExternalSharingEnabled, zimbraExternalSharingEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -11978,7 +11981,7 @@ public void setExternalSharingEnabled(boolean zimbraExternalSharingEnabled) thro @ZAttr(id=1261) public Map setExternalSharingEnabled(boolean zimbraExternalSharingEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraExternalSharingEnabled, zimbraExternalSharingEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraExternalSharingEnabled, zimbraExternalSharingEnabled ? TRUE : FALSE); return attrs; } @@ -12183,7 +12186,7 @@ public boolean isFeatureAddressVerificationEnabled() { @ZAttr(id=2126) public void setFeatureAddressVerificationEnabled(boolean zimbraFeatureAddressVerificationEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraFeatureAddressVerificationEnabled, zimbraFeatureAddressVerificationEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraFeatureAddressVerificationEnabled, zimbraFeatureAddressVerificationEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -12199,7 +12202,7 @@ public void setFeatureAddressVerificationEnabled(boolean zimbraFeatureAddressVer @ZAttr(id=2126) public Map setFeatureAddressVerificationEnabled(boolean zimbraFeatureAddressVerificationEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraFeatureAddressVerificationEnabled, zimbraFeatureAddressVerificationEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraFeatureAddressVerificationEnabled, zimbraFeatureAddressVerificationEnabled ? TRUE : FALSE); return attrs; } @@ -12500,7 +12503,7 @@ public boolean isFeatureAdminMailEnabled() { @ZAttr(id=1170) public void setFeatureAdminMailEnabled(boolean zimbraFeatureAdminMailEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraFeatureAdminMailEnabled, zimbraFeatureAdminMailEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraFeatureAdminMailEnabled, zimbraFeatureAdminMailEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -12517,7 +12520,7 @@ public void setFeatureAdminMailEnabled(boolean zimbraFeatureAdminMailEnabled) th @ZAttr(id=1170) public Map setFeatureAdminMailEnabled(boolean zimbraFeatureAdminMailEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraFeatureAdminMailEnabled, zimbraFeatureAdminMailEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraFeatureAdminMailEnabled, zimbraFeatureAdminMailEnabled ? TRUE : FALSE); return attrs; } @@ -12583,7 +12586,7 @@ public boolean isFeatureAdminPreferencesEnabled() { @ZAttr(id=1686) public void setFeatureAdminPreferencesEnabled(boolean zimbraFeatureAdminPreferencesEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraFeatureAdminPreferencesEnabled, zimbraFeatureAdminPreferencesEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraFeatureAdminPreferencesEnabled, zimbraFeatureAdminPreferencesEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -12603,7 +12606,7 @@ public void setFeatureAdminPreferencesEnabled(boolean zimbraFeatureAdminPreferen @ZAttr(id=1686) public Map setFeatureAdminPreferencesEnabled(boolean zimbraFeatureAdminPreferencesEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraFeatureAdminPreferencesEnabled, zimbraFeatureAdminPreferencesEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraFeatureAdminPreferencesEnabled, zimbraFeatureAdminPreferencesEnabled ? TRUE : FALSE); return attrs; } @@ -12665,7 +12668,7 @@ public boolean isFeatureAdvancedSearchEnabled() { @ZAttr(id=138) public void setFeatureAdvancedSearchEnabled(boolean zimbraFeatureAdvancedSearchEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraFeatureAdvancedSearchEnabled, zimbraFeatureAdvancedSearchEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraFeatureAdvancedSearchEnabled, zimbraFeatureAdvancedSearchEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -12680,7 +12683,7 @@ public void setFeatureAdvancedSearchEnabled(boolean zimbraFeatureAdvancedSearchE @ZAttr(id=138) public Map setFeatureAdvancedSearchEnabled(boolean zimbraFeatureAdvancedSearchEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraFeatureAdvancedSearchEnabled, zimbraFeatureAdvancedSearchEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraFeatureAdvancedSearchEnabled, zimbraFeatureAdvancedSearchEnabled ? TRUE : FALSE); return attrs; } @@ -12738,7 +12741,7 @@ public boolean isFeatureAntispamEnabled() { @ZAttr(id=1168) public void setFeatureAntispamEnabled(boolean zimbraFeatureAntispamEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraFeatureAntispamEnabled, zimbraFeatureAntispamEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraFeatureAntispamEnabled, zimbraFeatureAntispamEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -12756,7 +12759,7 @@ public void setFeatureAntispamEnabled(boolean zimbraFeatureAntispamEnabled) thro @ZAttr(id=1168) public Map setFeatureAntispamEnabled(boolean zimbraFeatureAntispamEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraFeatureAntispamEnabled, zimbraFeatureAntispamEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraFeatureAntispamEnabled, zimbraFeatureAntispamEnabled ? TRUE : FALSE); return attrs; } @@ -12820,7 +12823,7 @@ public boolean isFeatureAppSpecificPasswordsEnabled() { @ZAttr(id=1907) public void setFeatureAppSpecificPasswordsEnabled(boolean zimbraFeatureAppSpecificPasswordsEnabled) throws com.zimbra.common.service.ServiceException { HashMap attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraFeatureAppSpecificPasswordsEnabled, zimbraFeatureAppSpecificPasswordsEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraFeatureAppSpecificPasswordsEnabled, zimbraFeatureAppSpecificPasswordsEnabled ? TRUE : FALSE); getProvisioning().modifyAttrs(this, attrs); } @@ -12838,7 +12841,7 @@ public void setFeatureAppSpecificPasswordsEnabled(boolean zimbraFeatureAppSpecif @ZAttr(id=1907) public Map setFeatureAppSpecificPasswordsEnabled(boolean zimbraFeatureAppSpecificPasswordsEnabled, Map attrs) { if (attrs == null) attrs = new HashMap(); - attrs.put(Provisioning.A_zimbraFeatureAppSpecificPasswordsEnabled, zimbraFeatureAppSpecificPasswordsEnabled ? Provisioning.TRUE : Provisioning.FALSE); + attrs.put(Provisioning.A_zimbraFeatureAppSpecificPasswordsEnabled, zimbraFeatureAppSpecificPasswordsEnabled ? TRUE : FALSE); return attrs; } @@ -12898,7 +12901,7 @@ public boolean isFeatureBriefcaseDocsEnabled() { @ZAttr(id=1055) public void setFeatureBriefcaseDocsEnabled(boolean zimbraFeatureBriefcaseDocsEnabled) throws com.zimbra.common.service.ServiceException { HashMap