1 |
+ |
/* |
2 |
+ |
* i-scream central monitoring system |
3 |
+ |
* Copyright (C) 2000-2002 i-scream |
4 |
+ |
* |
5 |
+ |
* This program is free software; you can redistribute it and/or |
6 |
+ |
* modify it under the terms of the GNU General Public License |
7 |
+ |
* as published by the Free Software Foundation; either version 2 |
8 |
+ |
* of the License, or (at your option) any later version. |
9 |
+ |
* |
10 |
+ |
* This program is distributed in the hope that it will be useful, |
11 |
+ |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
+ |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
+ |
* GNU General Public License for more details. |
14 |
+ |
* |
15 |
+ |
* You should have received a copy of the GNU General Public License |
16 |
+ |
* along with this program; if not, write to the Free Software |
17 |
+ |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 |
+ |
*/ |
19 |
+ |
|
20 |
|
//---PACKAGE DECLARATION--- |
21 |
|
|
22 |
|
//---IMPORTS--- |
27 |
|
|
28 |
|
/** |
29 |
|
* Configurator object for the JavaHost |
30 |
< |
* Will connect to the configurator manager and collect its specific |
30 |
> |
* Will connect to the filter manager and collect its specific |
31 |
|
* configuration |
32 |
|
* |
33 |
|
* @author $Author$ |
81 |
|
//---PUBLIC METHODS--- |
82 |
|
|
83 |
|
public InetAddress getFilterName(){ |
84 |
< |
// will return the most recient IP address (if it is dynamic for whatever reason |
84 |
> |
// will return the most recent IP address (if it is dynamic for whatever reason) |
85 |
|
try { |
86 |
|
return InetAddress.getByName(filterName); |
87 |
|
} |
95 |
|
/** |
96 |
|
* Used to retrieve the port to send UDP packets to on the filter |
97 |
|
* |
98 |
< |
* @return an integer corrisponding to the UDP port of the filter |
98 |
> |
* @return an integer corresponding to the UDP port of the filter |
99 |
|
*/ |
100 |
|
public int getFilterUDPPort(){ |
101 |
|
|
105 |
|
/** |
106 |
|
* Used to retrieve the port to send TCP heartbeats to on the filter |
107 |
|
* |
108 |
< |
* @return an integer corrisponding to the TCP of the filter |
108 |
> |
* @return an integer corresponding to the TCP of the filter |
109 |
|
*/ |
110 |
|
public int getFilterTCPPort(){ |
111 |
|
|
137 |
|
Socket mySocket; |
138 |
|
configChanged = false; |
139 |
|
|
140 |
< |
System.out.println("Establishing connection with config manager"); |
140 |
> |
System.out.println("Establishing connection with filter manager"); |
141 |
|
|
142 |
|
// might throw a UnknownHostException |
143 |
|
try { |
150 |
|
// everything is fine |
151 |
|
// sendCommand("LASTMODIFIED"); |
152 |
|
lastModified = sendCommand("LASTMODIFIED"); |
153 |
< |
|
153 |
> |
|
154 |
|
fileList = sendCommand("FILELIST"); |
155 |
+ |
|
156 |
+ |
fQDN = sendCommand("FQDN"); |
157 |
|
// get all the properties |
158 |
|
if ( numProperties > 0 ){ |
159 |
|
// sendCommand("CONFIG"); |
177 |
|
|
178 |
|
// close the socket |
179 |
|
mySocket.close(); |
180 |
< |
System.out.println("Completed communication with config manager"); |
180 |
> |
System.out.println("Completed communication with filter manager"); |
181 |
|
|
182 |
|
} |
183 |
|
catch ( UnknownHostException e ){ |
266 |
|
private boolean configChanged; |
267 |
|
private String lastModified; |
268 |
|
private String fileList; |
269 |
+ |
private String fQDN; |
270 |
|
private int numProperties; |
271 |
|
private HashMap myProperties; |
272 |
|
private String filterName; |
281 |
|
|
282 |
|
//---STATIC ATTRIBUTES--- |
283 |
|
|
284 |
< |
} // class |
284 |
> |
} // class |