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 |
< |
package uk.ac.ukc.iscream.filtermanager; |
21 |
> |
package uk.org.iscream.cms.server.filtermanager; |
22 |
|
|
23 |
|
//---IMPORTS--- |
24 |
< |
import uk.ac.ukc.iscream.core.*; |
25 |
< |
import uk.ac.ukc.iscream.filter.*; |
26 |
< |
import uk.ac.ukc.iscream.util.*; |
27 |
< |
import uk.ac.ukc.iscream.componentmanager.*; |
24 |
> |
import uk.org.iscream.cms.server.core.*; |
25 |
> |
import uk.org.iscream.cms.server.filter.*; |
26 |
> |
import uk.org.iscream.cms.server.util.*; |
27 |
> |
import uk.org.iscream.cms.server.componentmanager.*; |
28 |
|
import java.net.*; |
29 |
|
import java.io.*; |
30 |
|
import java.util.*; |
114 |
|
getInBound("FILTER"); |
115 |
|
// send info |
116 |
|
String filterList = cp.getProperty(configName, "Host.filter"); |
117 |
< |
Filter filterRef = null; |
117 |
> |
FilterInfo filterInfoRef = null; |
118 |
|
String filter = null; |
119 |
|
StringTokenizer st = new StringTokenizer(filterList, ";"); |
120 |
< |
while (filterRef==null && st.hasMoreTokens()) { |
120 |
> |
while (filterInfoRef==null && st.hasMoreTokens()) { |
121 |
|
filter = st.nextToken(); |
122 |
|
_logger.write(toString(), Logger.DEBUG, " looking for filter- " + filter); |
123 |
|
try { |
124 |
< |
filterRef = FilterHelper.narrow(ReferenceManager.getInstance().getCORBARef("iscream.Filter." + filter)); |
124 |
> |
filterInfoRef = FilterInfoHelper.narrow(ReferenceManager.getInstance().getCORBARef("iscream.FilterInfo." + filter)); |
125 |
|
} catch (ComponentCORBAException e) { |
126 |
|
_logger.write(toString(), Logger.DEBUG, " unable to find filter- " + filter); |
127 |
|
} |
128 |
|
} |
129 |
|
|
130 |
|
// hopefully we found a filter |
131 |
< |
if(filterRef != null) { |
131 |
> |
if(filterInfoRef != null) { |
132 |
|
_logger.write(toString(), Logger.DEBUG, " found filter- " + filter); |
133 |
|
// tell the host about it... |
134 |
< |
_socketOut.println(filterRef.getHostName() + ";" |
135 |
< |
+ filterRef.getUDPPort() + ";" |
136 |
< |
+ filterRef.getTCPPort()); |
134 |
> |
_socketOut.println(filterInfoRef.getHostName() + ";" |
135 |
> |
+ filterInfoRef.getUDPPort() + ";" |
136 |
> |
+ filterInfoRef.getTCPPort()); |
137 |
|
} |
138 |
|
else { |
139 |
|
// ...or throw a wobbly (and tell the host!) |
164 |
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
165 |
|
* method to provide clean logging (every class should have this). |
166 |
|
* |
167 |
< |
* This uses the uk.ac.ukc.iscream.util.NameFormat class |
167 |
> |
* This uses the uk.org.iscream.cms.server.util.NameFormat class |
168 |
|
* to format the toString() |
169 |
|
* |
170 |
|
* @return the name of this class and its CVS revision |