001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License.
018 *
019 */
020package org.apache.directory.shared.ldap.extras.controls;
021
022
023import java.util.List;
024
025import org.apache.directory.shared.ldap.model.message.Control;
026
027
028/**
029 * A syncInfoValue object, as defined in RFC 4533 ;
030 * <pre>
031 * 2.5.  Sync Info Message
032 *
033 *    The Sync Info Message is an LDAP Intermediate Response Message
034 *    [RFC4511] where responseName is the object identifier
035 *    1.3.6.1.4.1.4203.1.9.1.4 and responseValue contains a BER-encoded
036 *    syncInfoValue.  The criticality is FALSE (and hence absent).
037 *
038 *       syncInfoValue ::= CHOICE {
039 *           newcookie      [0] syncCookie,
040 *           refreshDelete  [1] SEQUENCE {
041 *               cookie         syncCookie OPTIONAL,
042 *               refreshDone    BOOLEAN DEFAULT TRUE
043 *           },
044 *           refreshPresent [2] SEQUENCE {
045 *               cookie         syncCookie OPTIONAL,
046 *               refreshDone    BOOLEAN DEFAULT TRUE
047 *           },
048 *           syncIdSet      [3] SEQUENCE {
049 *               cookie         syncCookie OPTIONAL,
050 *               refreshDeletes BOOLEAN DEFAULT FALSE,
051 *               syncUUIDs      SET OF syncUUID
052 *           }
053 *       }
054 * </pre>
055 *
056 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
057 */
058public interface SyncInfoValue extends Control
059{
060
061    /** This control OID */
062    public static final String OID = "1.3.6.1.4.1.4203.1.9.1.4";
063
064
065    /**
066     * Get the control type.
067     *
068     * @return the type : one of newCookie, refreshDelete, refreshPresent or syncIdSet
069     */
070    SynchronizationInfoEnum getType();
071
072
073    /**
074     * @param syncMode the syncMode to set
075     */
076    void setType( SynchronizationInfoEnum type );
077
078
079    /**
080     * @return the cookie
081     */
082    byte[] getCookie();
083
084
085    /**
086     * @param cookie the cookie to set
087     */
088    void setCookie( byte[] cookie );
089
090
091    /**
092     * @return the refreshDone
093     */
094    boolean isRefreshDone();
095
096
097    /**
098     * @param refreshDone the refreshDone to set
099     */
100    void setRefreshDone( boolean refreshDone );
101
102
103    /**
104     * @return the refreshDeletes
105     */
106    boolean isRefreshDeletes();
107
108
109    /**
110     * @param refreshDeletes the refreshDeletes to set
111     */
112    void setRefreshDeletes( boolean refreshDeletes );
113
114
115    /**
116     * @return the syncUUIDs
117     */
118    List<byte[]> getSyncUUIDs();
119
120
121    /**
122     * @param syncUUIDs the syncUUIDs to set
123     */
124    void setSyncUUIDs( List<byte[]> syncUUIDs );
125
126
127    /**
128     * @param syncUUIDs the syncUUIDs to set
129     */
130    void addSyncUUID( byte[] syncUUID );
131}