KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > util > VirtualServerInfo


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.deployment.util;
25
26 import java.net.URL JavaDoc;
27 import java.net.MalformedURLException JavaDoc;
28
29 /**
30  * This class holds information about a web server virtual
31  * engine configuration
32  *
33  * @author Jerome Dochez
34  */

35 public class VirtualServerInfo {
36     
37     /**
38      * Holds value of property host.
39      */

40     private String JavaDoc host;
41     
42     /**
43      * Holds value of property port.
44      */

45     private int port;
46     
47     /**
48      * Holds value of property protocol.
49      */

50     private String JavaDoc protocol;
51     
52     /** Creates a new instance of VirtualServerInfo */
53     public VirtualServerInfo(String JavaDoc protocol, String JavaDoc host, int port) {
54         this.protocol = protocol;
55         this.host = host;
56         this.port = port;
57     }
58     
59     /**
60      * Getter for property serverName.
61      * @return Value of property serverName.
62      */

63     public String JavaDoc getHost() {
64         return this.host;
65     }
66     
67     /**
68      * Getter for property port.
69      * @return value of property port.
70      */

71     public int getPort() {
72        return this.port;
73     }
74     
75     /**
76      * Getter for property protocol.
77      * @return Value of property protocol.
78      */

79     public String JavaDoc getProtocol() {
80         return this.protocol;
81     }
82     
83     /**
84      * @return the web server root URL
85      */

86     public URL JavaDoc getWebServerRootURL() throws MalformedURLException JavaDoc {
87         return new URL JavaDoc(protocol, host, port, "");
88     }
89 }
90
Popular Tags