[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Handle-info] several urls resolution order
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?
Using the DBTool I found that the index is not influencing this, but a
kind of order how value-records are written to the database
using:
---- snippet: HandleStorage.java -----------------------------
/*********************************************************************
* Replace the handle value that has the same index as the given
handle
* value with the given handle value.
*********************************************************************/
public void updateValue(byte handle[], HandleValue value[])
throws HandleException;
-------------------------------------------------------------------
.. implemented by SQLHandleStorage using:
------- snippet ----------------------------------------------------
private String CREATE_HDL_STMT =
"insert into handles ( handle, idx, type, data, ttl_type, ttl, "+
"timestamp, refs, admin_read, admin_write, pub_read, pub_write)
values "+
"( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
------------------------------------------------------------------------
( BTW: I tried to figure out how the rollback is done during this
execution:
--- snippet: net.handle.server.SQLHandleStorage.java ---------------
/*********************************************************************
* Replace the current values for the given handle with new values.
*********************************************************************/
public synchronized void updateValue(byte handle[], HandleValue
values[])
throws HandleException
{
if(readOnly) throw new
HandleException(HandleException.STORAGE_RDONLY,
"Server is read-only");
if(!handleExists(handle))
throw new HandleException(HandleException.HANDLE_DOES_NOT_EXIST);
boolean success = false;
Throwable e = null;
try {
deleteHandle(handle);
createHandle(handle, values);
} catch (Exception sqlExc) {
e = sqlExc;
}
if(e!=null) {
throw new HandleException(HandleException.INTERNAL_ERROR,
"Error updating values: "+e);
}
}
-----------------------------------------------------
in case of a succesful deleteHandle() execution will be followed by an
createHandle()-failure ... but couldn't. Have I overlooked some
detail? )
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.
Thanks a lot!
Konstantin
_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info