public class PipelineRequest
extends java.lang.Object
Encapsulates a request for contact to a FilterServiceFactory
. In addition to the host and port to contact,
key/value pairs can be added as parameters for that server with
put()
. These key values pairs
will be send to the contacted host as a request.
Objects of this class have a name to support adding parameters by looking up the name in a repository or property set of parameters.
DistPipeFilter
,
DistFilter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KEYRE
is the regular that must be matched by a key passed to
put() . |
Constructor and Description |
---|
PipelineRequest(PipelineRequest other)
returns copy of the given
PipelineRequest . |
PipelineRequest(java.lang.String host,
int port)
calls the three parameter constructor with
name=null . |
PipelineRequest(java.lang.String name,
java.lang.String host,
int port)
creates a
PipelineRequest to contact the given host
on the given port. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
deletes all key/value pairs that were stored with
put() . |
java.lang.String |
getHost()
returns the hostname to contact as it was specified in the
constructor.
|
java.lang.String |
getName()
retuns the name as set with in the constructor or the
string
getHost()+":"+getPort() . |
java.lang.String |
getPort()
returns the port to contact as it was specified in the
constructor.
|
void |
put(java.lang.String key,
java.lang.String value)
add a parameter to this request.
|
void |
putParams(java.util.Map<java.lang.String,java.lang.String> params)
puts all key/value pairs that were stored via
put() into params . |
public static final java.lang.String KEYRE
is the regular that must be matched by a key passed to put()
. Follow the link to below to see the actual value.
public PipelineRequest(java.lang.String name, java.lang.String host, int port)
creates a PipelineRequest
to contact the given host
on the given port. Use put()
to add key/value pairs
to the request.
public PipelineRequest(java.lang.String host, int port)
calls the three parameter constructor with
name=null
.
public PipelineRequest(PipelineRequest other)
PipelineRequest
.public void put(java.lang.String key, java.lang.String value)
add a parameter to this request. The key/value pair is
send upstream as soon as a connection is made with this
object. The key must match the regular expression KEYRE
.
java.lang.IllegalStateException
- if the key does not match KEYRE
.public java.lang.String getName()
retuns the name as set with in the constructor or the
string getHost()+":"+getPort()
.
public java.lang.String getHost()
returns the hostname to contact as it was specified in the constructor.
public java.lang.String getPort()
returns the port to contact as it was specified in the constructor.
public void putParams(java.util.Map<java.lang.String,java.lang.String> params)
puts all key/value pairs that were stored via put()
into params
.
public void clear()
deletes all key/value pairs that were stored with put()
.