/** * Checks if is basic. * * @return true, if is basic */ public boolean isBasic() { return log.isBasic(); }
/** * Checks if the logging level is basic. * * @return true if the logging level is basic, false otherwise */ public boolean isBasic() { return log.isBasic(); }
/** * Checks if is basic. * * @return true, if is basic */ public boolean isBasic() { return getLog().isBasic(); }
public void run() { try { final BufferedReader br = new BufferedReader( new InputStreamReader( input ) ); String line; while ( ( line = br.readLine() ) != null ) { // Only perform the concatenation if at basic level. Otherwise, // this just reads from the stream. if ( log.isBasic() ) { logBasic( type + line ); } } } catch ( IOException ioe ) { ioe.printStackTrace(); } }
public void run() { try { final BufferedReader br = new BufferedReader( new InputStreamReader( input ) ); String line; while ( ( line = br.readLine() ) != null ) { // Only perform the concatenation if at basic level. Otherwise, // this just reads from the stream. if ( log.isBasic() ) { logBasic( type + line ); } } } catch ( IOException ioe ) { ioe.printStackTrace(); } }
public void run() { try { final BufferedReader br = new BufferedReader( new InputStreamReader( input ) ); String line; while ( ( line = br.readLine() ) != null ) { // Only perform the concatenation if at basic level. Otherwise, // this just reads from the stream. if ( log.isBasic() ) { logBasic( type + line ); } } } catch ( IOException ioe ) { ioe.printStackTrace(); } }
public void run() { try { setControlStates(); } catch ( KettleRepositoryLostException krle ) { if ( log.isBasic() ) { log.logBasic( krle.getLocalizedMessage() ); } } } };
@Override public void run() { try { setControlStates(); } catch ( KettleRepositoryLostException krle ) { if ( log.isBasic() ) { log.logBasic( krle.getLocalizedMessage() ); } } } };
@Override public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (ExecSQLMeta) smi; data = (ExecSQLData) sdi; if ( log.isBasic() ) { logBasic( BaseMessages.getString( PKG, "ExecSQL.Log.FinishingReadingQuery" ) ); } if ( data.db != null ) { data.db.disconnect(); } super.dispose( smi, sdi ); }
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { if ( log.isBasic() ) { logBasic( "Finished reading query, closing connection." ); } try { data.olapHelper.close(); } catch ( KettleDatabaseException e ) { logError( "Error closing connection: ", e ); } super.dispose( smi, sdi ); }
@Override public WebServiceException call() throws Exception { try { IUnifiedRepositoryJaxwsWebService repoWebService = null; if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "PurRepositoryConnector.CreateRepositoryWebService.Start" ) ); //$NON-NLS-1$ } repoWebService = serviceManager.createService( username, decryptedPassword, IUnifiedRepositoryJaxwsWebService.class ); //$NON-NLS-1$ if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "PurRepositoryConnector.CreateRepositoryWebService.End" ) ); //$NON-NLS-1$ } if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "PurRepositoryConnector.CreateUnifiedRepositoryToWebServiceAdapter.Start" ) ); //$NON-NLS-1$ } result.setUnifiedRepository( new UnifiedRepositoryToWebServiceAdapter( repoWebService ) ); } catch ( WebServiceException wse ) { return wse; } return null; } } );
public final void connect( String username, String password ) throws KettleException { Hashtable<String, String> env = new Hashtable<String, String>(); setupEnvironment( env, username, password ); try { /* Establish LDAP association */ doConnect( username, password ); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "LDAPInput.Log.ConnectedToServer", hostname, Const.NVL( username, "" ) ) ); } if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, "LDAPInput.ClassUsed.Message", ctx.getClass().getName() ) ); } } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "LDAPinput.Exception.ErrorConnecting", e .getMessage() ), e ); } }
/** * This methods adds a new data source to cache * * @param log * @param databaseMeta * @param partitionId * @param initialSize * @param maximumSize * @throws KettleDatabaseException */ private static void addPoolableDataSource( LogChannelInterface log, DatabaseMeta databaseMeta, String partitionId, int initialSize, int maximumSize ) throws KettleDatabaseException { if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "Database.CreatingConnectionPool", databaseMeta.getName() ) ); } BasicDataSource ds = new BasicDataSource(); configureDataSource( ds, databaseMeta, partitionId, initialSize, maximumSize ); // check if datasource is valid testDataSource( ds ); // register data source dataSources.put( getDataSourceName( databaseMeta, partitionId ), ds ); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "Database.CreatedConnectionPool", databaseMeta.getName() ) ); } }
public void close() throws KettleException { if ( ctx != null ) { try { ctx.close(); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "LDAPInput.log.Disconnection.Done" ) ); } } catch ( Exception e ) { log.logError( BaseMessages.getString( PKG, "LDAPInput.Exception.ErrorDisconecting", e.toString() ) ); log.logError( Const.getStackTracker( e ) ); } finally { ctx = null; } } } }
private static void initLogging( CommandLineOption[] options ) throws KettleException { StringBuilder optionLogFile = getCommandLineOption( options, "logfile" ).getArgument(); StringBuilder optionLogLevel = getCommandLineOption( options, "level" ).getArgument(); // Set default Locale: Locale.setDefault( Const.DEFAULT_LOCALE ); if ( !Utils.isEmpty( optionLogFile ) ) { fileLoggingEventListener = new FileLoggingEventListener( optionLogFile.toString(), true ); if ( log.isBasic() ) { String filename = fileLoggingEventListener.getFilename(); log.logBasic( BaseMessages.getString( PKG, "Spoon.Log.LoggingToFile" ) + filename ); } KettleLogStore.getAppender().addLoggingEventListener( fileLoggingEventListener ); } else { fileLoggingEventListener = null; } if ( !Utils.isEmpty( optionLogLevel ) ) { log.setLogLevel( LogLevel.getLogLevelForCode( optionLogLevel.toString() ) ); if ( log.isBasic() ) { // "Logging is at level : " log.logBasic( BaseMessages.getString( PKG, "Spoon.Log.LoggingAtLevel" ) + log.getLogLevel().getDescription() ); } } }
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { if ( log.isBasic() ) { logBasic( "Finished reading query, closing connection." ); } try { closePreviousQuery(); } catch ( KettleException e ) { logError( "Unexpected error closing query : " + e.toString() ); setErrors( 1 ); stopAll(); } finally { if ( data.db != null ) { data.db.disconnect(); } } super.dispose( smi, sdi ); }
public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { Object[] r = getRow(); // get row, set busy! // no more input to be expected... if ( r == null ) { setOutputDone(); return false; } putRow( getInputRowMeta(), r ); // copy row to possible alternate rowset(s). if ( checkFeedback( getLinesRead() ) ) { if ( log.isBasic() ) { logBasic( BaseMessages.getString( PKG, "DummyTrans.Log.LineNumber" ) + getLinesRead() ); } } return true; } }
public synchronized boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { meta = (FieldSplitterMeta) smi; data = (FieldSplitterData) sdi; Object[] r = getRow(); // get row from rowset, wait for our turn, indicate busy! if ( r == null ) { // no more input to be expected... setOutputDone(); return false; } Object[] outputRowData = splitField( r ); putRow( data.outputMeta, outputRowData ); if ( checkFeedback( getLinesRead() ) ) { if ( log.isBasic() ) { logBasic( BaseMessages.getString( PKG, "FieldSplitter.Log.LineNumber" ) + getLinesRead() ); } } return true; }
public void exportAll( RepositoryDirectoryInterface dir ) { FileDialog dialog = Spoon.getInstance().getExportFileDialog(); // new FileDialog( shell, SWT.SAVE | SWT.SINGLE ); if ( dialog.open() == null ) { return; } String filename = dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName(); // check if file is exists MessageBox box = RepositoryExportProgressDialog.checkIsFileIsAcceptable( shell, log, filename ); int answer = ( box == null ) ? SWT.OK : box.open(); if ( answer != SWT.OK ) { // seems user don't want to overwrite file... return; } if ( log.isBasic() ) { log.logBasic( "Exporting All", "Export objects to file [" + filename + "]" ); //$NON-NLS-3$ } // check file is not empty RepositoryExportProgressDialog repd = new RepositoryExportProgressDialog( shell, rep, dir, filename ); repd.open(); }
public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { data = (DetectEmptyStreamData) sdi; Object[] r = getRow(); // get row, set busy! if ( r == null ) { // no more input to be expected... if ( first ) { // input stream is empty ! data.outputRowMeta = getTransMeta().getPrevStepFields( getStepMeta() ); putRow( data.outputRowMeta, buildOneRow() ); // copy row to possible alternate rowset(s). if ( checkFeedback( getLinesRead() ) ) { if ( log.isBasic() ) { logBasic( BaseMessages.getString( PKG, "DetectEmptyStream.Log.LineNumber" ) + getLinesRead() ); } } } setOutputDone(); return false; } if ( first ) { first = false; } return true; }