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