10320/loc Handle Type
For handles with multiple URL values, the Proxy Server (or web browser plug-in) simply selects the first URL value in the list of values returned by the handle resolution. Because the order of that list is nondeterministic, there is no intelligent selection of a URL to which the client would be redirected. The 10320/loc handle value type was developed to improve the selection of specific resource URLs and to add features to the handle-to-URL resolution process. (Note that the prefix '10320' has been set aside for handle application types.)
Type 10320/loc specifies an XML-formatted handle value that contains a list of locations. Each location has a set of associated attributes that help determine if or when that location is used. The overall list of locations can include hints for how the resolving client should select a location, including an ordered set of selection methods. Resolvers can apply each known selection method, in order, to choose a location based on the resolver's context (the HTTP request in the case of the proxy server) and the attributes of each location.
The attributes for the set of locations, as well as each location entry in the set, are open-ended to allow for future capabilities to be added in a backwards-compatible way. A small number of attributes have been defined as "standard" that all resolvers should understand.
At the top level of the XML structure are the following defined attributes:
For each location the following attributes are defined:
The currently defined selection methods are:
The Proxy will iterate over the known selection methods, in order, until a single location has been selected. After each iteration the Proxy will take one of four steps:
For handle 20.5555/1234, with a value type 10320/loc that has this list of location attributes:
<locations> <location id="0" href="http://uk.example.com/" country="gb" weight="0" /> <location id="1" href="http://www1.example.com/" weight="1" /> <location id="2" href="http://www2.example.com/" weight="1" /> </locations> |
the following selections could be made:
Reference: 20.5555/1234 from a client located in the UK
Result: The "country" selection method selects the first location based on the 'country' attribute of the first location and the client's position.
Reference: 20.5555/1234 from a client located outside the UK
Result: The "country" selection method removes the first location from consideration based on its 'country' attribute and chooses one of the last two locations using the "weighted" random selection method.
Reference: 20.5555/1234?locatt=id:1
Result: The second location is used based on the "locatt" selection method and the 'id' attribute.
Reference: 20.5555/1234?locatt=id:0
Result: The first location is used based on the "locatt" selection method and the 'id' attribute. The resolver never gets to the "country" selection method as the "locatt" selection method resulted in only a single matching location.
Reference: 20.5555/1234?locatt=country:uk
Result: The first location is used based on the "locatt" selection method and the 'country' attribute.
Reference: 20.5555/1234?locatt=country:us
Result: The "country" selection method removes the first location from consideration based on its 'country' attribute, finds no US-specific location, and chooses one of the last two locations using the "weighted" random selection method.
November 20, 2015