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 */
020package org.apache.directory.server.config.beans;
021
022
023import org.apache.directory.server.config.ConfigurationElement;
024
025
026/**
027 * A class used to store the IndexBean configuration. It can't be instanciated
028 *
029 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
030 */
031public abstract class IndexBean extends AdsBaseBean
032{
033    /** The index unique identifier */
034    @ConfigurationElement(attributeType = "ads-indexAttributeId", isRdn = true)
035    private String indexAttributeId;
036
037    @ConfigurationElement(attributeType = "ads-indexHasReverse")
038    private boolean indexHasReverse;
039
040
041    /**
042     * Create a new IndexBean instance
043     */
044    protected IndexBean()
045    {
046    }
047
048
049    /**
050     * @return the indexAttributeId
051     */
052    public String getIndexAttributeId()
053    {
054        return indexAttributeId;
055    }
056
057
058    /**
059     * @param indexAttributeId the indexAttributeId to set
060     */
061    public void setIndexAttributeId( String indexAttributeId )
062    {
063        this.indexAttributeId = indexAttributeId;
064    }
065
066
067    /**
068     * @param indexHasReverse the indexHasReverse to set
069     */
070    public void setIndexHasReverse( boolean indexHasReverse )
071    {
072        this.indexHasReverse = indexHasReverse;
073    }
074
075
076    /**
077     * @return the indexHasReverse
078     */
079    public boolean getIndexHasReverse()
080    {
081        return indexHasReverse;
082    }
083
084
085    /**
086     * {@inheritDoc}
087     */
088    @Override
089    public String toString( String tabs )
090    {
091        StringBuilder sb = new StringBuilder();
092
093        sb.append( super.toString( tabs + "  " ) );
094        sb.append( tabs ).append( "  indexed attribute ID : " ).append( indexAttributeId ).append( '\n' );
095        sb.append( tabs ).append( "  indexed has reverse : " ).append( indexHasReverse ).append( '\n' );
096
097        return sb.toString();
098    }
099
100
101    /**
102     * {@inheritDoc}
103     */
104    @Override
105    public String toString()
106    {
107        return toString( "" );
108    }
109}