[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Handle-info] several urls resolution order
Hi Konstantin,
On Jul 14, 2007, at 1:45 AM, Konstantin Rekk wrote:
Hello,
following idea: there might be several repräsentations of one object
(example: one Object Repository -> several Webrepresentations
belonging
to different Projects rendering the Object to their needs), so there
would be several URLs registered under same handle (does such szenario
make sense?).
I would like to ask two questions about this:
1) Which URL is used for redirect by default?
The first URL in the list returned by the storage/database is used,
but you shouldn't expect that behavior to continue. It is supposed
to be non-deterministic and at any time it could change.
( BTW: I tried to figure out how the rollback is done during this
execution:
--- snippet: net.handle.server.SQLHandleStorage.java ---------------
...
in case of a succesful deleteHandle() execution will be followed by an
createHandle()-failure ... but couldn't. Have I overlooked some
detail? )
That would be a bad situation. This should be changed to use
transactions.
2) If I would change the HTTP-Proxy Code for instance to redirect to
random URL from this set of URLs - would that be visible to the global
resolution server (may be setting short ttl to reduce caching)? Has
somebody implemented similiar features? Would be intresting to see
examples of "pimped proxies" ;-) if there are any.
Changes to the HTTP proxy code would only be visible to clients that
use that proxy. Since the proxy is a client to the handle system,
the global handle servers wouldn't see it.
However, we are close to rolling out a new handle proxy feature that
implements a much improved way to associate multiple URLs per
handle. The new method involves a new handle value type that
describes a simple XML structure containing a set of locations. The
handle value can also describe an ordered set of methods to use when
choosing a single location. These methods include:
- by country/location
- by attributes that were passed as resolution parameters
- weighted random selection
If the XML structure doesn't specify the ordering for the selection
method then the proxy or client uses their default (parameter,
country, then weighted random).
Each location has an href attribute but can also have attributes such
as country and weight that help determine which one is selected.
Here's an example:
<locations chooseby="locatt,country,weighted">
<location id=0 href="http://example.com/uk" country="gb" weight=0 />
<location id=1 href="http://example.com/notuk" weight=1 />
<location id=2 href="http://www.cnri.reston.va.us/" weight=1 />
</locations>
When the (not yet released) proxy resolves a handle with values of
this specific type (currently CNRI.RSRC_LOC) it will see if any
parameters passed in the proxy URL refer to a specific value. If so,
it will redirect the client to that value. If there is no match (or
more than one) the proxy checks for a match between the "country"
attribute and the country of the client's IP address. if there is a
single match, then a redirect is sent. Failing an exact match, a URL
is selected at random from the remaining values, but subject to the
weight attribute.
I hope to have a write-up available on this soon, but if you are
interested I can try and come up with something informal sooner.
Thanks,
Sean
_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info