001/*
002 * Copyright 2013 Atteo.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.atteo.moonshine.tomcat;
017
018import java.util.ArrayList;
019import java.util.List;
020
021import javax.xml.bind.annotation.XmlElement;
022import javax.xml.bind.annotation.XmlElementWrapper;
023
024import org.atteo.evo.config.Configurable;
025
026/**
027 * Virtual host configuration.
028 */
029public class HostConfig extends Configurable {
030    /**
031     * Application base directory for virtual host.
032     */
033    @XmlElement
034    private String appBase = ".";
035
036    /**
037     * Network name of this virtual host.
038     */
039    @XmlElement
040    private String name = "127.0.0.1";
041
042    /**
043     * Contexts.
044     */
045    @XmlElementWrapper(name = "contexts")
046    @XmlElement(name = "context")
047    private List<ContextConfig> contexts = new ArrayList<ContextConfig>() {
048        {
049            add(new ContextConfig());
050        }
051    };
052
053    public String getAppBase() {
054        return appBase;
055    }
056
057    public String getName() {
058        return name;
059    }
060
061    public List<ContextConfig> getContexts() {
062        return contexts;
063    }
064}