KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > websphere6 > ui > Instance


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.j2ee.websphere6.ui;
20
21 /**
22  * A model for the server instance. It contains all the critical properties
23  * for the plugin: name, host, port, profile path.
24  *
25  * @author Kirill Sorokin
26  * @author Dmitry Lipin
27  */

28 public class Instance {
29     /**
30      * Instance's name, it is used a the parameter to the startup/shutdown
31      * scripts
32      */

33     private String JavaDoc name;
34
35     /**
36      * Instance's host
37      */

38     private String JavaDoc host;
39
40     /**
41      * Instance's port
42      */

43     private String JavaDoc port;
44
45     /**
46      * Instance's profile directory
47      */

48     private String JavaDoc domainPath;
49     
50     /**
51      * Path to the server.xml file
52      */

53     private String JavaDoc configXmlPath;
54     
55     private String JavaDoc adminPort;
56     
57     private String JavaDoc httpPort;
58     
59     private String JavaDoc defaultHostPort;
60     /**
61      * Creates a new instance of Instance
62      *
63      * @param name the instance's name
64      * @param host the instance's host
65      * @param port the instance's port
66      * @param domainPath the instance's profile path
67      * @param configXmlPath path to the server.xml file
68      */

69     public Instance(String JavaDoc name, String JavaDoc host, String JavaDoc port,
70             String JavaDoc domainPath, String JavaDoc configXmlPath, String JavaDoc adminPort,String JavaDoc httpPort,String JavaDoc defaultHostPort) {
71         // save the properties
72
this.name = name;
73         this.host = host;
74         this.port = port;
75         this.domainPath = domainPath;
76         this.configXmlPath = configXmlPath;
77         this.adminPort = adminPort;
78         this.httpPort=httpPort;
79         this.defaultHostPort=defaultHostPort;
80     }
81     
82     /**
83      * Getter for the instance's name
84      *
85      * @return the instance's name
86      */

87     public String JavaDoc getName() {
88         return this.name;
89     }
90     
91     /**
92      * Setter for the instance's name
93      *
94      * @param the new instance's name
95      */

96     public void setName(String JavaDoc name) {
97         this.name = name;
98     }
99     
100     /**
101      * Getter for the instance's host
102      *
103      * @return the instance's host
104      */

105     public String JavaDoc getHost() {
106         return this.host;
107     }
108     
109     /**
110      * Setter for the instance's host
111      *
112      * @param the new instance's host
113      */

114     public void setHost(String JavaDoc host) {
115         this.host = host;
116     }
117     
118     /**
119      * Getter for the instance's port
120      *
121      * @return the instance's port
122      */

123     public String JavaDoc getPort() {
124         return this.port;
125     }
126     
127     /**
128      * Setter for the instance's port
129      *
130      * @param the new instance's port
131      */

132     public void setPort(String JavaDoc port) {
133         this.port = port;
134     }
135     
136     /**
137      * Getter for the instance's profile path
138      *
139      * @return the instance's profile path
140      */

141     public String JavaDoc getDomainPath() {
142         return this.domainPath;
143     }
144     
145     /**
146      * Setter for the instance's profile path
147      *
148      * @param the new instance's profile path
149      */

150     public void setDomainPath(String JavaDoc domainPath) {
151         this.domainPath = domainPath;
152     }
153     
154     /**
155      * Getter for the path to server's config xml file
156      *
157      * @return the server's config xml file
158      */

159     public String JavaDoc getConfigXmlPath() {
160         return this.configXmlPath;
161     }
162     
163     /**
164      * Setter for the server's config xml file
165      *
166      * @param the new server's config xml file
167      */

168     public void setConfigXmlPath(String JavaDoc configXmlPath) {
169         this.configXmlPath = configXmlPath;
170     }
171     /**
172      * Getter for the server's admin port
173      *
174      * @return the server's admin port
175      */

176     public String JavaDoc getAdminPort() {
177         return adminPort;
178     }
179     /**
180      * Setter for the server's admin port
181      *
182      * @param the server's admin port
183      */

184     public void setAdminPort(String JavaDoc adminPort) {
185         this.adminPort = adminPort;
186     }
187     
188     /**
189      * Getter for the server's default host port
190      *
191      * @return the server's default host port
192      */

193     public String JavaDoc getDefaultHostPort() {
194         return defaultHostPort;
195     }
196     /**
197      * Setter for the server's deafult host port
198      *
199      * @param the server's default host port
200      */

201     public void setDefaultHostPort(String JavaDoc defaultHostPort) {
202         this.defaultHostPort = defaultHostPort;
203     }
204     
205     
206     
207      public String JavaDoc getHttpPort() {
208         return httpPort;
209     }
210     
211     public void setHttpPort(String JavaDoc adminPort) {
212         this.httpPort = httpPort;
213     }
214     /**
215      * An overriden version of the Object's toString() so that the
216      * instance is displayed properly in the combobox
217      */

218     public String JavaDoc toString() {
219         return name + " [" + host + ":" + port + "]"; // NOI18N
220
}
221 }
222
223
Popular Tags