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 HttpWebApp configuration.
028 *
029 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
030 */
031public class HttpWebAppBean extends AdsBaseBean
032{
033    /** The server identifier */
034    @ConfigurationElement(attributeType = "ads-id", isRdn = true)
035    private String id;
036
037    /** The context path */
038    @ConfigurationElement(attributeType = "ads-httpAppCtxPath")
039    private String httpAppCtxPath;
040
041    /** The war file */
042    @ConfigurationElement(attributeType = "ads-httpWarFile")
043    private String httpWarFile;
044
045
046    /**
047     * Create a new HttpWebAppBean instance
048     */
049    public HttpWebAppBean()
050    {
051        super();
052
053        // Enabled by default
054        setEnabled( true );
055    }
056
057
058    /**
059     * @return the id
060     */
061    public String getId()
062    {
063        return id;
064    }
065
066
067    /**
068     * @param id the id to set
069     */
070    public void setId( String id )
071    {
072        this.id = id;
073    }
074
075
076    /**
077     * @return the httpAppCtxPath
078     */
079    public String getHttpAppCtxPath()
080    {
081        return httpAppCtxPath;
082    }
083
084
085    /**
086     * @param httpAppCtxPath the httpAppCtxPath to set
087     */
088    public void setHttpAppCtxPath( String httpAppCtxPath )
089    {
090        this.httpAppCtxPath = httpAppCtxPath;
091    }
092
093
094    /**
095     * @return the httpWarFile
096     */
097    public String getHttpWarFile()
098    {
099        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}