public class ConfigurationUtil extends Object
This class cannot be instantiated.
Constructor and Description |
---|
ConfigurationUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
computeCodebase(String name,
String jarFile,
int port)
Convenient three-argument version of
computeCodebase
that will always return a codebase String represented
in standard http protocol format. |
static String |
computeCodebase(String name,
String jarFile,
int port,
String srcRoot,
String mdAlgorithm)
Using the given parameters in the appropriate manner, this method
constructs and returns a
String whose value is a valid
Java RMI codebase specification. |
static String |
computeCodebase(String name,
String jarFile,
String port)
Convenient three-argument version of
computeCodebase
that takes a String value for the port
parameter, always return a codebase String represented
in standard http protocol format. |
static String |
computeCodebase(String name,
String jarFile,
String port,
String srcRoot,
String mdAlgorithm)
Convenience method that ultimately calls the primary 5-argument
version of this method.
|
static String[] |
concat(String[] a,
String[] b)
Concatenates the given
String arrays, returning
the result in a new String array. |
static String[] |
createArgList(String[] prevArgList,
String argString)
Creates and returns a
String array consisting of the
contents of the given prevArgList and the arguments
reference in the given argString . |
public static String[] concat(String[] a, String[] b)
String
arrays, returning
the result in a new String
array.public static String[] createArgList(String[] prevArgList, String argString)
String
array consisting of the
contents of the given prevArgList
and the arguments
reference in the given argString
.
Note that the contents of the argString
parameter is
split
on the RS (record separator) control
character ("\036").
public static String computeCodebase(String name, String jarFile, int port, String srcRoot, String mdAlgorithm) throws IOException
String
whose value is a valid
Java RMI codebase specification. This method returns a
codebase supporting one of two possible protocols: the standard
http protocol, or the Jini httpmd protocol; which
was created to support codebase integrity when running a remote
service configured for secure code downloading.
The mdAlgorithm
parameter is used to indicate to
this method which type of codebase should be constructed and
returned. If null
is input to mdAlgorithm
,
or if it has one of the values "none", "off", or "" (the empty
String
), then this method will construct and returned
a standard HTTP-based codebase; otherwise, an HTTPMD-based codebase
will constructed and returned.
Note that the name
parameter is handled specially by
this method. The value input to that String
parameter
is interpretted in one of two ways by this method:
name
parameter
as a network interface, attempting to determine that interface's
corresponding IP address. Should that attempt fail, then this method
then assumes that the caller intended this parameter to be interpretted
as an IP address or host name; in which case, this method uses
the value of the parameter as the address/host component of
codebase being constructed.
This method is intended to provide a convenient mechanism for constructing a service's codebase from within a Jini configuration file. To support both development and deployment scenarios, it is important to be able to flexibly construct such codebases from either a local network interface specification or from a specification that represents the name of a remote host running a shared codebase class server on the appropriate network.
name
- String
referencing either a network
interface, IP address, or host name, each of which
will be used either to determine the appropriate
value, or as the actual value, for the
address/host component of the returned
codebase.jarFile
- String
value that is used for the
jar component of the returned codebase;
which references the JAR file containing the
downloadable classes that make up the desired
service codebase.port
- int
value that is used for the
port component of the returned codebase;
which is the port on which the class server will
listen for download requests from clients of the
associated service.srcRoot
- String
value that is used when
computing an HTTPMD-based codebase. The value
of this parameter references the root directory
path (or URL of the directory) containing the JAR
file(s) (or class file(s)) containing the
downloadable classes that make up the desired
service codebase. This parameter is typically the
root directory from which the class server will
serve the service's downloadable JAR files.
Note that this parameter is not used in the
construction of the returned codebase if the
mdAlgorithm
parameter is
null
or if it has one of the values
"none", "off", or "" (the empty String
).mdAlgorithm
- String
value indicating the
message digest algorithm to use when constructing
an HTTPMD-based codebase (for example, "sha",
"md5", etc.). Note that if this parameter is
null
, then this method will
contruct an HTTP-based codebase.String
whose value is a valid Java RMI
codebase specification represented in either
standard http protocol format, or Jini httpmd
protocol format.IOException
- if an I/O exception occurs while reading data
from the srcRoot
.NullPointerException
- if null
is input for
name
or jarFile
, and/or
null
is input for srcRoot
when mdAlgorithm
is non-null
and is not equal to "none", "off", or "" (note that if
mdAlgorithm
is null
or equal to
"none", "off", or "", then srcRoot
can take
any value, including null
).IllegalArgumentException
- if the value input for
port
is negtive.public static String computeCodebase(String name, String jarFile, String port, String srcRoot, String mdAlgorithm) throws IOException
String
value for the port to use when constructing
the codebase; which can be useful when invoking this method
from a Jini configuration file.NumberFormatException
- if the value input for port
does not contain a parsable int
.IOException
public static String computeCodebase(String name, String jarFile, int port) throws IOException
computeCodebase
that will always return a codebase String
represented
in standard http protocol format.IOException
public static String computeCodebase(String name, String jarFile, String port) throws IOException
computeCodebase
that takes a String
value for the port
parameter, always return a codebase String
represented
in standard http protocol format.NumberFormatException
- if the value input for port
does not contain a parsable int
.IOException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.