Package de.desy.tine.client

Examples of de.desy.tine.client.TLink


      if (!isArchiveQueryProperty(property))
        pname = pname + ".HIST"; // meta extension not given, try this ...
    }
    try
    {
      TLink tl = new TLink(dname,pname,dout,din,TAccess.CA_READ);
      cc = tl.execute(timeout, true);
      tl.close();
    }
    catch (UnresolvedAddressException e)
    {
      cc = TErrorList.address_unresolved;
    }
View Full Code Here


    {
      if (isCentralArchiveServer(server) || isCentralArchiver(server))
      { // call to a central archive server
        String[] keysrcs = new String[100];
        dout = new TDataType(keysrcs);
        TLink tl = new TLink(dname,"KEYWORD.SOURCE",dout,null,TAccess.CA_READ);
        cc = tl.executeAndClose(timeout);
        if (cc == 0)
        {
          int len =dout.getCompletionLength();
          if (len < 100) keysrcs = Arrays.copyOf(keysrcs, len);
          src = keysrcs;
View Full Code Here

      { // call to a central archive server
      FLTFLT[] dtols = new FLTFLT[1];
        dtols[0] = tols;
        din = new TDataType(startstop);
        dout = new TDataType(dtols);
        TLink tl = new TLink(dname,"KEYWORD.TOLERANCE",dout,din,TAccess.CA_READ);
        cc = tl.executeAndClose(timeout);
      }
      else
      {
        THistoryRecordStruct[] hrs = new THistoryRecordStruct[1];
        hrs[0] = new THistoryRecordStruct();
        din = new TDataType(property);
        dout = new TDataType(hrs);
        TLink tl = new TLink(dname,"HISTORIES",dout,din,TAccess.CA_READ);
        cc = tl.executeAndClose(timeout);
        if (cc == 0)
        {
          tols.f1val = hrs[0].getAbsoluteTolerance();
          tols.f2val = hrs[0].getPercentTolerance();
        }
View Full Code Here

   * @return A string array containing a list of meta properties
   * as obtained from the given device server
   */
  public static String[] getMetaProperties(String context,String server,String device,String property)
  {
    TLink tl;
    TDataType dout;
    TDataType din;
    String tgt;
    int cc = 0,n = 0,i,j;
    NAME64[] properties;
    String[] strprops;

    tgt = new String("/" + context + "/" + server + "/" + device);
    try
    {
      TPropertyQuery[] pq = getStockPropertyInformation(context,server,device,"METAPROPS");
      if (pq != null) {
        n = pq[0].prpSize;
      }
    }
    catch (Exception e)
    {
      return null;
    }
    if (n <= 0) return null;
    if (n*32 > maxQueryBufferSize) n = maxQueryBufferSize/32;
    properties = new NAME64[n];
    for (i=0; i<n; i++) properties[i] = new NAME64();
    dout = new TDataType(properties);
    if (property != null) din = new TDataType(property); else din = null;
    properties_have_query_function = false;
    tl = new TLink(tgt,"METAPROPS",dout,din,TAccess.CA_READ);
    cc = tl.execute(TLink.defaultTimeout,true);
    if ((cc & TErrorList.CE_SENDDATA) == TErrorList.CE_SENDDATA)
    {
      if ((cc & TErrorList.has_query_function) == TErrorList.has_query_function)
      {
        properties_have_query_function = true;
      }
      cc = 0;
    }
    tl.close();
    if (cc == 0)
    {
      for (i=0,n=0; i<properties.length; i++) if (properties[i].name.length() > 0) n++;
      strprops = new String[n];
      for (i=0,j=0; j<n && i<properties.length; i++)
      {
        if (properties[i].name.length() == 0) continue;
        strprops[j++] = properties[i].name;
      }
      return strprops;
    }
    else if (cc != TErrorList.link_not_open)
    {
      if (lastQueriedContext == context && lastQueriedServer == server &&
          lastQueriedDevice == device && lastQueriedServer != null)
      {
        cc = 0;
      }
      else
      {
        hLegacyByteBlob = new byte[n * PropertyQuery.sizeInBytes];
        dout = new TDataType(hLegacyByteBlob,"");
        tl = new TLink(tgt,"METAPROPS",dout,din,TAccess.CA_READ);
        cc = tl.execute(TLink.defaultTimeout,false);
        tl.close();
      }
      if (cc == 0)
      {
        lastQueriedContext = context;
        lastQueriedServer = server;
View Full Code Here

    else
    {
      isActive = null;
      dout = new TDataType(data);
    }
    TLink tl = new TLink(dname,"RECORD.CMTS",dout,din,TAccess.CA_READ);
    int cc = tl.executeAndClose(timeout);
    if (cc != 0) return -cc;
    int n = dout.getCompletionLength();
    if (isActive != null)
    {
      for (int i=0; i<n; i++)
View Full Code Here

    char[] cmt = new char[1024];
    dout = new TDataType(cmt);

    String dname = new String("/"+context+"/HISTORY/"+property+"@"+(int)target);

    TLink tl = new TLink(dname,"RECORD.CMT",dout,null,TAccess.CA_READ);
    int cc = tl.executeAndClose(timeout);
    if (cc != 0) return cc;
    int len = dout.getCompletionLength();
    data[0] = new String(cmt,0,len);
    return 0;
  }
View Full Code Here

      din = new TDataType(text.toCharArray());
    }
    String keepString = keepAlive ? "[KEEPALIVE]" : "";
    String dname = new String("/"+context+"/HISTORY/"+property+"@"+(int)targetTime+keepString);

    TLink tl = new TLink(dname,"RECORD.CMT",null,din,TAccess.CA_WRITE);
    return tl.executeAndClose(timeout);
  }
View Full Code Here

    if (!isCentralArchiveServer(server))
    { // not a call to a central archive server
      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.execute(timeout, true);
    tl.close();
    if (cc != 0 && isCentralArchiver(server))
    { // special 2nd chance !
      if (isArchiveQueryProperty(property))
      {
        pname = getQueryPropertyRoot(property) + ".ARCH";
      }
      else
      {
        pname = new String(property) + ".ARCH";
      }
      tl = new TLink(dname,pname,dout,din,TAccess.CA_READ);
      cc = tl.execute(timeout, true);
      tl.close();
    }
    return cc == 0 ? dout.getCompletionLength() : -cc;
 
View Full Code Here

  {
    DeviceNamesQueryParams dnqp = getDeviceNamesQueryProperty(context,server,property,null,timeout);
    if (dnqp == null) return null;
    int n = dnqp.size;

    TLink tl;
    TDataType dout;
    int cc = 0,i,j;
    String tmp;
    NAME16[] devices;
    String[] strdevs;

    //if (n*16 > maxQueryBufferSize) n = maxQueryBufferSize/16;
    devices = new NAME16[n];
    for (i=0; i<n; i++) devices[i] = new NAME16();
    if (devices.length == 0) return null;
    if (n == 1)
    { // server claimed not to have device names ?
      devices[0].name = "#0";
    }
    dout = new TDataType(devices);
    tl = new TLink(dnqp.target,dnqp.property,dout,null,TAccess.CA_READ);
    cc = tl.execute(timeout,true);
    tl.close();
   
    if ((cc & TErrorList.CE_SENDDATA) == TErrorList.CE_SENDDATA)
    {
      if ((cc & TErrorList.has_query_function) == TErrorList.has_query_function)
      {
View Full Code Here

        ntries = 2;
      }
    }
    for (int i=0; i<ntries; i++)
    {
      TLink tl = new TLink(dname,pname[i],dout,din,TAccess.CA_READ);
      cc = tl.execute(2000, true);
      targetTime[0] = tl.getLastDataTimeStamp();
      tl.close();
      if (cc == 0 && dout.getCompletionLength() > 0) break;
    }
    return cc;
 
View Full Code Here

TOP

Related Classes of de.desy.tine.client.TLink

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.