Package sos.util

Examples of sos.util.SOSStandardLogger


    }
   
  // HttpSend Objekt mit SOSStandardLogger erzeugen
    try {
     
      httpsend = new SOSHttpPost(url, new SOSStandardLogger(0));
     
    } catch (Exception x) {
      System.err.println("Error: "+x.getMessage());
      System.exit(-1);
    }
View Full Code Here


   */
    public void doImport() throws Exception {
         
      try {
          if( _logLevel == 0){
              _sosLogger = new SOSStandardLogger(SOSStandardLogger.DEBUG);
            }
          else{
              _sosLogger = new SOSStandardLogger( _logFile.toString(), _logLevel );
          }
         
          _sosConnection   = SOSConnection.createInstance( _configFile.toString(), _sosLogger );
          _sosConnection.connect();
         
View Full Code Here

     
      int logLevel = 0;
      if (args.length > 4) logLevel = Integer.parseInt(args[4]);
     
      SOSImportProcessor processor = new SOSImportProcessor( args[0],
                                     new SOSStandardLogger(logLevel) );

     File inputFile = new File(args[1]);
     if (args.length > 2) processor.setFileSpec(args[2]);
     if (args.length > 3) processor.setUpdate(args[3].equals("1"));
     processor.process(inputFile)
View Full Code Here

     * @param connection connected Connection object (from a connection pool)
     * @throws java.lang.Exception
     */
    public SOSConnection(Connection connection) throws Exception {

        this(connection, new SOSStandardLogger(new NullBufferedWriter(
                new OutputStreamWriter(System.out)), SOSStandardLogger.DEBUG9));

    }
View Full Code Here

     * @throws java.lang.Exception
     * @see #SOSConnection(String, String, String, String, SOSLogger)
     * @see #SOSConnection(String, String, String, String)
     */
    public SOSConnection(String configFileName) throws Exception {
      this(configFileName, new SOSStandardLogger(new NullBufferedWriter(
                new OutputStreamWriter(System.out)),
                SOSStandardLogger.DEBUG9));
    }
View Full Code Here

     *            database password
     * @throws java.lang.Exception
     */
    public SOSConnection(String driver, String url, String dbuser,
            String dbpassword) throws Exception {
      this(driver, url, dbuser, dbpassword,new SOSStandardLogger(new NullBufferedWriter(
                new OutputStreamWriter(System.out)), SOSStandardLogger.DEBUG9));
    }
View Full Code Here

                        && (_executeQuery == null || _executeQuery.equals(""))) { throw new Exception(
                        "undefined operation for export. Check please input for your -tables or -execute arguments"); }
            }

            if (_logLevel == 0) {
                _sosLogger = new SOSStandardLogger(SOSStandardLogger.DEBUG);
            } else {
                _sosLogger = new SOSStandardLogger(_logFile.toString(),
                        _logLevel);
            }

            _sosConnection = SOSConnection.createInstance(_configFile
                    .toString(), _sosLogger);
View Full Code Here

    if (args.length > 3)
      logLevel = Integer.parseInt(args[3]);

    SOSConnectionFileProcessor processor = new SOSConnectionFileProcessor(
        args[0], (SOSLogger) new SOSStandardLogger(logLevel));

    File inputFile = new File(args[1]);

    if (args.length > 2)
      processor.setFileSpec(args[2]);
