Package de.desy.tine.startup

Examples of de.desy.tine.startup.TInitializer


  public void dumpHistoryManifest()
  {
    int nHistoryRecords = gLclHstList.size();
    THistoryRecord hst = null;
    THistorySpecification spc = null;
    TInitializer initializer = TInitializerFactory.getInstance().getInitializer();
    String eqm = getLocalName();
    String filename = initializer.getFecHome()+File.separator+eqm;
    String nl = System.getProperty("line.separator");
    try
    {
      new File(filename).mkdirs();
      filename += File.separator+"hstmf.csv";
View Full Code Here


  public int restorePropertyValues(String prpName,TDataType target)
  {
    if (prpName == null || target == null) return TErrorList.invalid_parameter;
    TExportProperty prp = propertyList.getFirstProperty(prpName);
    if (prp == null) return TErrorList.illegal_property;
    TInitializer initializer = TInitializerFactory.getInstance().getInitializer();
    String fn = initializer.getFecHome();
    String filename = prpName+"-settings.csv";
    csv csvFile = null;
    if (moduleName != null) csvFile = new csv(fn+File.separator+moduleName+File.separator+filename);
    if (csvFile == null || !csvFile.fileAvailable())
      csvFile = new csv(fn+File.separator+filename);
View Full Code Here

    {
      ArrayList<String>alst = prp.getDeviceList();
      String[] dlst = (alst != null) ?
          alst.toArray(new String[0]) :
          deviceList.getDeviceNameList();
      TInitializer initializer = TInitializerFactory.getInstance().getInitializer();
      String fn = initializer.getFecHome()+File.separator;
      if (moduleName != null && new File(fn+moduleName+File.separator).exists())
        fn += moduleName+File.separator;
      String filename = fn + prpName+"-settings.csv";
      String nl = System.getProperty("line.separator");
      FileWriter fw = new FileWriter(filename);
View Full Code Here

        }
      }   
      return 0;
    }
    // no fec.xml : look for exports.csv ...
    TInitializer initializer = TInitializerFactory.getInstance().getInitializer();
    // register the csv database structure:
    csvColumn[] expCols = new csvColumn[26];
    expRowHndlr expRows = new expRowHndlr(getLocalName());
    expCols[0] = new csvColumn("EXPORT_NAME","",new expXnHndlr(expRows));
    expCols[1] = new csvColumn("LOCAL_NAME","",new expLnHndlr(expRows,getLocalName()));
    expCols[2] = new csvColumn("PROPERTY","",new expPrpHndlr(expRows));
    expCols[3] = new csvColumn("DESCRIPTION","",new expPrpDescHndlr(expRows));
    expCols[4] = new csvColumn("PROPERTY_SIZE","",new expPrpSizeHndlr(expRows));
    expCols[5] = new csvColumn("FORMAT","",new expPrpFmtHndlr(expRows));
    expCols[6] = new csvColumn("PROPERTY_INSIZE","",new expPrpInSizeHndlr(expRows));
    expCols[7] = new csvColumn("INFORMAT","",new expPrpInFmtHndlr(expRows));
    expCols[8] = new csvColumn("PROPERTY_ID","",new expPrpIdHndlr(expRows));
    expCols[9] = new csvColumn("ACCESS","READ",new expPrpAccessHndlr(expRows));
    expCols[10] = new csvColumn("REDIRECTION","",new expPrpRdrHndlr(expRows));
    expCols[11] = new csvColumn("GROUP","",new expGrpHndlr());
    expCols[12] = new csvColumn("GROUP_INDEX","",new expGrpIdxHndlr());
    expCols[12] = new csvColumn("GROUP_DEVICE_PREFIX","",new expGrpPrefixHndlr());
    expCols[13] = new csvColumn("GROUP_DEVICE_POSTFIX","",new expGrpPostfixHndlr());
    expCols[14] = new csvColumn("CONTEXT","",new expCtxHndlr());
    expCols[15] = new csvColumn("SUBSYSTEM","",new expCtxHndlr());
    expCols[16] = new csvColumn("MASTER","",new expMstrHndlr());
    expCols[17] = new csvColumn("SLAVE_MASTER","",new expSlavHndlr());
    expCols[18] = new csvColumn("NUM_DEVICES","",new expNumDevsHndlr(expRows));
    expCols[19] = new csvColumn("MAX_VALUE","0",new expMaxValueHndlr(expRows,false));
    expCols[20] = new csvColumn("MIN_VALUE","0",new expMinValueHndlr(expRows,false));
    expCols[21] = new csvColumn("UNITS","",new expUnitsHndlr(expRows,false));
    expCols[22] = new csvColumn("XMAX_VALUE","0",new expMaxValueHndlr(expRows,true));
    expCols[23] = new csvColumn("XMIN_VALUE","0",new expMinValueHndlr(expRows,true));
    expCols[24] = new csvColumn("XUNITS","",new expUnitsHndlr(expRows,true));
    expCols[25] = new csvColumn("ACCESS_DEADBAND","",new expDbaHndlr(expRows));
    // open it
    csv expFile = new csv(initializer.getExportsResource(eqmName));
    // read it
    int rc = expFile.readFile(expCols,expRows);
    // close it
    expFile.close()
    if (rc != TErrorList.no_such_file)
View Full Code Here

    return false;
  }
  public boolean getRegisteredUsersFromCsv(LinkedList<String> usrsLst,LinkedList<String> grpsLst,String tag)
  {
    if (tag != null && tag.length() > 0 && !scanForUsersFiles()) return false;
    TInitializer initializer = TInitializerFactory.getInstance().getInitializer();
    // register the csv database structure:
    csvColumn[] usrCols = new csvColumn[1];
    //usrRowHndlr usrRows = new usrRowHndlr(getLocalName());
    usrCols[0] = new csvColumn("USER_NAME","",new usrNameHndlr(usrsLst));
    // open it
    csv usrFile = new csv(initializer.getUsersResource(moduleName,tag));
    // read it
    int rc = usrFile.readFile(usrCols);
    // close it
    usrFile.close();
    if (rc == 0) return true;
View Full Code Here

    return false;
  }
  public boolean getRegisteredGroupMembersFromFile(LinkedList<String> grpsLst,String grp)
  {
    if (grp == null || grp.length()== 0) return false;
    TInitializer initializer = TInitializerFactory.getInstance().getInitializer();
    // register the csv database structure:
    csvColumn[] usrCols = new csvColumn[1];
    //usrRowHndlr usrRows = new usrRowHndlr(getLocalName());
    usrCols[0] = new csvColumn("USER_NAME","",new usrNameHndlr(grpsLst));
    // open it
    csv grpFile = new csv(initializer.getGroupsResource(moduleName,grp));
    // read it
    int rc = grpFile.readFile(usrCols);
    // close it
    grpFile.close();
    if (rc == 0) return true;
View Full Code Here

    return getRegisteredNetsFromCsvFile(lst,tag);
  }
  public boolean getRegisteredNetsFromCsvFile(LinkedList<String> lst,String tag)
  {
    if (tag != null && tag.length() > 0 && !scanForNetsFiles()) return false;
    TInitializer initializer = TInitializerFactory.getInstance().getInitializer();
    // register the csv database structure:
    csvColumn[] netsCols = new csvColumn[1];
    //usrRowHndlr usrRows = new usrRowHndlr(getLocalName());
    netsCols[0] = new csvColumn("SUBNET","",new subnetNameHndlr(lst));
    // open it
    csv netsFile = new csv(initializer.getNetsResource(moduleName,tag));
    // read it
    int rc = netsFile.readFile(netsCols);
    // close it
    netsFile.close();
    if (rc == 0) return true;
View Full Code Here

        }
      }   
      return 0;
    }
    // no fec.xml : look for alarms.csv ...
    TInitializer initializer = TInitializerFactory.getInstance().getInitializer();
    // register the csv database structure:
    csvColumn[] almCols = new csvColumn[11];
    almDefRowHndlr almRows = new almDefRowHndlr();
    almCols[0] = new csvColumn("ALARM_TAG","",new StringFieldHandler(almRows,"tag"));
    almCols[1] = new csvColumn("ALARM_CODE","",new IntFieldHandler(almRows,"code"));
    almCols[2] = new csvColumn("ALARM_MASK","",new IntFieldHandler(almRows,"mask"));
    almCols[3] = new csvColumn("SEVERITY","",new ShortFieldHandler(almRows,"severity"));
    almCols[4] = new csvColumn("DATA_FORMAT","",new FormatFieldHandler(almRows,"dataFormat"));
    almCols[5] = new csvColumn("DATA_ARRAYSIZE","",new IntFieldHandler(almRows,"dataSize"));
    almCols[6] = new csvColumn("ALARM_TEXT","READ",new StringFieldHandler(almRows,"text"));
    almCols[7] = new csvColumn("DEVICE_TEXT","",new StringFieldHandler(almRows,"deviceText"));
    almCols[8] = new csvColumn("DATA_TEXT","",new StringFieldHandler(almRows,"dataText"));
    almCols[9] = new csvColumn("URL","",new StringFieldHandler(almRows,"url"));
    almCols[10] = new csvColumn("ALARM_SYSTEM","",new IntFieldHandler(almRows,"system"));
    // open it
    csv almDefsFile = new csv(initializer.getAlmDefinitionResource(getLocalName()));
    // read it
    int rc = almDefsFile.readFile(almCols,almRows);
    // close it
    almDefsFile.close()
    if (rc != TErrorList.no_such_file)
