/** * @param key * The key, the name of the environment variable to return * @return The value of a System environment variable in the java virtual machine. If the key is not present, the * variable is not defined and null returned. */ public static final String getSystemProperty( String key ) { return getSystemProperty( key, null ); }
public static void init() { init( EnvUtil.getSystemProperty( Const.KETTLE_REDIRECT_STDOUT, "N" ).equalsIgnoreCase( "Y" ), EnvUtil .getSystemProperty( Const.KETTLE_REDIRECT_STDERR, "N" ).equalsIgnoreCase( "Y" ) ); }
/** * Initialize the central log store with optional limitation to the size * * @param maxSize * the maximum size * @param maxLogTimeoutMinutes * The maximum time that a log line times out in hours. */ public static void init( int maxSize, int maxLogTimeoutMinutes ) { init( maxSize, maxLogTimeoutMinutes, EnvUtil .getSystemProperty( Const.KETTLE_REDIRECT_STDOUT, "N" ).equalsIgnoreCase( "Y" ), EnvUtil .getSystemProperty( Const.KETTLE_REDIRECT_STDERR, "N" ).equalsIgnoreCase( "Y" ) ); }
public String getXML() throws KettleException { // See PDI-15781 boolean sendResultXmlWithStatus = EnvUtil.getSystemProperty( "KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS", "N" ).equalsIgnoreCase( "Y" ); return getXML( sendResultXmlWithStatus ); }
/** * @param jobMeta * the job metadata to keep track of (with maximum 5000 children) */ public JobTracker( JobMeta jobMeta ) { this( jobMeta, Const.toInt( EnvUtil.getSystemProperty( Const.KETTLE_MAX_JOB_TRACKER_SIZE ), 5000 ) ); }
private LoggingRegistry() { this.map = new ConcurrentHashMap<String, LoggingObjectInterface>(); this.childrenMap = new ConcurrentHashMap<String, List<String>>(); this.fileWriterBuffers = new ConcurrentHashMap<>(); this.lastModificationTime = new Date(); this.maxSize = Const.toInt( EnvUtil.getSystemProperty( "KETTLE_MAX_LOGGING_REGISTRY_SIZE" ), DEFAULT_MAX_SIZE ); }
public KettleTwoWayPasswordEncoder() { String envSeed = Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED ), "0933910847463829827159347601486730416058" ); // Solve for PDI-16512 Seed = envSeed; }
/** * Initialize the central log store with arguments specifying whether to redirect of stdout and stderr * * @param redirectStdOut * a boolean indicating whether to redirect stdout to the logging framework * @param redirectStdErr * a boolean indicating whether to redirect stderr to the logging framework */ public static void init( boolean redirectStdOut, boolean redirectStdErr ) { int maxSize = Const.toInt( EnvUtil.getSystemProperty( Const.KETTLE_MAX_LOG_SIZE_IN_LINES ), 5000 ); int maxLogTimeoutMinutes = Const.toInt( EnvUtil.getSystemProperty( Const.KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES ), 1440 ); init0( maxSize, maxLogTimeoutMinutes, redirectStdOut, redirectStdErr ); }
public void init() { status = new AtomicInteger(); jobListeners = new ArrayList<JobListener>(); jobEntryListeners = new ArrayList<JobEntryListener>(); delegationListeners = new ArrayList<DelegationListener>(); // these 2 maps are being modified concurrently and must be thread-safe activeJobEntryTransformations = new ConcurrentHashMap<JobEntryCopy, JobEntryTrans>(); activeJobEntryJobs = new ConcurrentHashMap<JobEntryCopy, JobEntryJob>(); extensionDataMap = new HashMap<String, Object>(); jobTracker = new JobTracker( jobMeta ); synchronized ( jobEntryResults ) { jobEntryResults.clear(); } errors = new AtomicInteger( 0 ); batchId = -1; passedBatchId = -1; maxJobEntriesLogged = Const.toInt( EnvUtil.getSystemProperty( Const.KETTLE_MAX_JOB_ENTRIES_LOGGED ), 1000 ); result = null; startJobEntryCopy = null; startJobEntryResult = null; this.setDefaultLogCommitSize(); }
public String getXML() throws KettleException { // See PDI-15781 boolean sendResultXmlWithStatus = EnvUtil.getSystemProperty( "KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS", "N" ).equalsIgnoreCase( "Y" ); StringBuilder xml = new StringBuilder(); xml.append( XMLHandler.openTag( XML_TAG ) ).append( Const.CR ); xml.append( " " ).append( XMLHandler.addTagValue( "jobname", jobName ) ); xml.append( " " ).append( XMLHandler.addTagValue( "id", id ) ); xml.append( " " ).append( XMLHandler.addTagValue( "status_desc", statusDescription ) ); xml.append( " " ).append( XMLHandler.addTagValue( "error_desc", errorDescription ) ); xml.append( " " ).append( XMLHandler.addTagValue( "log_date", XMLHandler.date2string( logDate ) ) ); xml.append( " " ).append( XMLHandler.addTagValue( "logging_string", XMLHandler.buildCDATA( loggingString ) ) ); xml.append( " " ).append( XMLHandler.addTagValue( "first_log_line_nr", firstLoggingLineNr ) ); xml.append( " " ).append( XMLHandler.addTagValue( "last_log_line_nr", lastLoggingLineNr ) ); if ( result != null ) { String resultXML = sendResultXmlWithStatus ? result.getXML() : result.getBasicXml(); xml.append( resultXML ); } xml.append( XMLHandler.closeTag( XML_TAG ) ); return xml.toString(); }
private void lookupSubject() { // Derive the subject from the registry // LoggingObjectInterface loggingObject = LoggingRegistry.getInstance().getLoggingObject( logChannelId ); boolean detailedLogTurnOn = "Y".equals( EnvUtil.getSystemProperty( Const.KETTLE_LOG_MARK_MAPPINGS ) ) ? true : false; if ( loggingObject != null ) { if ( !detailedLogTurnOn ) { subject = loggingObject.getObjectName(); } else { subject = getDetailedSubject( loggingObject ); } copy = loggingObject.getObjectCopy(); } }
/** * For legacy transformations containing AWS S3 access credentials, {@link Const#KETTLE_USE_AWS_DEFAULT_CREDENTIALS} can force Spoon to use * the Amazon Default Credentials Provider Chain instead of using the credentials embedded in the transformation metadata. * * @return true if {@link Const#KETTLE_USE_AWS_DEFAULT_CREDENTIALS} is true or AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are not specified */ public boolean getUseAwsDefaultCredentials() { if ( ValueMetaBase.convertStringToBoolean( Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_USE_AWS_DEFAULT_CREDENTIALS ), "N" ) ) ) { return true; } else if ( StringUtil.isEmpty( awsAccessKey ) && StringUtil.isEmpty( awsSecretKey ) ) { return true; } return false; }
/** * Configure the central log store from the provided command line options * * @param maxLogLinesOption Option for maximum log lines * @param maxLogTimeoutOption Option for log timeout * @throws KettleException Error parsing command line arguments */ public static void configureLogging( final CommandLineOption maxLogLinesOption, final CommandLineOption maxLogTimeoutOption ) throws KettleException { int maxLogLines = parseIntArgument( maxLogLinesOption, 0 ); if ( Utils.isEmpty( maxLogLinesOption.getArgument() ) ) { maxLogLines = Const.toInt( EnvUtil.getSystemProperty( Const.KETTLE_MAX_LOG_SIZE_IN_LINES ), 5000 ); } int maxLogTimeout = parseIntArgument( maxLogTimeoutOption, 0 ); if ( Utils.isEmpty( maxLogTimeoutOption.getArgument() ) ) { maxLogTimeout = Const.toInt( EnvUtil.getSystemProperty( Const.KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES ), 1440 ); } KettleLogStore.init( maxLogLines, maxLogTimeout ); }
@BeforeClass public static void beforeClass() throws KettleException { PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() ); PluginRegistry.init(); String passwordEncoderPluginID = Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_PASSWORD_ENCODER_PLUGIN ), "Kettle" ); Encr.init( passwordEncoderPluginID ); }
@BeforeClass public static void beforeClass() throws KettleException { PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() ); PluginRegistry.init(); String passwordEncoderPluginID = Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_PASSWORD_ENCODER_PLUGIN ), "Kettle" ); Encr.init( passwordEncoderPluginID ); }
@BeforeClass public static void beforeClass() throws KettleException { PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() ); PluginRegistry.init(); String passwordEncoderPluginID = Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_PASSWORD_ENCODER_PLUGIN ), "Kettle" ); Encr.init( passwordEncoderPluginID ); }
@BeforeClass public static void beforeClass() throws KettleException { PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() ); PluginRegistry.init(); String passwordEncoderPluginID = Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_PASSWORD_ENCODER_PLUGIN ), "Kettle" ); Encr.init( passwordEncoderPluginID ); }
@BeforeClass public static void setUpBeforeClass() throws KettleException { PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() ); PluginRegistry.init( false ); String passwordEncoderPluginID = Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_PASSWORD_ENCODER_PLUGIN ), "Kettle" ); Encr.init( passwordEncoderPluginID ); }
@BeforeClass public static void beforeClass() throws KettleException { PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() ); PluginRegistry.init(); String passwordEncoderPluginID = Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_PASSWORD_ENCODER_PLUGIN ), "Kettle" ); Encr.init( passwordEncoderPluginID ); }
@BeforeClass public static void beforeClass() throws KettleException { PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() ); PluginRegistry.init(); String passwordEncoderPluginID = Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_PASSWORD_ENCODER_PLUGIN ), "Kettle" ); Encr.init( passwordEncoderPluginID ); }