{ // not a call to a central archive server
tryAlternateProperty = true;
if (!isArchiveQueryProperty(property))
pname = pname + ".HIST"; // meta extension not given, try this ...
}
TLink tl = new TLink(dname,pname,dout,din,TAccess.CA_READ);
cc = tl.executeAndClose(timeout);
if (cc == TErrorList.un_allocated && tryAlternateProperty)
{
String[] hists = getArchivedProperties(context,server);
if (hists != null)
{ // there are histories available ....
if (isScheduledProperty(rname))
{ // look for unscheduled alternative
for (String h : hists)
{
if (rname.startsWith(h))
{
pname = h+".HIST";
tl = new TLink(dname,pname,dout,din,TAccess.CA_READ);
cc = tl.executeAndClose(timeout);
break;
}
}
}
else
{ // look for scheduled alternative
for (String h : hists)
{
if (isScheduledProperty(h))
{
if (h.startsWith(rname))
{
pname = h+".HIST";
tl = new TLink(dname,pname,dout,din,TAccess.CA_READ);
cc = tl.executeAndClose(timeout);
break;
}
}
}
}
}
}
if (cc != 0 && isCentralArchiver(server))
{ // special 2nd chance !
if (isArchiveQueryProperty(property))
{
pname = rname + ".ARCH";
}
else
{
pname = new String(property) + ".ARCH";
}
tl = new TLink(dname,pname,dout,din,TAccess.CA_READ);
cc = tl.executeAndClose(timeout);
}
return cc == 0 ? dout.getCompletionLength() : -cc;
}