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 */
019package org.apache.directory.api.ldap.model.message.controls;
020
021
022import org.apache.directory.api.ldap.model.message.Control;
023
024
025/**
026 * A simple Subentries Control. This control is described in RFC 3672 :
027 *    The subentries control MAY be sent with a searchRequest to control
028 *    the visibility of entries and subentries which are within scope.
029 *    Non-visible entries or subentries are not returned in response to the
030 *    request.
031 * 
032 *    The subentries control is an LDAP Control whose controlType is
033 *    1.3.6.1.4.1.4203.1.10.1, criticality is TRUE or FALSE (hence absent),
034 *    and controlValue contains a BER-encoded BOOLEAN indicating
035 *    visibility.  A controlValue containing the value TRUE indicates that
036 *    subentries are visible and normal entries are not.  A controlValue
037 *    containing the value FALSE indicates that normal entries are visible
038 *    and subentries are not.
039 * 
040 *    Note that TRUE visibility has the three octet encoding { 01 01 FF }
041 *    and FALSE visibility has the three octet encoding { 01 01 00 }.
042 * 
043 *    The controlValue SHALL NOT be absent.
044 * 
045 *    In absence of this control, subentries are not visible to singleLevel
046 *    and wholeSubtree scope Search requests but are visible to baseObject
047 *    scope Search requests.
048 * 
049 *    There is no corresponding response control.
050 * 
051 *    This control is not appropriate for non-Search operations.
052 *
053 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
054 */
055public interface Subentries extends Control
056{
057    /** The control OID */
058    String OID = "1.3.6.1.4.1.4203.1.10.1";
059
060
061    /**
062     * Check if the subEntry is visible
063     *
064     * @return true or false.
065     */
066    boolean isVisible();
067
068
069    /**
070     * Set the visibility flag
071     *
072     * @param visibility The visibility flag : true or false
073     */
074    void setVisibility( boolean visibility );
075}