public class FilterSvrInfo
extends java.lang.Object
describes a filter server running somewhere on the network.
Modifier and Type | Field and Description |
---|---|
java.lang.String |
host
name of the machine on which the server is running
|
java.lang.String |
name
the name of the server, derived from the file name from
which the configuration was loaded.
|
int |
port
port number on which the server is listening
|
java.lang.String |
synopsis
a one line description of the server function
|
Constructor and Description |
---|
FilterSvrInfo(java.lang.String name,
java.lang.String synopsis,
java.lang.String host,
int port) |
Modifier and Type | Method and Description |
---|---|
static FilterSvrInfo |
from(java.util.Properties props)
reads the configuration file and returns a
FilterSvrInfo object. |
static FilterSvrInfo |
fromFile(java.lang.String fName)
calls
read() and stores any exception thrown in
the object returned. |
PipelineRequest |
getRequest()
returns a copy of the request object to contact this server.
|
static java.util.Map<java.lang.String,FilterSvrInfo> |
readAll(java.lang.String directory)
assumes that all files with suffix
".svr" in the
given directory are configuration files. |
public final java.lang.String name
public final java.lang.String synopsis
public final java.lang.String host
public final int port
public FilterSvrInfo(java.lang.String name, java.lang.String synopsis, java.lang.String host, int port)
public PipelineRequest getRequest()
returns a copy of the request object to contact this server. The
copy can then be augmented with additional parameters before
making contact. The name of the object returned is identical to
name
.
public static FilterSvrInfo from(java.util.Properties props) throws ServiceCreateException
reads the configuration file and returns a
FilterSvrInfo
object. Try using fromFile(java.lang.String)
to
avoid any exception being thrown.
ServiceCreateException
- if anything goes wrong while reading the
configuration file.public static FilterSvrInfo fromFile(java.lang.String fName) throws java.io.IOException
calls read()
and stores any exception thrown in
the object returned. This allows to keep inoperable objects for
later reference and explanation.
java.io.IOException
- if called methods throw this exceptionpublic static java.util.Map<java.lang.String,FilterSvrInfo> readAll(java.lang.String directory) throws java.io.IOException
assumes that all files with suffix ".svr"
in the
given directory are configuration files. They are read and the
resulting objects are stored in the Map
returned. The basename of the file name is used as a key.
This method does not throw any exceptions. Instead, exceptions
thrown while reading configuration files will end up in
FilterSvrInfo
objects with their field
e
set.
directory
- is the name of the directory where to find
configuration files with suffix ".svr"
java.io.FileNotFoundException
- if the given name does not denote a
directory or cannot be accessed.java.io.IOException