View Javadoc
1   /*
2    *   Licensed to the Apache Software Foundation (ASF) under one
3    *   or more contributor license agreements.  See the NOTICE file
4    *   distributed with this work for additional information
5    *   regarding copyright ownership.  The ASF licenses this file
6    *   to you under the Apache License, Version 2.0 (the
7    *   "License"); you may not use this file except in compliance
8    *   with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   *   Unless required by applicable law or agreed to in writing,
13   *   software distributed under the License is distributed on an
14   *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *   KIND, either express or implied.  See the License for the
16   *   specific language governing permissions and limitations
17   *   under the License.
18   *
19   */
20  package org.apache.directory.server.config.beans;
21  
22  
23  import org.apache.directory.server.config.ConfigurationElement;
24  
25  
26  /**
27   * A class used to store the ChangeLog configuration.
28   *
29   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
30   */
31  public class ChangeLogBean extends AdsBaseBean
32  {
33      /** The ChangeLog unique ID */
34      @ConfigurationElement(attributeType = "ads-changeLogId", isRdn = true)
35      private String changeLogId;
36  
37      /** Tells if the ChangeLog is exposed to the users */
38      @ConfigurationElement(attributeType = "ads-changeLogExposed")
39      private boolean changeLogExposed;
40  
41  
42      /**
43       * Create a new ChangeLogBean instance
44       */
45      public ChangeLogBean()
46      {
47          // Not exposed by default
48          changeLogExposed = false;
49  
50          // Not enabled by default
51          setEnabled( false );
52      }
53  
54  
55      /**
56       * @return the changeLogId
57       */
58      public String getChangeLogId()
59      {
60          return changeLogId;
61      }
62  
63  
64      /**
65       * @param changeLogId the changeLogId to set
66       */
67      public void setChangeLogId( String changeLogId )
68      {
69          this.changeLogId = changeLogId;
70      }
71  
72  
73      /**
74       * @return <code>true</code> if the ChangeLog is exposed
75       */
76      public boolean isChangeLogExposed()
77      {
78          return changeLogExposed;
79      }
80  
81  
82      /**
83       * @param changeLogExposed Set the exposed flag
84       */
85      public void setChangeLogExposed( boolean changeLogExposed )
86      {
87          this.changeLogExposed = changeLogExposed;
88      }
89  
90  
91      /**
92       * {@inheritDoc}
93       */
94      @Override
95      public String toString( String tabs )
96      {
97          StringBuilder sb = new StringBuilder();
98  
99          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 }