Examples of SOSArguments


Examples of sos.util.SOSArguments

    if(args.length==0 || args[0].equals("-?") || args[0].equals("/?") || args[0].equals("-h")){
      showUsage();
      System.exit(0);
    }
    try {
      SOSArguments arguments = new SOSArguments(args);
      SOSLogger sosLogger;
      String sourceFile="";
      String targetFile="";
      File source=null;
      File target=null;
      int logLevel=0;
      String folderName="Import";
      String logFile = "";
     
      try {
        sourceFile = arguments.as_string("-source=","");
        targetFile = arguments.as_string("-target=");
        logLevel = arguments.as_int("-v=",SOSStandardLogger.INFO);
        logFile = arguments.as_string("-log=","");
        folderName = arguments.as_string("-folder=",folderName);       
      } catch (Exception e1) {
        System.out.println(e1.getMessage());
        showUsage();
        System.exit(0);
      }
      if (logLevel==0) logLevel=SOSLogger.INFO;
      if (logFile.length()>0sosLogger = new SOSStandardLogger(logFile, logLevel);
      else sosLogger = new SOSStandardLogger(logLevel);     
      arguments.check_all_used();
     
      ManagedConverter conv = new ManagedConverter(sosLogger);
      target = new File(targetFile);
      if (sourceFile.length()>0) source = new File(sourceFile);
      conv.convert(source, target, folderName);
View Full Code Here

Examples of sos.util.SOSArguments

    if (sosLogger != null) sosLogger.debug6("connecting to database.. .");

    String dbProperty = props.getProperty("db").replaceAll("jdbc:", "-url=jdbc:");
    dbProperty = dbProperty.substring(dbProperty.indexOf('-'));
   
    SOSArguments dbArguments = new SOSArguments(dbProperty);

    SOSConnection conn =  SOSConnection.createInstance
                   props.getProperty("db_class"),
                   dbArguments.as_string("-class=", ""),
                   dbArguments.as_string("-url=", ""),
                   dbArguments.as_string("-user=", ""),
                   dbArguments.as_string("-password=", ""),
                   sosLogger);
   
    return conn;
  }
View Full Code Here

Examples of sos.util.SOSArguments

  public static SOSConnection getSchedulerConnection(SOSSettings schedulerSettings, SOSLogger log) throws Exception {
    String dbProperty = schedulerSettings.getSection("spooler").getProperty("db").replaceAll("jdbc:", "-url=jdbc:");
    dbProperty = dbProperty.substring(dbProperty.indexOf('-'));
    if (dbProperty.endsWith("-password="))
      dbProperty = dbProperty.substring(0, dbProperty.length() - 10);
    SOSArguments arguments = new SOSArguments(dbProperty);

    SOSConnection conn;
    if (log != null) {
      conn = SOSConnection.createInstance(schedulerSettings.getSection("spooler").getProperty("db_class"), arguments.as_string("-class=", ""),
          arguments.as_string("-url=", ""), arguments.as_string("-user=", ""), arguments.as_string("-password=", ""), log);
    }
    else {
      conn = SOSConnection.createInstance(schedulerSettings.getSection("spooler").getProperty("db_class"), arguments.as_string("-class=", ""),
          arguments.as_string("-url=", ""), arguments.as_string("-user=", ""), arguments.as_string("-password=", ""));
    }

    return conn;
  }
View Full Code Here

Examples of sos.util.SOSArguments

    if(args.length==0 || args[0].equals("-?") || args[0].equals("/?") || args[0].equals("-h")){
      showUsage();
      System.exit(0);
    }
    try {
      SOSArguments arguments = new SOSArguments(args);
     
      String xmlFile="";
      String logFile="";
      int logLevel=0;
      String settingsFile="";
      int template=0;
      int model=0;
      String packages="";
      String jobchains="";
      try {
        xmlFile = arguments.as_string("-file=");
        logLevel = arguments.as_int("-v=",SOSStandardLogger.INFO);
        logFile = arguments.as_string("-log=","");
        settingsFile = arguments.as_string("-settings=","../config/factory.ini");       
        jobchains = arguments.as_string("-jobchain=","");
        packages = arguments.as_string("-package=","");
      } catch (Exception e1) {
        System.out.println(e1.getMessage());
        showUsage();
        System.exit(0);
      }
View Full Code Here

Examples of sos.util.SOSArguments

    SOSConnection userConnection;
    Properties spoolerProp = this.getJobSettings().getSection("spooler");
   
    String dbProperty = spoolerProp.getProperty("db").replaceAll("jdbc:", "-url=jdbc:");
        dbProperty = dbProperty.substring(dbProperty.indexOf('-'));
    SOSArguments arguments = new SOSArguments(dbProperty);
   
    try {
            spooler_log.debug6("..creating user connection object");
           
            userConnection = SOSConnection.createInstance
                spoolerProp.getProperty("db_class"),
                arguments.as_string("-class=", ""),
          arguments.as_string("-url=", ""),
          newUserName,
          password,
          getLogger() );
           
      }   
View Full Code Here

Examples of sos.util.SOSArguments

    if(args.length==0 || args[0].equals("-?") || args[0].equals("-h")){
      showUsage();
      System.exit(0);
    }
    try {
      SOSArguments arguments = new SOSArguments(args);
     
      String xmlFile="";
      String logFile="";
      int logLevel=0;
      String settingsFile="";
      int template=0;
      int model=0;
     
      try {
        xmlFile = arguments.as_string("-file=");
        logLevel = arguments.as_int("-v=",SOSStandardLogger.INFO);
        logFile = arguments.as_string("-log=","");
        settingsFile = arguments.as_string("-settings=","../config/factory.ini");       
        model = arguments.as_int("-jobchain=",-1);
      } catch (Exception e1) {
        System.out.println(e1.getMessage());
        showUsage();
        System.exit(0);
      }
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.