1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
b742179ac0790068380618ab72a06af18544f09cPavel Březina * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved.
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * The contents of this file are subject to the terms of either the GNU
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * General Public License Version 2 only ("GPL") or the Common Development
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * and Distribution License("CDDL") (collectively, the "License"). You
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * may not use this file except in compliance with the License. You can
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * obtain a copy of the License at
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * or packager/legal/LICENSE.txt. See the License for the specific
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * language governing permissions and limitations under the License.
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * When distributing the software, include this License Header Notice in each
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * file and include the License file at packager/legal/LICENSE.txt.
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * GPL Classpath Exception:
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * Oracle designates this particular file as subject to the "Classpath"
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * exception as provided by Oracle in the GPL Version 2 section of the License
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * file that accompanied this code.
b742179ac0790068380618ab72a06af18544f09cPavel Březina * Modifications:
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * If applicable, add the following below the License Header, with the fields
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * enclosed by brackets [] replaced by your own identifying information:
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * "Portions Copyright [year] [name of copyright owner]"
df4e1db5d41c903ae57fd880acc76a0ad84aa7b2Pavel Březina * Contributor(s):
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter * If you wish your version of this file to be governed by only the CDDL or
b742179ac0790068380618ab72a06af18544f09cPavel Březina * only the GPL Version 2, indicate your decision by adding "[Contributor]
b742179ac0790068380618ab72a06af18544f09cPavel Březina * elects to include this software in this distribution under the [CDDL or GPL
b742179ac0790068380618ab72a06af18544f09cPavel Březina * Version 2] license." If you don't indicate a single choice of license, a
b742179ac0790068380618ab72a06af18544f09cPavel Březina * recipient has the option to distribute your version of this file under
b742179ac0790068380618ab72a06af18544f09cPavel Březina * either the CDDL, the GPL Version 2 or to extend the choice of license to
b742179ac0790068380618ab72a06af18544f09cPavel Březina * its licensees as provided above. However, if you add GPL Version 2 code
b742179ac0790068380618ab72a06af18544f09cPavel Březina * and therefore, elected the GPL Version 2 license, then the option applies
b742179ac0790068380618ab72a06af18544f09cPavel Březina * only if the new code is made subject to such option by the copyright
b742179ac0790068380618ab72a06af18544f09cPavel Březina * Resynchronization data as defined by the QRESYNC extension
b742179ac0790068380618ab72a06af18544f09cPavel Březina * (<A HREF="http://www.ietf.org/rfc/rfc5162.txt">RFC 5162</A>).
b742179ac0790068380618ab72a06af18544f09cPavel Březina * An instance of <CODE>ResyncData</CODE> is supplied to the
b742179ac0790068380618ab72a06af18544f09cPavel Březina * {@link com.sun.mail.imap.IMAPFolder#open(int,com.sun.mail.imap.ResyncData)
b742179ac0790068380618ab72a06af18544f09cPavel Březina * IMAPFolder open} method.
b742179ac0790068380618ab72a06af18544f09cPavel Březina * The CONDSTORE <CODE>ResyncData</CODE> instance is used to enable the
b742179ac0790068380618ab72a06af18544f09cPavel Březina * CONDSTORE extension
b742179ac0790068380618ab72a06af18544f09cPavel Březina * (<A HREF="http://www.ietf.org/rfc/rfc4551.txt">RFC 4551</A>).
b742179ac0790068380618ab72a06af18544f09cPavel Březina * A <CODE>ResyncData</CODE> instance with uidvalidity and modseq values
b742179ac0790068380618ab72a06af18544f09cPavel Březina * is used to enable the QRESYNC extension.
b742179ac0790068380618ab72a06af18544f09cPavel Březina * @since JavaMail 1.5.1
b742179ac0790068380618ab72a06af18544f09cPavel Březina * @author Bill Shannon
b742179ac0790068380618ab72a06af18544f09cPavel Březina * Used to enable only the CONDSTORE extension.
b742179ac0790068380618ab72a06af18544f09cPavel Březina public static final ResyncData CONDSTORE = new ResyncData(-1, -1);
b742179ac0790068380618ab72a06af18544f09cPavel Březina * Used to report on changes since the specified modseq.
b742179ac0790068380618ab72a06af18544f09cPavel Březina * If the UIDVALIDITY of the folder has changed, no message
b742179ac0790068380618ab72a06af18544f09cPavel Březina * changes will be reported. The application must check the
b742179ac0790068380618ab72a06af18544f09cPavel Březina * UIDVALIDITY of the folder after open to make sure it's
b742179ac0790068380618ab72a06af18544f09cPavel Březina * the expected folder.
b742179ac0790068380618ab72a06af18544f09cPavel Březina * @param uidvalidity the UIDVALIDITY
b742179ac0790068380618ab72a06af18544f09cPavel Březina * @param modseq the MODSEQ
b742179ac0790068380618ab72a06af18544f09cPavel Březina public ResyncData(long uidvalidity, long modseq) {
b742179ac0790068380618ab72a06af18544f09cPavel Březina * Used to limit the reported message changes to those with UIDs
b742179ac0790068380618ab72a06af18544f09cPavel Březina * in the specified range.
b742179ac0790068380618ab72a06af18544f09cPavel Březina * @param uidvalidity the UIDVALIDITY
b742179ac0790068380618ab72a06af18544f09cPavel Březina * @param modseq the MODSEQ
b742179ac0790068380618ab72a06af18544f09cPavel Březina * @param uidFirst the first UID
b742179ac0790068380618ab72a06af18544f09cPavel Březina * @param uidLast the last UID
b742179ac0790068380618ab72a06af18544f09cPavel Březina public ResyncData(long uidvalidity, long modseq,
b742179ac0790068380618ab72a06af18544f09cPavel Březina this.uids = new UIDSet[] { new UIDSet(uidFirst, uidLast) };
b742179ac0790068380618ab72a06af18544f09cPavel Březina * Used to limit the reported message changes to those with the
b742179ac0790068380618ab72a06af18544f09cPavel Březina * specified UIDs.
b742179ac0790068380618ab72a06af18544f09cPavel Březina * @param uidvalidity the UIDVALIDITY
b742179ac0790068380618ab72a06af18544f09cPavel Březina * @param modseq the MODSEQ
b742179ac0790068380618ab72a06af18544f09cPavel Březina * @param uids the UID values
b742179ac0790068380618ab72a06af18544f09cPavel Březina public ResyncData(long uidvalidity, long modseq, long[] uids) {
b742179ac0790068380618ab72a06af18544f09cPavel Březina * Get the UIDVALIDITY value specified when this instance was created.
b742179ac0790068380618ab72a06af18544f09cPavel Březina * @return the UIDVALIDITY value
b742179ac0790068380618ab72a06af18544f09cPavel Březina * Get the MODSEQ value specified when this instance was created.
df4e1db5d41c903ae57fd880acc76a0ad84aa7b2Pavel Březina * @return the MODSEQ value
b742179ac0790068380618ab72a06af18544f09cPavel Březina * Package private. IMAPProtocol gets this data indirectly
b742179ac0790068380618ab72a06af18544f09cPavel Březina * using Utility.getResyncUIDSet().