public class WebClientBuilder extends ClientBuilder
ProcessBuilder
instance. A special small tools are designed for Linux / Windows OS in order to spawn the
process on the OS user account. Both tools are written in C using specific OS API and are
build as executable using ant native target. The source code and the make file for this tools
are available in the /src/native process directory. The password is provided vis stdin
redirection on both platforms. The command line parameters for the spawned process are
constructed from default parameters stored in directory and some specific parameters stored
inside a WebClientBuilderParameters
structure.Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CLIENT_OPTS_SRC_ADDR
Token to inform the client about passing extra options via socket.
|
private java.util.List<java.lang.String> |
command2Socket
A collection of command line tokens to pass to client via socket.
|
private ServerKeyStore |
serverKeyStore
Server key store
|
(package private) java.net.ServerSocket |
soSnd
Server socket to pass options to spawned client.
|
private boolean |
useSocket2PassOptions
Flag indicating we are going to pass extra options to Web client via socket.
|
command, config, remote
Constructor and Description |
---|
WebClientBuilder(ClientBuilderParameters config)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addClientOptions()
Add terminal options.
|
ServerKeyStore |
getServerKeyStore()
Get server key store
|
protected java.util.List<java.lang.String> |
getSpawnArguments()
Get the spawn arguments.
|
java.lang.Process |
localStart(java.util.Map<java.lang.String,java.lang.String> env)
Spawn's new local Java process.
|
private void |
prepareWebClientOptions()
Preparing server side socket to pass extra client options.
|
BrokerSpawnResult |
remoteStart(java.lang.String dedicatedUser,
Brokers brokers,
java.util.Map<java.lang.String,java.lang.String> env)
Spawn's new remote Java process.
|
private void |
sendWebClientOptions()
Optionally sending extra client options via socket.
|
getCommand, initNativeSecureConnection, removeCommand
private ServerKeyStore serverKeyStore
protected static final java.lang.String CLIENT_OPTS_SRC_ADDR
private java.util.List<java.lang.String> command2Socket
private boolean useSocket2PassOptions
java.net.ServerSocket soSnd
public WebClientBuilder(ClientBuilderParameters config)
config
- The specific parameters for this client.public ServerKeyStore getServerKeyStore()
public java.lang.Process localStart(java.util.Map<java.lang.String,java.lang.String> env) throws java.io.IOException
localStart
in class ClientBuilder
env
- A map with environment variables for temporary account.java.io.IOException
- If something goes wrong.public BrokerSpawnResult remoteStart(java.lang.String dedicatedUser, Brokers brokers, java.util.Map<java.lang.String,java.lang.String> env) throws java.io.IOException
remoteStart
in class ClientBuilder
dedicatedUser
- The dedicated user associated with the host on which the spawned client
will be runbrokers
- List of brokers.env
- A map with environment variables for temporary account.java.io.IOException
- If something goes wrong.protected void addClientOptions()
addClientOptions
in class ClientBuilder
protected java.util.List<java.lang.String> getSpawnArguments()
spawn
tool using the
spawn 0 <user> <workdir> <command> [args]
syntax.
As these arguments are already built into the ClientBuilder.command
list, it just
returns the already build list with a "1" prefix.
getSpawnArguments
in class ClientBuilder
private void sendWebClientOptions()
private void prepareWebClientOptions()