1 |
+ |
/* |
2 |
+ |
* i-scream central monitoring system |
3 |
+ |
* http://www.i-scream.org.uk |
4 |
+ |
* Copyright (C) 2000-2002 i-scream |
5 |
+ |
* |
6 |
+ |
* This program is free software; you can redistribute it and/or |
7 |
+ |
* modify it under the terms of the GNU General Public License |
8 |
+ |
* as published by the Free Software Foundation; either version 2 |
9 |
+ |
* of the License, or (at your option) any later version. |
10 |
+ |
* |
11 |
+ |
* This program is distributed in the hope that it will be useful, |
12 |
+ |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
+ |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
+ |
* GNU General Public License for more details. |
15 |
+ |
* |
16 |
+ |
* You should have received a copy of the GNU General Public License |
17 |
+ |
* along with this program; if not, write to the Free Software |
18 |
+ |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 |
+ |
*/ |
20 |
+ |
|
21 |
|
//---PACKAGE DECLARATION--- |
22 |
< |
package uk.ac.ukc.iscream.filtermanager; |
22 |
> |
package uk.org.iscream.cms.server.filtermanager; |
23 |
|
|
24 |
|
//---IMPORTS--- |
25 |
< |
import uk.ac.ukc.iscream.core.*; |
26 |
< |
import uk.ac.ukc.iscream.filter.*; |
27 |
< |
import uk.ac.ukc.iscream.util.*; |
28 |
< |
import uk.ac.ukc.iscream.componentmanager.*; |
25 |
> |
import uk.org.iscream.cms.server.core.*; |
26 |
> |
import uk.org.iscream.cms.server.filter.*; |
27 |
> |
import uk.org.iscream.cms.server.util.*; |
28 |
> |
import uk.org.iscream.cms.server.componentmanager.*; |
29 |
|
import java.net.*; |
30 |
|
import java.io.*; |
31 |
|
import java.util.*; |
115 |
|
getInBound("FILTER"); |
116 |
|
// send info |
117 |
|
String filterList = cp.getProperty(configName, "Host.filter"); |
118 |
< |
Filter filterRef = null; |
118 |
> |
FilterInfo filterInfoRef = null; |
119 |
|
String filter = null; |
120 |
|
StringTokenizer st = new StringTokenizer(filterList, ";"); |
121 |
< |
while (filterRef==null && st.hasMoreTokens()) { |
121 |
> |
while (filterInfoRef==null && st.hasMoreTokens()) { |
122 |
|
filter = st.nextToken(); |
123 |
|
_logger.write(toString(), Logger.DEBUG, " looking for filter- " + filter); |
124 |
|
try { |
125 |
< |
filterRef = FilterHelper.narrow(ReferenceManager.getInstance().getCORBARef("iscream.Filter." + filter)); |
125 |
> |
filterInfoRef = FilterInfoHelper.narrow(ReferenceManager.getInstance().getCORBARef("iscream.FilterInfo." + filter)); |
126 |
|
} catch (ComponentCORBAException e) { |
127 |
|
_logger.write(toString(), Logger.DEBUG, " unable to find filter- " + filter); |
128 |
|
} |
129 |
|
} |
130 |
|
|
131 |
< |
// hopefully we found a filter |
132 |
< |
if(filterRef != null) { |
131 |
> |
// hopefully we found a filter |
132 |
> |
if(filterInfoRef != null) { |
133 |
|
_logger.write(toString(), Logger.DEBUG, " found filter- " + filter); |
134 |
< |
// tell the host about it... |
135 |
< |
_socketOut.println(filterRef.getHostName() + ";" |
136 |
< |
+ filterRef.getUDPPort() + ";" |
137 |
< |
+ filterRef.getTCPPort()); |
134 |
> |
try { |
135 |
> |
// tell the host about it... |
136 |
> |
_socketOut.println(filterInfoRef.getHostName() + ";" |
137 |
> |
+ filterInfoRef.getUDPPort() + ";" |
138 |
> |
+ filterInfoRef.getTCPPort()); |
139 |
> |
} |
140 |
> |
catch(org.omg.CORBA.COMM_FAILURE e) { |
141 |
> |
// failed to talk to filter, lets signal an error |
142 |
> |
_socketOut.println("ERROR"); |
143 |
> |
throw new IOException("error communicating with filter - " + e); |
144 |
> |
} |
145 |
|
} |
146 |
|
else { |
147 |
|
// ...or throw a wobbly (and tell the host!) |
172 |
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
173 |
|
* method to provide clean logging (every class should have this). |
174 |
|
* |
175 |
< |
* This uses the uk.ac.ukc.iscream.util.NameFormat class |
175 |
> |
* This uses the uk.org.iscream.cms.server.util.NameFormat class |
176 |
|
* to format the toString() |
177 |
|
* |
178 |
|
* @return the name of this class and its CVS revision |