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 */
020 package org.apache.directory.server.protocol.shared;
021
022 import org.apache.directory.server.constants.ServerDNConstants;
023
024
025 /**
026 * Base class shared by all protocol providers for configuration.
027 *
028 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
029 * @version $Rev: 729572 $, $Date: 2008-12-27 01:27:47 +0100 (Sam, 27 déc 2008) $
030 */
031 public abstract class DirectoryBackedService extends AbstractProtocolService
032 {
033 /**
034 * The single location where entries are stored. If this service
035 * is catalog based the store will search the system partition
036 * configuration for catalog entries. Otherwise it will use this
037 * search base as a single point of searching the DIT.
038 */
039 private String searchBaseDn = ServerDNConstants.USER_EXAMPLE_COM_DN;
040
041 /** determines if the search base is pointer to a catalog or a single entry point */
042 private boolean catelogBased;
043
044
045 /**
046 * Returns the search base DN.
047 *
048 * @return The search base DN.
049 */
050 public String getSearchBaseDn()
051 {
052 return searchBaseDn;
053 }
054
055
056 /**
057 * @param searchBaseDn The searchBaseDn to set.
058 */
059 public void setSearchBaseDn( String searchBaseDn )
060 {
061 this.searchBaseDn = searchBaseDn;
062 }
063
064
065 /**
066 * Gets true if this service uses a catalog for searching different
067 * regions of the DIT for its data.
068 *
069 * @return true if the search base dn is for a catalog, false otherwise
070 */
071 public boolean isCatelogBased()
072 {
073 return catelogBased;
074 }
075
076
077 /**
078 * Set true if this service uses a catalog for searching different
079 * regions of the DIT for its data.
080 *
081 * @param catelogBased if the search base dn is for a catalog, false otherwise
082 */
083 public void setCatelogBased( boolean catelogBased )
084 {
085 this.catelogBased = catelogBased;
086 }
087 }