View Full Code Here

        }
      }   
      return 0;
    }
    // no fec.xml : look for devices.csv ...
    TInitializer initializer = TInitializerFactory.getInstance().getInitializer();
    csv devNamesFile = new csv(initializer.getDevicesResource(getLocalName()));
    int rc = devNamesFile == null ?
        TErrorList.file_error :
        getRegisteredDevicesFromFile(devNamesFile,new devNameRowHndlr());
    if (rc != TErrorList.no_such_file)
      TFecLog.log("get device names from " + getLocalName() + "-devices.csv : " + TErrorList.errorString[rc]);
View Full Code Here

      TFecLog.log("get device names from " + getLocalName() + "-devices.csv : " + TErrorList.errorString[rc]);
    return rc;
  }
  public int getRegisteredNamesFromPropertyFile(String propertyName)
  {
    TInitializer initializer = TInitializerFactory.getInstance().getInitializer();
    TExportProperty prp = propertyList.getFirstProperty(propertyName);
    String devFileName = propertyName + "-names.csv";
    csv devNamesFile = new csv(initializer.getFecHome()+File.separator+getLocalName()+File.separator+devFileName);
    int rc = devNamesFile == null ?
        TErrorList.file_error :
        getRegisteredDevicesFromFile(devNamesFile,new devNameRowHndlr(prp));
    if (rc == TErrorList.no_such_file)
    {
      devNamesFile = new csv(initializer.getFecHome()+File.separator+devFileName);
      rc = devNamesFile == null ?
          TErrorList.file_error :
          getRegisteredDevicesFromFile(devNamesFile,new devNameRowHndlr(prp));
    }
    if (rc != TErrorList.no_such_file)
View Full Code Here

TOP

Related Classes of de.desy.tine.startup.TInitializer

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.