@Override public void configure(Context context) { Configurables.ensureRequiredNonNull( context, CONFIG_PORT); port = context.getInteger(CONFIG_PORT); host = context.getString(CONFIG_HOST); remoteHostHeader = context.getString(REMOTE_ADDRESS_HEADER); }
@Override public void configure(Context context) { String hostKey = NetcatSourceConfigurationConstants.CONFIG_HOSTNAME; String portKey = NetcatSourceConfigurationConstants.CONFIG_PORT; String ackEventKey = NetcatSourceConfigurationConstants.CONFIG_ACKEVENT; Configurables.ensureRequiredNonNull(context, hostKey, portKey); hostName = context.getString(hostKey); port = context.getInteger(portKey); ackEveryEvent = context.getBoolean(ackEventKey, true); maxLineLength = context.getInteger( NetcatSourceConfigurationConstants.CONFIG_MAX_LINE_LENGTH, NetcatSourceConfigurationConstants.DEFAULT_MAX_LINE_LENGTH); sourceEncoding = context.getString( NetcatSourceConfigurationConstants.CONFIG_SOURCE_ENCODING, NetcatSourceConfigurationConstants.DEFAULT_ENCODING ); }
@Override public void configure(Context context) { configureSsl(context); Configurables.ensureRequiredNonNull(context, PORT_KEY, BIND_KEY);
@Override public void configure(Context context) { Configurables.ensureRequiredNonNull( context, SyslogSourceConfigurationConstants.CONFIG_PORT); port = context.getInteger(SyslogSourceConfigurationConstants.CONFIG_PORT); host = context.getString(SyslogSourceConfigurationConstants.CONFIG_HOST); formaterProp = context.getSubProperties( SyslogSourceConfigurationConstants.CONFIG_FORMAT_PREFIX); keepFields = SyslogUtils.chooseFieldsToKeep( context.getString( SyslogSourceConfigurationConstants.CONFIG_KEEP_FIELDS, SyslogSourceConfigurationConstants.DEFAULT_KEEP_FIELDS)); clientIPHeader = context.getString(SyslogSourceConfigurationConstants.CONFIG_CLIENT_IP_HEADER); clientHostnameHeader = context.getString(SyslogSourceConfigurationConstants.CONFIG_CLIENT_HOSTNAME_HEADER); if (sourceCounter == null) { sourceCounter = new SourceCounter(getName()); } }
@Override public void configure(Context context) { configureSsl(context); Configurables.ensureRequiredNonNull(context, SyslogSourceConfigurationConstants.CONFIG_PORT); port = context.getInteger(SyslogSourceConfigurationConstants.CONFIG_PORT); host = context.getString(SyslogSourceConfigurationConstants.CONFIG_HOST); eventSize = context.getInteger("eventSize", SyslogUtils.DEFAULT_SIZE); formaterProp = context.getSubProperties( SyslogSourceConfigurationConstants.CONFIG_FORMAT_PREFIX); keepFields = SyslogUtils.chooseFieldsToKeep( context.getString( SyslogSourceConfigurationConstants.CONFIG_KEEP_FIELDS, SyslogSourceConfigurationConstants.DEFAULT_KEEP_FIELDS)); clientIPHeader = context.getString(SyslogSourceConfigurationConstants.CONFIG_CLIENT_IP_HEADER); clientHostnameHeader = context.getString(SyslogSourceConfigurationConstants.CONFIG_CLIENT_HOSTNAME_HEADER); if (sourceCounter == null) { sourceCounter = new SourceCounter(getName()); } }
@Override public void configure(Context context) { Configurables.ensureRequiredNonNull( context, CONFIG_PORT); port = context.getInteger(CONFIG_PORT); host = context.getString(CONFIG_HOST); remoteHostHeader = context.getString(REMOTE_ADDRESS_HEADER); }
@Override protected void doConfigure(Context context) { ensureRequiredNonNull(context, ACCESS_KEY_KEY, SECRET_KEY, BUCKET_KEY); this.accessKey = context.getString(ACCESS_KEY_KEY); this.secretKey = context.getString(SECRET_KEY); this.bucket = context.getString(BUCKET_KEY); }
@Override protected void doConfigure(Context context) throws FlumeException { ensureRequiredNonNull(context, HOST_KEY, PORT_KEY, PATH_KEY); this.host = context.getString(HOST_KEY); this.port = context.getInteger(PORT_KEY); this.path = context.getString(PATH_KEY); this.enableSsl = context.getBoolean(SSL_KEY, false); this.keystore = context.getString(KEYSTORE_KEY); this.keystorePassword = context.getString(KEYSTORE_PASSWORD_KEY); if (enableSsl) { checkNotNull(keystore, KEYSTORE_KEY + " must be specified when SSL is enabled"); checkNotNull(keystorePassword, KEYSTORE_PASSWORD_KEY + " must be specified when SSL is enabled"); } }
@Override protected void doConfigure(Context context) { ensureRequiredNonNull(context, HOST_KEY, PORT_KEY, PATH_KEY); this.host = context.getString(HOST_KEY); this.port = context.getInteger(PORT_KEY); this.path = context.getString(PATH_KEY); this.enableSsl = context.getBoolean(SSL_KEY, false); this.keystore = context.getString(KEYSTORE_KEY); this.keystorePassword = context.getString(KEYSTORE_PASSWORD_KEY); if (enableSsl) { checkNotNull(keystore, KEYSTORE_KEY + " must be specified when SSL is enabled"); checkNotNull(keystorePassword, KEYSTORE_PASSWORD_KEY + " must be specified when SSL is enabled"); } }
@Override public void configure(Context context) { configureSsl(context); Configurables.ensureRequiredNonNull(context, PORT_KEY, BIND_KEY);
@Override public void configure(Context context) { String hostKey = NetcatSourceConfigurationConstants.CONFIG_HOSTNAME; String portKey = NetcatSourceConfigurationConstants.CONFIG_PORT; String ackEventKey = NetcatSourceConfigurationConstants.CONFIG_ACKEVENT; Configurables.ensureRequiredNonNull(context, hostKey, portKey); hostName = context.getString(hostKey); port = context.getInteger(portKey); ackEveryEvent = context.getBoolean(ackEventKey, true); maxLineLength = context.getInteger( NetcatSourceConfigurationConstants.CONFIG_MAX_LINE_LENGTH, NetcatSourceConfigurationConstants.DEFAULT_MAX_LINE_LENGTH); sourceEncoding = context.getString( NetcatSourceConfigurationConstants.CONFIG_SOURCE_ENCODING, NetcatSourceConfigurationConstants.DEFAULT_ENCODING ); }
@Override public void configure(Context context) { Configurables.ensureRequiredNonNull( context, SyslogSourceConfigurationConstants.CONFIG_PORT); port = context.getInteger(SyslogSourceConfigurationConstants.CONFIG_PORT); host = context.getString(SyslogSourceConfigurationConstants.CONFIG_HOST); formaterProp = context.getSubProperties( SyslogSourceConfigurationConstants.CONFIG_FORMAT_PREFIX); keepFields = SyslogUtils.chooseFieldsToKeep( context.getString( SyslogSourceConfigurationConstants.CONFIG_KEEP_FIELDS, SyslogSourceConfigurationConstants.DEFAULT_KEEP_FIELDS)); clientIPHeader = context.getString(SyslogSourceConfigurationConstants.CONFIG_CLIENT_IP_HEADER); clientHostnameHeader = context.getString(SyslogSourceConfigurationConstants.CONFIG_CLIENT_HOSTNAME_HEADER); if (sourceCounter == null) { sourceCounter = new SourceCounter(getName()); } }
@Override public void configure(Context context) { configureSsl(context); Configurables.ensureRequiredNonNull(context, SyslogSourceConfigurationConstants.CONFIG_PORT); port = context.getInteger(SyslogSourceConfigurationConstants.CONFIG_PORT); host = context.getString(SyslogSourceConfigurationConstants.CONFIG_HOST); eventSize = context.getInteger("eventSize", SyslogUtils.DEFAULT_SIZE); formaterProp = context.getSubProperties( SyslogSourceConfigurationConstants.CONFIG_FORMAT_PREFIX); keepFields = SyslogUtils.chooseFieldsToKeep( context.getString( SyslogSourceConfigurationConstants.CONFIG_KEEP_FIELDS, SyslogSourceConfigurationConstants.DEFAULT_KEEP_FIELDS)); clientIPHeader = context.getString(SyslogSourceConfigurationConstants.CONFIG_CLIENT_IP_HEADER); clientHostnameHeader = context.getString(SyslogSourceConfigurationConstants.CONFIG_CLIENT_HOSTNAME_HEADER); if (sourceCounter == null) { sourceCounter = new SourceCounter(getName()); } }
@Override public void configure(Context context) { // Only the queue name does not have a default value Configurables.ensureRequiredNonNull(context, QUEUE_KEY); // Assign all of the configured values hostname = context.getString(HOST_KEY, ConnectionFactory.DEFAULT_HOST); port = context.getInteger(PORT_KEY, ConnectionFactory.DEFAULT_AMQP_PORT); enableSSL = context.getBoolean(SSL_KEY, false); virtualHost = context.getString(VHOST_KEY, ConnectionFactory.DEFAULT_VHOST); username = context.getString(USER_KEY, ConnectionFactory.DEFAULT_USER); password = context.getString(PASSWORD_KEY, ConnectionFactory.DEFAULT_PASS); queue = context.getString(QUEUE_KEY, null); autoAck = context.getBoolean(AUTOACK_KEY, false); requeuing = context.getBoolean(REQUEUING, false); prefetchCount = context.getInteger(PREFETCH_COUNT_KEY, 0); timeout = context.getInteger(TIMEOUT_KEY, -1); consumerThreads = context.getInteger(THREAD_COUNT_KEY, 1); // Ensure that Flume can connect to RabbitMQ testRabbitMQConnection(); // Create and configure the counters sourceCounter = new SourceCounter(getName()); counterGroup = new CounterGroup(); counterGroup.setName(getName()); }