Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.

1 /*2 * Copyright 2004 The Apache Software Foundation3 *4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 *8 * http://www.apache.org/licenses/LICENSE-2.09 *10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 *16 */17 package org.apache.ldap.server.db;18 19 20 importjavax.naming.NamingException;21 22 23 /**24 * NamingException for missing indicies if full table scans are disallowed.25 * 26 * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>27 * @version $Rev: 169198 $28 */29 publicclass IndexNotFoundException30 extendsNamingException31 {32 privatestaticfinallong serialVersionUID = 3906088970608981815L;33 34 /** the name of the index that was not found */35 privatefinalString indexName;36 37 38 /**39 * Constructs an Exception with a detailed message.40 * 41 * @param indexName the name of the index that was not found 42 */43 public IndexNotFoundException( String indexName )44 {45 super( "Cannot efficiently search the DIB w/o an index on attribute "46 + indexName + "\n. To allow such searches please contact the "47 + "directory\nadministrator to create the index or to enable "48 + "referrals on searches using these\nattributes to a replica with "49 + "the required set of indices." );50 this.indexName = indexName;51 }52 53 54 /**55 * Constructs an Exception with a detailed message.56 * 57 * @param message the message associated with the exception.58 * @param indexName the name of the index that was not found 59 */60 public IndexNotFoundException( String message, String indexName )61 {62 super( message );63 this.indexName = indexName;64 }65 66 67 /**68 * Constructs an Exception with a detailed message and a root cause 69 * exception.70 * 71 * @param message the message associated with the exception.72 * @param indexName the name of the index that was not found 73 * @param rootCause the root cause of this exception 74 */75 public IndexNotFoundException( String message, String indexName,76 Throwable rootCause )77 {78 this( message, indexName );79 setRootCause( rootCause );80 }81 82 83 /**84 * Gets the name of the attribute the index was missing for.85 *86 * @return the name of the attribute the index was missing for.87 */88 publicString getIndexName()89 {90 return indexName;91 }92 }93