Package de.desy.tine.dataUtils

Examples of de.desy.tine.dataUtils.TDataType


  public static TServerSettings getServerSettings(String fullServerName)
  {
    if (fullServerName == null) return null;
    TServerSettings[] tss = new TServerSettings[1];
    tss[0] = new TServerSettings();
    TDataType tssd = new TDataType(tss);
    TLink tl = new TLink(fullServerName,"SRVSETTINGS",tssd,null,TAccess.CA_READ);
    if (tl.executeAndClose(TLink.defaultTimeout) == 0)
    {
      return tss[0];
    }
View Full Code Here


  public static TWriteAccessInfo[] getServerCommandList(String fullServerName)
  {
    if (fullServerName == null) return null;
    TWriteAccessInfo[] twai = new TWriteAccessInfo[100];
    for (int i=0; i<100; i++) twai[i] = new TWriteAccessInfo();
    TDataType d = new TDataType(twai);
    TLink tl = new TLink(fullServerName,"SRVCOMMANDS",d,null,TAccess.CA_READ);
    if (tl.executeAndClose(TLink.defaultTimeout) == 0)
    {
      int len = d.getCompletionLength();
      TWriteAccessInfo[] ra = (len < 100) ? Arrays.copyOf(twai, len) : twai;
      return ra;
    }
    DbgLog.log("getServerCommandList","error : " + tl.linkStatus);
    return null;
View Full Code Here

    {
      if (fec.info != null) return fec.info;
    }
    String os, desc, loc, hdw, ver, resp;
    char[] fi = new char[FECINFO_BASESIZE];
    TDataType fid = new TDataType(fi);
    if (frontEndComputer.startsWith("ENS#")) frontEndComputer = "ENS";
    TLink tl = new TLink("ENS/FEC.EXT",frontEndComputer,fid,null,TAccess.CA_READ);
    if (tl.executeAndClose(TLink.defaultTimeout) == 0)
    {
      int off = 0;
View Full Code Here

  private static String[] getDeviceProperties16(String context,String server,String device,String property,int timeout) throws IOException
  {
    String tgt = getNamesQueryTarget(context,server,device);
    if (tgt == null) return null;
    TLink tl;
    TDataType dout;
    TDataType din;
    int cc = 0,n,i,j;
    NAME32[] properties;
    String[] strprops;

    n = getNumberOf("PROPS",tgt);
    if (n <= 0) return null;
    if (n*32 > maxQueryBufferSize) n = maxQueryBufferSize/32;
    properties = new NAME32[n];
    for (i=0; i<n; i++) properties[i] = new NAME32();
    if (properties.length <= 0) return null;
    dout = new TDataType(properties);
    if (property != null) din = new TDataType(property); else din = null;
    properties_have_query_function = false;
    try
    {
      tl = new TLink(tgt,"PROPS",dout,din,TAccess.CA_READ);
      cc = tl.execute(TLink.defaultTimeout,true);
      tl.close();
      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;
      }
    }
    catch (Exception e)
    {
      MsgLog.log("getDeviceProperties16", e.getMessage(),TErrorList.non_existent_elem,e,0);
      cc = TErrorList.host_not_resolved;
    }
    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,"PROPS",dout,din,TAccess.CA_READ);
        cc = tl.execute(TLink.defaultTimeout,false);
        tl.close();
      }
      if (cc == 0)
View Full Code Here

  {
    // "SERVER.DB"
    if (context == null) return null;
    if (!isInitialized) initStructs();
    for (CasDb p : databases) p.clear();
    TDataType dtdb = new TDataType(databases);
    String dname = "/" + context + "/CAS";
    TLink tl = new TLink(dname,"SERVER.DB",dtdb,null,TAccess.CA_READ);
    if (tl.executeAndClose(1000) != 0) throw new IOException(tl.getLastError());
    int len = dtdb.getCompletionLength();
    CasDb[] results = new CasDb[len];
    for (int i=0; i<len; i++) results[i] = new CasDb(databases[i]);
    return results;
  }
View Full Code Here

 
  public static int setServerList(String context,CasDb[] dbItems) throws IOException
  {
    if (context == null || dbItems == null) return TErrorList.argument_list_error;
    if (!isInitialized) initStructs();
    TDataType dtrecs = new TDataType(dbItems);
    String dname = "/" + context + "/CAS";
    TLink tl = new TLink(dname,"SERVER.DB",null,dtrecs,TAccess.CA_WRITE);
    int cc = tl.executeAndClose(2000);
    if (cc == TErrorList.connection_timeout || cc == TErrorList.link_timeout)
      throw new IOException(tl.getLastError());
View Full Code Here

  {
    //"ACTION.DB"
    if (context == null || server == null) return null;
    if (!isInitialized) initStructs();
    for (CasAction p : actions) p.clear();
    TDataType dtact = new TDataType(actions);
    String dname = "/" + context + "/CAS/" + server;
    TLink tl = new TLink(dname,"ACTION.DB",dtact,null,TAccess.CA_READ);
    if (tl.executeAndClose(1000) != 0) throw new IOException(tl.getLastError());
    int len = dtact.getCompletionLength();
    CasAction[] results = new CasAction[len];
    for (int i=0; i<len; i++) results[i] = new CasAction(actions[i]);
    return results;
  }
View Full Code Here

  }
  public static int setActionList(String context,String server,CasAction[] actionItems) throws IOException
  {   
    if (context == null || actionItems == null || server == null) return TErrorList.argument_list_error;
    if (!isInitialized) initStructs();
    TDataType dtrecs;
    if (actionItems.length == 0) {
      dtrecs = new TDataType();
    } else {
      dtrecs = new TDataType(actionItems);
    }
    String dname = "/" + context + "/CAS/" + server;
    TLink tl = new TLink(dname,"ACTION.DB",null,dtrecs,TAccess.CA_WRITE);
    int cc = tl.executeAndClose(2000);
    if (cc == TErrorList.connection_timeout || cc == TErrorList.link_timeout)
View Full Code Here

  public static CasAlarmSys[] getAlarmSystemList(String context) throws IOException
  {
    if (context == null) return null;
    if (!isInitialized) initStructs();
    for (CasAlarmSys p : systems) p.clear();
    TDataType dtact = new TDataType(systems);
    String dname = "/" + context + "/CAS";
    TLink tl = new TLink(dname,"ALMSYSTEM.DB",dtact,null,TAccess.CA_READ);
    if (tl.executeAndClose(1000) != 0) throw new IOException(tl.getLastError());
    int len = dtact.getCompletionLength();
    CasAlarmSys[] results = new CasAlarmSys[len];
    for (int i=0; i<len; i++) results[i] = new CasAlarmSys(systems[i]);
    return results;
  }
View Full Code Here

  }
  public static int setAlarmSystemList(String context,CasAlarmSys[] dbItems) throws IOException
  {
    if (context == null || dbItems == null) return TErrorList.argument_list_error;
    if (!isInitialized) initStructs();
    TDataType dtrecs = new TDataType(dbItems);
    String dname = "/" + context + "/CAS";
    TLink tl = new TLink(dname,"ALMSYSTEM.DB",null,dtrecs,TAccess.CA_WRITE);
    int cc = tl.executeAndClose(2000);
    if (cc == TErrorList.connection_timeout || cc == TErrorList.link_timeout)
      throw new IOException(tl.getLastError());
View Full Code Here

TOP

Related Classes of de.desy.tine.dataUtils.TDataType

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.