View Full Code Here

      testFtpProfileShell.setText("Test FTP Profile");
      testFtpProfileShell.setSize(452, 309);
      testFtpProfileShell.setFocus();


      final SOSLogger  logger = new SOSStandardLogger(SOSLogger.DEBUG9);

     
      final FTPProfilePicker ftpProfilePicker = new FTPProfilePicker(testFtpProfileShell,           
          SWT.NONE,
          new java.io.File("c:/scheduler/config/factory_test.ini")
      );

      ftpProfilePicker.addEmptyItem();
      ftpProfilePicker.setLogger(logger);

      ftpProfilePicker.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));


      //butConnect dient nur zum Testen
      final Button butConnect = new Button(testFtpProfileShell, SWT.NONE);
      //hier: Listener, wenn ein neuer Profile aus dem Combobox ausgew�hlt wird
      ftpProfilePicker.addSelectionListener((new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          System.out.println("test 2");
          try {
            butConnect.setEnabled( ftpProfilePicker.getSelectedFTPProfile() != null);
          } catch (Exception ex) {
            //tu nix
          }
        }
      }));
     


      butConnect.setLayoutData(new GridData());
      butConnect.setEnabled( ftpProfilePicker.getSelectedFTPProfile() != null);
      final Label label1 = new Label(testFtpProfileShell, SWT.NONE);
      butConnect.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          sos.net.SOSFileTransfer sosfileTransfer = null;


          try {
            label1.setText("try to connect..");
           
            //2a.
            FTPProfile profile1 = ftpProfilePicker.getSelectedFTPProfile();

            if(profile1 == null) {
              logger.warn("Please define first a Profile");
              return;
            }

            //Verbindung zum FTP Server aufbauen
            sosfileTransfer = profile1.connect();
           
           
           
            //M�gliche aufrufen zum holen von Dateien
           
            /*String l = profile1.openFile("/home/test/temp/1.txt", "1");
           
            System.out.println("Datei per FTP holen und in Verzeichnis(=profile1.getRoot() + 1) ablegen: " + l);
           
            //dritte Parameter steht f�r append
            long j = sosfileTransfer.getFile("/home/test/temp/1.txt", "c:/temp/1/1.txt", false);
            System.out.println("Datei per FTP holen und in Verzeichnis(=c:/temp/1/1.txt) ablegen: Bytes " + j);
           
            long s = profile1.getFile("/home/test/temp/1.txt", "c:/temp/live/2.txt");
            System.out.println("Datei per FTP holen und in Verzeichnis(=c:/temp/1/2.txt) ablegen: " + s);
           
            long k = profile1.getFile("/home/test/temp/1.txt", new java.io.File("c:/temp/1/2212.txt"));
            System.out.println("Datei per FTP holen und in Verzeichnis ablegen: Bytes " + k);
           
            long m = profile1.appendFile("/home/test/temp/1.txt", "c:/temp/1/2.txt");
            System.out.println("Datei per FTP holen und in die Datei c:/temp/1/2.txt hinten anh�ngen: Bytes " + j);
           
           
            long z = profile1.saveAs("c:/temp/config/1.txt", "1.txt");
            System.out.println("Datei (c:/temp/config/1.txt) per FTP Transfer senden und " +
                " in die Datei getRoot() + 2.txt speichern: Bytes " + j);
           
            long x = profile1.saveAs("c:/temp/config/1.txt", "/home/test/temp/test/222222221.txt");
            System.out.println("Datei (c:/temp/config/1.txt) per FTP Transfer senden und " +
                " als /home/test/temp/test/222222221.txt speichern: Bytes " + x);
                */
            /*if(profile1.isConnect()) {
              //entweder                                                     
              profile1.saveAs("c:/temp/config/1.txt", "1.txt");
              java.util.Vector v0 = profile1.getList();
              for(int i = 0; i < v0.size(); i++) {
                logger.info(i + "\t vector v0 file: " + v0.get(i));
              }
              //oder
              java.util.Vector v1 = profile1.getList("/home/test/temp/test/folder1/live");
              for(int i = 0; i < v1.size(); i++) {
                logger.info(i + "\t vector v1 file: " + v1.get(i));
              }

              //oder
              sosfileTransfer.putFile("c:/temp/config/1.txt", "1.txt");
            } else {
              System.out.println("no connection");
            }
            */

            /*
                if(sosfileTransfer instanceof sos.net.SOSFTP) {
                  sos.net.SOSFTP  ftp  = (sos.net.SOSFTP)sosfileTransfer;                 
                }else if (sosfileTransfer instanceof sos.net.SOSSFTP) {
                  sos.net.SOSSFTP sftp = (sos.net.SOSSFTP)sosfileTransfer;                                   
                }
             */

            logger.info("------------> is Connected: " + sosfileTransfer.isConnected());
           
            if(profile1.isConnect())
              label1.setText("successfully connected with.." + ftpProfilePicker.getSelectedProfilename());
            else
              label1.setText("connecting failed" );
View Full Code Here

        changeUser = getWholeArgument(line.getOptionValues("changeuser"));
      }     
           
      jobTimeout = line.getOptionValue("timeout");
      if (logLevel==0) logLevel=SOSLogger.INFO;
      sosLogger = new SOSStandardLogger(logLevel);     
           
      target = new File(targetFile);
      source = new File(sourceFile);
     
      CronConverter cc = new CronConverter(sosLogger);
View Full Code Here

TOP

Related Classes of sos.util.SOSStandardLogger

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.