{
if (validity == null)
{
try
{
DSpaceValidity validity = new DSpaceValidity();
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
if (dso != null)
validity.add(dso);
BrowseInfo info = getBrowseInfo();
// Are we browsing items, or unique metadata?
if (isItemBrowse(info))
{
// Add the browse items to the validity
for (BrowseItem item : (java.util.List<BrowseItem>) info.getResults())
{
validity.add(item);
}
}
else
{
// Add the metadata to the validity
for (String[] singleEntry : browseInfo.getStringResults())
{
validity.add(singleEntry[0]+"#"+singleEntry[1]);
}
}
this.validity = validity.complete();
}
catch (Exception e)
{
// Just ignore all errors and return an invalid cache.
}