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 HttpWebApp configuration.
28   *
29   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
30   */
31  public class HttpWebAppBean extends AdsBaseBean
32  {
33      /** The server identifier */
34      @ConfigurationElement(attributeType = "ads-id", isRdn = true)
35      private String id;
36  
37      /** The context path */
38      @ConfigurationElement(attributeType = "ads-httpAppCtxPath")
39      private String httpAppCtxPath;
40  
41      /** The war file */
42      @ConfigurationElement(attributeType = "ads-httpWarFile")
43      private String httpWarFile;
44  
45  
46      /**
47       * Create a new HttpWebAppBean instance
48       */
49      public HttpWebAppBean()
50      {
51          super();
52  
53          // Enabled by default
54          setEnabled( true );
55      }
56  
57  
58      /**
59       * @return the id
60       */
61      public String getId()
62      {
63          return id;
64      }
65  
66  
67      /**
68       * @param id the id to set
69       */
70      public void setId( String id )
71      {
72          this.id = id;
73      }
74  
75  
76      /**
77       * @return the httpAppCtxPath
78       */
79      public String getHttpAppCtxPath()
80      {
81          return httpAppCtxPath;
82      }
83  
84  
85      /**
86       * @param httpAppCtxPath the httpAppCtxPath to set
87       */
88      public void setHttpAppCtxPath( String httpAppCtxPath )
89      {
90          this.httpAppCtxPath = httpAppCtxPath;
91      }
92  
93  
94      /**
95       * @return the httpWarFile
96       */
97      public String getHttpWarFile()
98      {
99          return httpWarFile;
100     }
101 
102 
103     /**
104      * @param httpWarFile the httpWarFile to set
105      */
106     public void setHttpWarFile( String httpWarFile )
107     {
108         this.httpWarFile = httpWarFile;
109     }
110 
111 
112     /**
113      * {@inheritDoc}
114      */
115     @Override
116     public String toString( String tabs )
117     {
118         StringBuilder sb = new StringBuilder();
119 
120         sb.append( tabs ).append( "HttpWebApp :\n" );
121         sb.append( super.toString( tabs + "  " ) );
122         sb.append( tabs ).append( "  id : " ).append( id ).append( '\n' );
123         sb.append( tabs ).append( "  war file : " ).append( httpWarFile ).append( '\n' );
124         sb.append( toString( tabs, "  application context path", httpAppCtxPath ) );
125 
126         return sb.toString();
127     }
128 
129 
130     /**
131      * {@inheritDoc}
132      */
133     @Override
134     public String toString()
135     {
136         return toString( "" );
137     }
138 }