Environment: <%=D1Client.getCN().getNodeBaseServiceUrl() %>
<% // disable the local cache for these requests Settings.getConfiguration().setProperty("D1Client.useLocalCache", false); // get the PID from the request if it is there Identifier pid = null; if (request.getParameter("pid") != null) { pid = new Identifier(); pid.setValue(request.getParameter("pid")); } %> <% if (pid != null) { %>Resolve results for <%=pid.getValue() %>
<% String errorMsg = null; ObjectLocationList objectLocationList = null; try { objectLocationList = D1Client.getCN().resolve(null, pid); } catch (Exception e) { errorMsg = e.getMessage(); } if (objectLocationList != null) { %> <% for (ObjectLocation objectLocation: objectLocationList.getObjectLocationList()) { NodeReference node = objectLocation.getNodeIdentifier(); String getString = "unavailable"; try { // TODO: check the stream for content? InputStream result = D1Client.getMN(node).get(null, pid); if (result != null) { getString = "success"; } } catch (Exception e) { // crudely report an error getString = "" + e. getClass().getName() + " - "+ e.getMessage() + ""; } String systemMetadataString = "unavailable"; try { // TODO: more useful part of SM to display? SystemMetadata sm = D1Client.getMN(node).getSystemMetadata(null, pid); if (sm != null) { systemMetadataString = "{" + sm.getChecksum().getAlgorithm() + "}" + sm.getChecksum().getValue(); } } catch (Exception e) { // crudely report an error systemMetadataString = "
" + e. getClass().getName() + " - "+ e.getMessage() + ""; } // TODO: log count String logString = "check not implemented"; %> <% } %>
Location | Get | System Metadata | Log |
---|---|---|---|
<%=node.getValue() %> | <%=getString %> | <%=systemMetadataString %> | <%=logString %> |
Other nodes that may contain the object
<% // show results for all other nodes NodeList nodeList = D1Client.getCN().listNodes(); if (nodeList!= null) { List" + e. getClass().getName() + ""; getString += "
" + e.getMessage() + ""; } String systemMetadataString = "unavailable"; try { // TODO: more useful part of SM to display? SystemMetadata sm = D1Client.getMN(node).getSystemMetadata(null, pid); if (sm != null) { systemMetadataString = "{" + sm.getChecksum().getAlgorithm() + "}" + sm.getChecksum().getValue(); } } catch (Exception e) { // crudely report an error systemMetadataString = "
" + e. getClass().getName() + ""; systemMetadataString += "
" + e.getMessage() + ""; } // TODO: log count String logString = "check not implemented"; %>
Location | Get | System Metadata | Log |
---|---|---|---|
<%=node.getValue() %> | <%=getString %> | <%=systemMetadataString %> | <%=logString %> |
<%=errorMsg %>
<% } } %>