public static synchronized int getThresholds(String context,String server, String property,float[] tmax,float[] tmin)
{
if (tmax == null || tmin == null) return TErrorList.invalid_parameter;
if (tmax.length == 0 || tmin.length == 0) return TErrorList.dimension_error;
TDataType dt = new TDataType(tmax);
TLink tl = new TLink("/"+context+"/"+server+"/#0",property+".TMAX",dt,null,TAccess.CA_READ);
int cc = tl.execute();
tl.close();
int dlen = dt.getCompletionLength();
boolean pifDone = false;
TPropertyQuery[] tpq = null;
switch (cc)
{
default:
return cc;
case TErrorList.link_blacklisted:
case TErrorList.illegal_property:
tpq = getPropertyInformation(context,server,"#0",property);
if (tpq == null) return TErrorList.io_error;
tmax[0] = tpq[0].prpMaxValue;
tmin[0] = tpq[0].prpMinValue;
cc = 0; dlen = 1;
pifDone = true;
case TErrorList.success:
break;
}
if (dlen == 1)
{ // one threshold applies to all elements
for (int i=1; i<tmax.length; i++)
{ // so fill them in ...
tmax[i] = tmax[0];
}
}
dt = new TDataType(tmin);
tl = new TLink("/"+context+"/"+server+"/#0",property+".TMIN",dt,null,TAccess.CA_READ);
cc = tl.execute();
tl.close();
dlen = dt.getCompletionLength();
switch (cc)
{
default:
case TErrorList.illegal_property: