A
Selector implementation that matches on various components of a full URI.
The
UriSelector will explode a URI into its component parts. If you use the following as a selector:
reactor.on(U("scheme://host/path"), ...);
Then any
java.net.URI or String that matches those elements will be matched.
It's not an exact string match but a match on components because you can pass parameters in the form of a query
string. Consider the following example:
reactor.on(U("tcp://*:3000/topic"), consumer);
This means "match any URIs using scheme 'tcp' to port '3000' for the path '/topic' irregardless of host". When a URI
is sent as the key to a notify like this:
reactor.notify("tcp://user:ENCODEDPWD@192.168.0.10:3000/topic?param=value"), event);
The match will succeed and the headers will be set as follows:
-
scheme: "tcp"
-
authorization: "user:ENCODEDPWD@192.168.0.10:3000"
-
userInfo: "user:ENCODEDPWD"
-
host: "192.168.0.10"
-
port: "3000"
-
path: "/topic"
-
fragment:
null
-
query: "param=value"
-
param: "value"
Wildcards can be used in place of
host, and
path. The former by replacing the host with '*' and the
latter by replacing the path with '/*'.