001/**
002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003 *
004 * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
005 *
006 * The contents of this file are subject to the terms
007 * of the Common Development and Distribution License
008 * (the License). You may not use this file except in
009 * compliance with the License.
010 *
011 * You can obtain a copy of the License at
012 * https://opensso.dev.java.net/public/CDDLv1.0.html or
013 * opensso/legal/CDDLv1.0.txt
014 * See the License for the specific language governing
015 * permission and limitations under the License.
016 *
017 * When distributing Covered Code, include this CDDL
018 * Header Notice in each file and include the License file
019 * at opensso/legal/CDDLv1.0.txt.
020 * If applicable, add the following below the CDDL Header,
021 * with the fields enclosed by brackets [] replaced by
022 * your own identifying information:
023 * "Portions Copyrighted [year] [name of copyright owner]"
024 *
025 * $Id: ICOSDefinition.java,v 1.3 2008/06/25 05:41:47 qcheng Exp $
026 *
027 */
028
029package com.iplanet.ums.cos;
030
031import com.iplanet.ums.UMSException;
032
033/**
034 * This interface provides method signatures which will be implemented for COS
035 * definitions. Each of the COS definition classes implement this interface, and
036 * provide implementations for these methods.
037 * @supported.api
038 */
039public interface ICOSDefinition {
040    /**
041     * This method sets the name for the COS definition.
042     * 
043     * @param name
044     *            the name of this COS definition.
045     * @supported.api
046     */
047    public void setName(String name);
048
049    /**
050     * This method returns the name of the COS definition.
051     * 
052     * @return the name of the COS definition.
053     * @supported.api
054     */
055    public String getName();
056
057    /**
058     * This method adds a COS attribute to the COS definition.
059     * 
060     * @param attrName
061     *            the name of the attribute.
062     * @param qualifier
063     *            The qualifier for the attribute. The valid range of values
064     *            are: 0 (default), 1 (override), 2 (operational), 3
065     *            (merge-schemes).
066     * @throws UMSException
067     *             if an exception occurs.
068     * @supported.api
069     */
070    public void addCOSAttribute(String attrName, int qualifier)
071            throws UMSException;
072
073    /**
074     * This method removes a COS attribute from the COS definiton.
075     * 
076     * @param attrName
077     *            The name of the COS attribute to be removed.
078     * @supported.api
079     */
080    public void removeCOSAttribute(String attrName);
081
082    /**
083     * This method returns an array of COS attributes.
084     * 
085     * @return an array of COS attributes.
086     */
087    public String[] getCOSAttributes();
088
089    //
090    // Attribute name strings for COS definitions.
091    //
092    /**
093     * This field represents the default naming attribute for COS definitions.
094     *
095     * @supported.api
096     */
097    public static final String DEFAULT_NAMING_ATTR = "cn";
098
099    /**
100     * This field represents a keyword used in COS definitions.
101     *
102     * @supported.api
103     */
104    public static final String COSTEMPLATEDN = "cosTemplateDn";
105
106    /**
107     * This field represents a keyword used in COS definitions.
108     *
109     * @supported.api
110     */
111    public static final String COSSPECIFIER = "cosSpecifier";
112
113    /**
114     * This field represents a keyword used in COS definitions.
115     *
116     * @supported.api
117     */
118    public static final String ICOSSPECIFIER = "cosIndirectSpecifier";
119
120    /**
121     * This field represents a keyword used in COS definitions.
122     *
123     * @supported.api
124     */
125    public static final String COSATTRIBUTE = "cosAttribute";
126
127    /**
128     * This field represents an LDAP search filter used for searching for COS
129     * definitions by name.
130     * @supported.api
131     */
132    public static final String COSSUPERDEF_NAME_SEARCH = 
133        "(&(objectclass=ldapsubentry)(objectclass=cossuperdefinition)("
134            + DEFAULT_NAMING_ATTR + "=";
135
136    /**
137     * This field represents an LDAP search filter used for searching for COS
138     * definitions.
139     * @supported.api
140     */
141    public static final String COSSUPERDEF_SEARCH = 
142        "&(objectclass=ldapsubentry)(objectclass=cossuperdefinition)";
143
144    // for DS 4.x
145    /**
146     * This field represents a keyword used in Directory Server 4.x COS
147     * implementations.
148     * @supported.api
149     */
150    public static final String COSTARGETTREE = "cosTargetTree";
151
152    //
153    // cosAttribute qualifiers for COS definitions.
154    //
155    /**
156     * This field represents the minimum value a COS attribute qualifier may
157     * have.
158     * @supported.api
159     */
160    public static final int minQualifier = 0;
161
162    /**
163     * This field represents the maximum value a COS attribute qualifier may
164     * have.
165     * @supported.api
166     */
167    public static final int maxQualifier = 2;
168
169    /**
170     * This field represents the numeric qualifier constant for "default".
171     *
172     * @supported.api
173     */
174    public static final int DEFAULT = 0;
175
176    /**
177     * This field represents the numeric qualifier constant for "override".
178     *
179     * @supported.api
180     */
181    public static final int OVERRIDE = 1;
182
183    /**
184     * This field represents the numeric qualifier constant for "operational".
185     *
186     * @supported.api
187     */
188    public static final int OPERATIONAL = 2;
189
190    /**
191     * This field represents the numeric qualifier constant for "merge-schemes".
192     *
193     * @supported.api
194     */
195    public static final int MERGE_SCHEMES = 3;
196
197    /**
198     * This represents a string array of COS attribute qualifiers. The valid
199     * values are "default", "override", "operational", and "merge-schemes".
200     *
201     * @supported.api
202     */
203    public static final String[] qualifiers = { "default", "override",
204            "operational", "merge-schemes" };
205
206}