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.api.ldap.extras.controls.syncrepl.syncInfoValue;
021
022
023import java.util.List;
024
025import org.apache.directory.api.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    /** This control OID */
061    String OID = "1.3.6.1.4.1.4203.1.9.1.4";
062
063
064    /**
065     * Get the control type.
066     *
067     * @return the type : one of newCookie, refreshDelete, refreshPresent or syncIdSet
068     */
069    SynchronizationInfoEnum getType();
070
071
072    /**
073     * @param type the synchronization type to set
074     */
075    void setType( SynchronizationInfoEnum type );
076
077
078    /**
079     * @return the cookie
080     */
081    byte[] getCookie();
082
083
084    /**
085     * @param cookie the cookie to set
086     */
087    void setCookie( byte[] cookie );
088
089
090    /**
091     * @return the refreshDone
092     */
093    boolean isRefreshDone();
094
095
096    /**
097     * @param refreshDone the refreshDone to set
098     */
099    void setRefreshDone( boolean refreshDone );
100
101
102    /**
103     * @return the refreshDeletes
104     */
105    boolean isRefreshDeletes();
106
107
108    /**
109     * @param refreshDeletes the refreshDeletes to set
110     */
111    void setRefreshDeletes( boolean refreshDeletes );
112
113
114    /**
115     * @return the syncUUIDs
116     */
117    List<byte[]> getSyncUUIDs();
118
119
120    /**
121     * @param syncUUIDs the syncUUIDs to set
122     */
123    void setSyncUUIDs( List<byte[]> syncUUIDs );
124
125
126    /**
127     * @param syncUUID the syncUUIDs to set
128     */
129    void addSyncUUID( byte[] syncUUID );
130}