protected void logDebug( final String messageKey ) { if ( getLog().isDebug() ) { getLog().logDebug( BaseMessages.getString( getPkgClazz(), messageKey ) ); } }
public RepositoryMeta loadRepositoryConnection( final String repoName, String loadingAvailableRepMsgTkn, String noRepsDefinedMsgTkn, String findingRepMsgTkn ) throws KettleException { RepositoriesMeta repsinfo; if ( Utils.isEmpty( repoName ) || ( repsinfo = loadRepositoryInfo( loadingAvailableRepMsgTkn, noRepsDefinedMsgTkn ) ) == null ) { return null; } logDebug( findingRepMsgTkn, repoName ); return repsinfo.findRepository( repoName ); }
String processingEndAfterLongestMsgTkn ) { String begin = getDateFormat().format( start ).toString(); String end = getDateFormat().format( stop ).toString(); getLog().logMinimal( BaseMessages.getString( getPkgClazz(), startStopMsgTkn, begin, end ) ); getLog().logMinimal( BaseMessages.getString( getPkgClazz(), processingEndAfterMsgTkn, String.valueOf( seconds ) ) ); } else if ( seconds <= 60 * 60 ) { int min = ( seconds / 60 ); int rem = ( seconds % 60 ); getLog().logMinimal( BaseMessages.getString( getPkgClazz(), processingEndAfterLongMsgTkn, String.valueOf( min ), String.valueOf( rem ), String.valueOf( seconds ) ) ); } else if ( seconds <= 60 * 60 * 24 ) { int min = rem / 60; rem = rem % 60; getLog().logMinimal( BaseMessages.getString( getPkgClazz(), processingEndAfterLongerMsgTkn, String.valueOf( hour ), String.valueOf( min ), String.valueOf( rem ), String.valueOf( seconds ) ) ); } else { int min = rem / 60; rem = rem % 60; getLog().logMinimal( BaseMessages.getString( getPkgClazz(), processingEndAfterLongestMsgTkn, String.valueOf( days ), String.valueOf( hour ), String.valueOf( min ), String.valueOf( rem ), String.valueOf( seconds ) ) );
public RepositoriesMeta loadRepositoryInfo( String loadingAvailableRepMsgTkn, String noRepsDefinedMsgTkn ) throws KettleException { RepositoriesMeta repsinfo = new RepositoriesMeta(); repsinfo.getLog().setLogLevel( getLog().getLogLevel() ); logDebug( loadingAvailableRepMsgTkn ); try { repsinfo.readData(); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( getPkgClazz(), noRepsDefinedMsgTkn ), e ); } return repsinfo; }
public Repository establishRepositoryConnection( RepositoryMeta repositoryMeta, final String username, final String password, final RepositoryOperation... operations ) throws KettleException, KettleSecurityException { Repository rep = PluginRegistry.getInstance().loadClass( RepositoryPluginType.class, repositoryMeta, Repository.class ); rep.init( repositoryMeta ); rep.getLog().setLogLevel( getLog().getLogLevel() ); rep.connect( username != null ? username : null, password != null ? password : null ); if ( operations != null ) { // throws KettleSecurityException if username does does have permission for given operations rep.getSecurityProvider().validateAction( operations ); } return rep; }
protected void logDebug( final String messageKey, String... messageTokens ) { if ( getLog().isDebug() ) { getLog().logDebug( BaseMessages.getString( getPkgClazz(), messageKey, messageTokens ) ); } }
protected void printVersion( String kettleVersionMsgTkn ) { BuildVersion buildVersion = BuildVersion.getInstance(); getLog().logBasic( BaseMessages.getString( getPkgClazz(), kettleVersionMsgTkn, buildVersion.getVersion(), buildVersion.getRevision(), buildVersion.getBuildDate() ) ); }