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 ChangeLog configuration.
028 *
029 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
030 */
031public class ChangeLogBean extends AdsBaseBean
032{
033    /** The ChangeLog unique ID */
034    @ConfigurationElement(attributeType = "ads-changeLogId", isRdn = true)
035    private String changeLogId;
036
037    /** Tells if the ChangeLog is exposed to the users */
038    @ConfigurationElement(attributeType = "ads-changeLogExposed")
039    private boolean changeLogExposed;
040
041
042    /**
043     * Create a new ChangeLogBean instance
044     */
045    public ChangeLogBean()
046    {
047        // Not exposed by default
048        changeLogExposed = false;
049
050        // Not enabled by default
051        setEnabled( false );
052    }
053
054
055    /**
056     * @return the changeLogId
057     */
058    public String getChangeLogId()
059    {
060        return changeLogId;
061    }
062
063
064    /**
065     * @param changeLogId the changeLogId to set
066     */
067    public void setChangeLogId( String changeLogId )
068    {
069        this.changeLogId = changeLogId;
070    }
071
072
073    /**
074     * @return <code>true</code> if the ChangeLog is exposed
075     */
076    public boolean isChangeLogExposed()
077    {
078        return changeLogExposed;
079    }
080
081
082    /**
083     * @param changeLogExposed Set the exposed flag
084     */
085    public void setChangeLogExposed( boolean changeLogExposed )
086    {
087        this.changeLogExposed = changeLogExposed;
088    }
089
090
091    /**
092     * {@inheritDoc}
093     */
094    @Override
095    public String toString( String tabs )
096    {
097        StringBuilder sb = new StringBuilder();
098
099        sb.append( tabs ).append( "ChangeLog :\n" );
100        sb.append( tabs ).append( "  changeLog id : " ).append( changeLogId ).append( '\n' );
101        sb.append( toString( tabs, "  changeLog exposed", changeLogExposed ) );
102
103        return sb.toString();
104    }
105
106
107    /**
108     * {@inheritDoc}
109     */
110    @Override
111    public String toString()
112    {
113        return toString( "" );
114    }
115}