001    /*
002     * CDDL HEADER START
003     *
004     * The contents of this file are subject to the terms of the
005     * Common Development and Distribution License, Version 1.0 only
006     * (the "License").  You may not use this file except in compliance
007     * with the License.
008     *
009     * You can obtain a copy of the license at
010     * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011     * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012     * See the License for the specific language governing permissions
013     * and limitations under the License.
014     *
015     * When distributing Covered Code, include this CDDL HEADER in each
016     * file and include the License file at
017     * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
018     * add the following below this CDDL HEADER, with the fields enclosed
019     * by brackets "[]" replaced with your own identifying information:
020     *      Portions Copyright [yyyy] [name of copyright owner]
021     *
022     * CDDL HEADER END
023     *
024     *
025     *      Copyright 2008 Sun Microsystems, Inc.
026     */
027    package org.opends.server.admin.std.client;
028    
029    
030    
031    import java.util.Collection;
032    import java.util.SortedSet;
033    import org.opends.server.admin.ConfigurationClient;
034    import org.opends.server.admin.IllegalPropertyValueException;
035    import org.opends.server.admin.ManagedObjectDefinition;
036    import org.opends.server.admin.PropertyIsReadOnlyException;
037    import org.opends.server.admin.std.meta.BackendCfgDefn.WritabilityMode;
038    import org.opends.server.admin.std.server.BackendCfg;
039    import org.opends.server.types.DN;
040    
041    
042    
043    /**
044     * A client-side interface for reading and modifying Backend settings.
045     * <p>
046     * Backends are responsible for providing access to the underlying
047     * data presented by the server.
048     */
049    public interface BackendCfgClient extends ConfigurationClient {
050    
051      /**
052       * Get the configuration definition associated with this Backend.
053       *
054       * @return Returns the configuration definition associated with this Backend.
055       */
056      ManagedObjectDefinition<? extends BackendCfgClient, ? extends BackendCfg> definition();
057    
058    
059    
060      /**
061       * Gets the "backend-id" property.
062       * <p>
063       * Specifies a name to identify the associated backend.
064       * <p>
065       * The name must be unique among all backends in the server. The
066       * backend ID may not be altered after the backend is created in the
067       * server.
068       *
069       * @return Returns the value of the "backend-id" property.
070       */
071      String getBackendId();
072    
073    
074    
075      /**
076       * Sets the "backend-id" property.
077       * <p>
078       * Specifies a name to identify the associated backend.
079       * <p>
080       * The name must be unique among all backends in the server. The
081       * backend ID may not be altered after the backend is created in the
082       * server.
083       * <p>
084       * This property is read-only and can only be modified during
085       * creation of a Backend.
086       *
087       * @param value The value of the "backend-id" property.
088       * @throws IllegalPropertyValueException
089       *           If the new value is invalid.
090       * @throws PropertyIsReadOnlyException
091       *           If this Backend is not being initialized.
092       */
093      void setBackendId(String value) throws IllegalPropertyValueException, PropertyIsReadOnlyException;
094    
095    
096    
097      /**
098       * Gets the "base-dn" property.
099       * <p>
100       * Specifies the base DN(s) for the data that the backend handles.
101       * <p>
102       * A single backend may be responsible for one or more base DNs.
103       * Note that no two backends may have the same base DN although one
104       * backend may have a base DN that is below a base DN provided by
105       * another backend (similar to the use of sub-suffixes in the Sun
106       * Java System Directory Server). If any of the base DNs is
107       * subordinate to a base DN for another backend, then all base DNs
108       * for that backend must be subordinate to that same base DN.
109       *
110       * @return Returns the values of the "base-dn" property.
111       */
112      SortedSet<DN> getBaseDN();
113    
114    
115    
116      /**
117       * Sets the "base-dn" property.
118       * <p>
119       * Specifies the base DN(s) for the data that the backend handles.
120       * <p>
121       * A single backend may be responsible for one or more base DNs.
122       * Note that no two backends may have the same base DN although one
123       * backend may have a base DN that is below a base DN provided by
124       * another backend (similar to the use of sub-suffixes in the Sun
125       * Java System Directory Server). If any of the base DNs is
126       * subordinate to a base DN for another backend, then all base DNs
127       * for that backend must be subordinate to that same base DN.
128       *
129       * @param values The values of the "base-dn" property.
130       * @throws IllegalPropertyValueException
131       *           If one or more of the new values are invalid.
132       */
133      void setBaseDN(Collection<DN> values) throws IllegalPropertyValueException;
134    
135    
136    
137      /**
138       * Gets the "enabled" property.
139       * <p>
140       * Indicates whether the backend is enabled in the server.
141       * <p>
142       * If a backend is not enabled, then its contents are not accessible
143       * when processing operations.
144       *
145       * @return Returns the value of the "enabled" property.
146       */
147      Boolean isEnabled();
148    
149    
150    
151      /**
152       * Sets the "enabled" property.
153       * <p>
154       * Indicates whether the backend is enabled in the server.
155       * <p>
156       * If a backend is not enabled, then its contents are not accessible
157       * when processing operations.
158       *
159       * @param value The value of the "enabled" property.
160       * @throws IllegalPropertyValueException
161       *           If the new value is invalid.
162       */
163      void setEnabled(boolean value) throws IllegalPropertyValueException;
164    
165    
166    
167      /**
168       * Gets the "java-class" property.
169       * <p>
170       * Specifies the fully-qualified name of the Java class that
171       * provides the backend implementation.
172       *
173       * @return Returns the value of the "java-class" property.
174       */
175      String getJavaClass();
176    
177    
178    
179      /**
180       * Sets the "java-class" property.
181       * <p>
182       * Specifies the fully-qualified name of the Java class that
183       * provides the backend implementation.
184       *
185       * @param value The value of the "java-class" property.
186       * @throws IllegalPropertyValueException
187       *           If the new value is invalid.
188       */
189      void setJavaClass(String value) throws IllegalPropertyValueException;
190    
191    
192    
193      /**
194       * Gets the "writability-mode" property.
195       * <p>
196       * Specifies the behavior that the backend should use when
197       * processing write operations.
198       *
199       * @return Returns the value of the "writability-mode" property.
200       */
201      WritabilityMode getWritabilityMode();
202    
203    
204    
205      /**
206       * Sets the "writability-mode" property.
207       * <p>
208       * Specifies the behavior that the backend should use when
209       * processing write operations.
210       *
211       * @param value The value of the "writability-mode" property.
212       * @throws IllegalPropertyValueException
213       *           If the new value is invalid.
214       */
215      void setWritabilityMode(WritabilityMode value) throws IllegalPropertyValueException;
216    
217    }