Examples of TLink


Examples of de.desy.tine.client.TLink

    char[] st = new char[32];
    TDataType dout = new TDataType(st);
    int cc = TErrorList.address_unknown;
    try
    {
      TLink tl = new TLink(target,"SRVSTARTTIME",dout,null,TAccess.CA_READ);
      cc = tl.execute(timeout,true);
      tl.close();
      if (output && cc == 0) System.out.println("running since "+new String(st));
    }
    catch (Exception e)
    {
      // just swallow it ...
View Full Code Here

Examples of de.desy.tine.client.TLink

    String prp = "CONFIGURATION";
    if (group != null) prp += "." + group;
    prp += ".NAM";
    TDataType dout = new TDataType(views);
    String dname = "/" + context + "/HISTORY";
    TLink tl = new TLink(dname,prp,dout,null,TAccess.CA_READ);
    if (tl.executeAndClose(1000) != 0) return null;
    int len = dout.getCompletionLength();
    if (len == 0) return null;
    HstView[] list = new HstView[len];
    for (int i=0; i<len; i++) list[i] = new HstView(views[i]);
    return list;
View Full Code Here

Examples of de.desy.tine.client.TLink

    if (context == null || server == null) return 0;
    return getNumberOf("PROPERTIES", "/"+context+"/"+server, timeout);
  }
  private static synchronized TPropertyQuery[] getPropertyInformation(String stockprop,String context,String server,String device,String property,int timeout) throws IOException
  {
    TLink tl = null;
    TDataType dout, din;
    int cc = 0, i;
    String tgt, dev;
    TPropertyQuery[] tpq = null;
    TPropertyQuery tpq0 = new TPropertyQuery();
    boolean hasTarget = true;
    byte[] blob = hByteBlob;

    if (server == null || server.length() == 0)
    {
      MsgLog.log("getPropertyInformation", "argument list error",TErrorList.argument_list_error,null,0);
      return null;
    }
    if (device == null || device.length() == 0)
      dev = new String("#0");
    else
      dev = device;
    if (context == null || context.length() == 0)
      tgt = new String("/DEFAULT/" + server + "/" + dev);
    else
      tgt = new String("/" + context + "/" + server + "/" + dev);
    if (property == null || property.compareTo("*") == 0)
    {
      hasTarget = false;
      din = new TDataType();
      //String target = "/" + context + "/" + server;
      int np = nicePropertyQuerySize;
      try
      {
        np = getNumberOf("PROPERTIES", tgt, timeout);
      }
      catch (Exception e)
      {
        MsgLog.log("getPropertyInformation",e.toString(),TErrorList.connection_timeout,e,0);
        throw new IOException("Could not acquire property information for " + server + " (" + e.toString() + ")");
      }
      blob = new byte[2 * np * TPropertyQuery.sizeInBytes]; // allow room for overloads
    }
    else
    {
      if (TQuery.isStockProperty(property))
      {
        stockprop = "STOCKPROPS";
      }
      din = new TDataType(property);
    }
    dout = new TDataType(blob,"PRPQSr4");
    try
    {
      tl = new TLink(tgt,stockprop,dout,din,TAccess.CA_READ);
      cc = tl.execute(timeout,true);
      srvAddr = tl.srvAddr;
      if ((cc & TErrorList.CE_SENDDATA) == TErrorList.CE_SENDDATA) cc = 0;
      tl.close();
    }
    catch (Exception e)
    {
      MsgLog.log("getPropertyInformation", e.toString(),cc,e,0);
      cc = TErrorList.address_unknown;
      if (tl != null) tl.close();
    }
    if (cc == 0) // it's at lease a 4.0 server
    {     
      try
      {
View Full Code Here

Examples of de.desy.tine.client.TLink

    String prp = "CONFIGURATION";
    if (group != null) prp += "." + group;
    prp += ".NAM";
    TDataType din = new TDataType(list);
    String dname = "/" + context + "/HISTORY";
    TLink tl = new TLink(dname,prp,null,din,TAccess.CA_WRITE);
    return tl.executeAndClose(800);
  }
View Full Code Here

Examples of de.desy.tine.client.TLink

    if (context == null) return null;
    NAME64[] prps = new NAME64[100];
    TDataType dtprps = new TDataType(prps);
    String dname = "/" + context + "/HISTORY";
    String dprop = "CONFIGURATION.*";
    TLink tl = new TLink(dname,dprop,dtprps,null,TAccess.CA_READ);
    int cc = tl.execute(800, true);
    tl.close();
    if (cc != 0)
    { // TODO: throw an exception here
      return null;
    }
    int len = dtprps.getCompletionLength();
View Full Code Here

Examples of de.desy.tine.client.TLink

  private static ServerQuery[] getXTagList(String context,String tagtype,String subsys,String importance,int timeout)
  {
    int cc,n,i;
    TDataType dout;
    TDataType din;
    TLink tl;
    StringBuffer host = new StringBuffer(32);
    StringBuffer query = new StringBuffer(32);
    short[] numout = new short[1];
    TDataType numoutData = new TDataType(numout);
    NAME16[] inplist = new NAME16[2];
    USTRING[] taglist;
    ServerQuery[] strlist;
    boolean isFecRequest = tagtype.compareToIgnoreCase("FECS") == 0;

    if (subsys == null || subsys.length() == 0)
    {
      inplist[0] = new NAME16("ALL");
    }
    else
    {
      inplist[0] = new NAME16(subsys);
    }
    if (importance == null || importance.length() == 0)
    {
      inplist[1] = new NAME16("ALL");   
    }
    else
    {
      inplist[1] = new NAME16(importance);
    }
    din = new TDataType(inplist);
   
    host.delete(0,31); query.delete(0,31);
    if (context != null && context.length() != 0)
    {
      host.insert(0,"ENS/" + context);
    }
    else
    {
      host.insert(0,"ENS");
    }
    query.insert(0,"N" + tagtype);
    try
    {
      tl = new TLink(host.toString(),query.toString(),numoutData,din,TAccess.CA_READ);
      cc = tl.execute(timeout,true);
      srvAddr = tl.srvAddr;
      tl.close();
    }
    catch (Exception e)
    {
      MsgLog.log("getXTagList", e.getMessage(),TErrorList.non_existent_elem,e,0);
      cc = TErrorList.non_existent_elem;
    }
    if (cc != 0) return null;
    if (numout[0] == 0 && subsys != null && subsys.length() > 0) numout[0] = 100;
    // Get Tags from name server (synchronous call)
    query.delete(0,31);
    query.insert(0,tagtype);
    n = numout[0];
    taglist = new USTRING[n];
    for (i=0; i<n; i++) taglist[i] = new USTRING();
    if (taglist.length == 0) return null;
    if (numout[0] > taglist.length) numout[0] = (short)taglist.length; 
    dout = new TDataType(taglist);
    tl = new TLink(host.toString(),query.toString(),dout,din,TAccess.CA_READ);
    cc = tl.execute(TLink.defaultTimeout,true);
    tl.close();
    if (cc != 0) return null;
    strlist = new ServerQuery[n];
    int zidx, cntr=0;
    String srv;
    for (i=0; i<n; i++)
View Full Code Here

Examples of de.desy.tine.client.TLink

    if (!isInitialized) initCfgs();
    TDataType dtcfg = new TDataType(cfgs);
    String dname = "/" + context + "/HISTORY/" + name;
    String dprop = "CONFIGURATION";
    if (group != null && group.length() > 0) dprop += "." + group;
    TLink tl = new TLink(dname,dprop,dtcfg,null,TAccess.CA_READ);
    int cc = tl.execute(800, true);
    tl.close();
    if (cc != 0)
    { // TODO: throw an exception here
      DbgLog.log("getViewerConfiguration",TErrorList.getErrorString(cc));
      return null;
    }
View Full Code Here

Examples of de.desy.tine.client.TLink

    if (!isInitialized) initCfgs();
    TDataType dtcfg = new TDataType(hstCfgs);
    String dname = "/" + context + "/HISTORY/" + name;
    String dprop = "CONFIGURATION";
    if (group != null && group.length() > 0) dprop += "." + group;
    TLink tl = new TLink(dname,dprop,null,dtcfg,TAccess.CA_WRITE);
    return tl.executeAndClose(800);
  }
View Full Code Here

Examples of de.desy.tine.client.TLink

  {
    short[] lvals = new short[2];
    lvals[0] = (short)lockType.ordinal();
    lvals[1] = (short)1;
    TDataType din = new TDataType(lvals);
    TLink lnk = new TLink("/"+context+"/"+server,"ACCESSLOCK",null,din,TAccess.CA_WRITE|TAccess.CA_RETRY);
    int rc = lnk.execute(TLink.defaultTimeout,true);
    lnk.close();
    return rc;
  }
View Full Code Here

Examples of de.desy.tine.client.TLink

    if (context == null || name == null) return TErrorList.argument_list_error;
    if (!isInitialized) initCfgs();
    TDataType dtcfg = new TDataType(hstCfgs);
    String dname = "/" + context + "/HISTORY/" + name;
    String dprop = "CONFIGURATION.TRACE";
    TLink tl = new TLink(dname,dprop,null,dtcfg,TAccess.CA_WRITE);
    return tl.executeAndClose(800);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.