|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gloin.resource.protocol.jrap.JrapURLParser
Provides a parsing utility for Jini Resource Access Protocol (JRAP) URLs. This utility parses JRAP url strings according to the JRAP URL schema defined below.
JRAPv0.01 urls have two major sections:
The file component of a JRAP url plays no role in looking up
ResourceAccess
services.
ResourceAcccess
services. JRAP url queries
follow a '?' as they do in other url formats supported by
java.net.URL
. JRAP queries continue to the end of
JRAP url strings.
-1
JRAP urls must always start with the following string,
"jrap:///"
JRAP URL queries are formatted as follows:
JRAP queries are composed of variables. Variables consist of a tag followed by the string '={'. This string marks the beginning of a variable value. A variable value is terminated by a '}' character. The value string can contain formats which are specific to the variable tag. JRAP query variables are separated by commas.
The following variable tags are supported:
groups
ResourceAccess
service referenced by a
JRAP url is registered. The value of the groups variable has
the following format:
group1,group2,...
String group names are separated by commas.
sid
sid
variable causes a JRAP URL to refer to the
specific Jini service registered with the exact service id
listed in the value of the sid
variable. The
value of an sid
variable is formatted according to
the method
net.jini.core.lookup.ServiceID.toString()
. A
single JRAP URL can only contain one sid
variable.
locators
locators
variable directs a JRAP
URL handler to discover Jini services using
LookupLocators
created from host:port
pairs contained in the value of the locators variable which is
formatted as follows:
host:port,host1:port1,...
The host and port of a pair are separated by a ':' and different pairs are separated by commas.
Attribute Variables
net.jini.lookup.entry
. When a Jini
service template is created from a JRAP URL which contains
attribute variables, entry objects will be created for the
classes named as follows:
net.jini.lookup.entry.<TagName>
for each
attribute variable. The entry objects will be added to the
attribute set of the service template used to lookup a
ResourceAccess
service for the JRAP URL.
Attribute variable values are all formatted according to the
constructor parameters of corresponding entry classes. Each
value consists of class field values separated by commas. The
following attribute variable tags are supported:
Tag name: | Value: |
Name | name |
Address | street,organization, organizationalUnit,locality, stateOrProvince,postalCode, country |
Comment | comment |
Location |
floor,room,building |
ServiceInfo |
name,manufacturer,vendor, version,model,serialNumber |
Query variable tags and values can only contain the following characters: [a-z],[A-Z],[], complete list forthcoming
Example JRAP URL:
jrap:///directory/service-dl.jar?\ sid={00000000-0045-0000-0000-000000000045},\ groups={public,workgroup,management},\ locators={host1:port1,host2:port2},\ Name={myService},\ ServiceInfo={phone-service,acme-corp,baz.com,1.1,zx11,345}
Field Summary | |
static int |
DEFAULT_PORT
|
Constructor Summary | |
JrapURLParser(java.lang.String spec)
Constructs a JRAP URL parser from the supplied URL formatted string spec parameter. |
|
JrapURLParser(java.lang.String file,
net.jini.core.lookup.ServiceID srvcID,
java.lang.String[] groups,
net.jini.core.discovery.LookupLocator[] locators,
net.jini.core.entry.Entry[] knownAttrs)
Constructs a JRAP URL parser from the supplied parameter JRAP URL components. |
|
JrapURLParser(java.net.URL url)
Constructs a JRAP URL parser from the supplied url
parameter. |
Method Summary | |
boolean |
equals(java.lang.Object other)
|
java.lang.String |
getFile()
|
java.lang.String[] |
getGroups()
|
java.lang.String |
getHost()
|
net.jini.core.lookup.ServiceID |
getID()
|
net.jini.core.entry.Entry[] |
getKnownAttributes()
|
net.jini.core.discovery.LookupLocator[] |
getLocators()
|
int |
getPort()
|
java.lang.String |
getQuery()
|
net.jini.core.lookup.ServiceTemplate |
getServiceTemplate()
|
int |
hashCode()
|
boolean |
sameService(java.lang.Object other)
Tell if two JrapURLParsers refer to the same logical service, without regard to referenced files. |
int |
sameServiceCode()
|
void |
setFile(java.lang.String file)
|
void |
setGroups(java.lang.String[] groups)
|
void |
setID(net.jini.core.lookup.ServiceID srvcID)
|
void |
setKnownAttributes(net.jini.core.entry.Entry[] knownAttrs)
|
void |
setLocators(net.jini.core.discovery.LookupLocator[] locators)
|
java.lang.String |
toString()
Return a string form of this parser |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int DEFAULT_PORT
Constructor Detail |
public JrapURLParser(java.lang.String spec) throws java.net.MalformedURLException
spec
parameter.JRAP
- URL formatted stringpublic JrapURLParser(java.lang.String file, net.jini.core.lookup.ServiceID srvcID, java.lang.String[] groups, net.jini.core.discovery.LookupLocator[] locators, net.jini.core.entry.Entry[] knownAttrs) throws java.net.MalformedURLException
file
- the file component of this parsersrvcID
- the Jini service ID component of this parsergroups
- the Jini lookup groups component of this parsergroups
- the Jini lookup locators component of this parsergroups
- the Jini lookup service template attributes
component of this parserpublic JrapURLParser(java.net.URL url) throws java.net.MalformedURLException
url
parameter.Method Detail |
public int hashCode()
hashCode
in class java.lang.Object
public int sameServiceCode()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public boolean sameService(java.lang.Object other)
public java.lang.String getFile()
public java.lang.String getHost()
public int getPort()
public java.lang.String[] getGroups()
public net.jini.core.lookup.ServiceID getID()
public net.jini.core.entry.Entry[] getKnownAttributes()
public java.lang.String getQuery()
public net.jini.core.lookup.ServiceTemplate getServiceTemplate()
public void setFile(java.lang.String file)
public void setGroups(java.lang.String[] groups)
public void setID(net.jini.core.lookup.ServiceID srvcID)
public void setKnownAttributes(net.jini.core.entry.Entry[] knownAttrs)
public net.jini.core.discovery.LookupLocator[] getLocators()
public void setLocators(net.jini.core.discovery.LookupLocator[] locators)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |