public ServerSslConfig(String[] protocols, String[] ciphers, File certChainFile, File keyFile, byte[] metatronPolicy, ClientAuth clientAuth, File clientAuthTrustStoreFile, File clientAuthTrustStorePasswordFile, boolean sessionTicketsEnabled) { this.protocols = protocols; this.ciphers = ciphers != null ? Arrays.asList(ciphers) : null; this.certChainFile = certChainFile; this.keyFile = keyFile; this.decryptKeyUsingMetatronPolicy = (metatronPolicy != null); this.decryptKeyUsingMetatronBundle = false; this.metatronPolicy = metatronPolicy; this.clientAuth = clientAuth; this.clientAuthTrustStoreFile = clientAuthTrustStoreFile; this.clientAuthTrustStorePassword = null; this.clientAuthTrustStorePasswordFile = clientAuthTrustStorePasswordFile; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT.get(); this.sessionTicketsEnabled = sessionTicketsEnabled; }
@Override public long getLongProperty(String propertyName, LongConsumer consumer, long defaultValue) { DynamicLongProperty prop = propertyFactoryInstance().getLongProperty(propertyName, defaultValue); prop.addCallback(() -> consumer.accept(prop.get())); return prop.get(); }
@Override public void run() { long current = new Date().getTime(); Date otherCutoff = new Date(current - MAIN_TABLES_AGE_LIMIT_SECONDS.getValue() * SECOND_MILLIS); cleanupLabelTables(otherCutoff); cleanupExternalHandlerExternalHandlerProcessMapTables(otherCutoff); cleanupMountTable(otherCutoff); Date processInstanceCutoff = new Date(current - PROCESS_INSTANCE_AGE_LIMIT_SECONDS.get() * SECOND_MILLIS); cleanup("process_instance", processInstanceTables, processInstanceCutoff); Date eventTableCutoff = new Date(current - EVENT_AGE_LIMIT_SECONDS.get() * SECOND_MILLIS); cleanupServiceEventTable(eventTableCutoff); cleanup("event", eventTables, eventTableCutoff); Date auditLogCutoff = new Date(current - AUDIT_LOG_AGE_LIMIT_SECONDS.get() * SECOND_MILLIS); cleanup("audit_log", auditLogTables, auditLogCutoff); Date serviceLogCutoff = new Date(current - SERVICE_LOG_AGE_LIMIT_SECONDS.get() * SECOND_MILLIS); cleanup("service_log", serviceLogTables, serviceLogCutoff); cleanup("main", otherTables, otherCutoff); }
public AgentResourcesMonitor() { super(); buildCache(); CACHE_RESOURCE.addCallback(new Runnable() { @Override public void run() { buildCache(); } }); }
/** * Create a new property whose value is a long and subject to change on-the-fly. * * @param propName property name * @param defaultValue default value if the property is not defined in underlying configuration * @param propertyChangeCallback a Runnable to be called when the property is changed */ public DynamicLongProperty getLongProperty(String propName, long defaultValue, final Runnable propertyChangeCallback) { checkAndWarn(propName); DynamicLongProperty property = new DynamicLongProperty(propName, defaultValue); addCallback(propertyChangeCallback, property); return property; }
@Override public long getLongProperty(String propertyName, LongConsumer consumer, long defaultValue) { DynamicLongProperty prop = propertyFactoryInstance().getLongProperty(propertyName, defaultValue); prop.addCallback(() -> consumer.accept(prop.get())); return prop.get(); }
public LongProperty(String name, LongProperty next) { super(next); // setup next pointer sProp = DynamicPropertyFactory.getInstance().getLongProperty(name, Long.MIN_VALUE); callback = new Runnable() { @Override public void run() { logger.info("Property changed: '" + getName() + " = " + getValue() + "'"); checkAndFlip(); } }; sProp.addCallback(callback); checkAndFlip(); }
/** * Create a new property whose value is a long and subject to change on-the-fly. * * @param propName property name * @param defaultValue default value if the property is not defined in underlying configuration * @param propertyChangeCallback a Runnable to be called when the property is changed */ public DynamicLongProperty getLongProperty(String propName, long defaultValue, final Runnable propertyChangeCallback) { checkAndWarn(propName); DynamicLongProperty property = new DynamicLongProperty(propName, defaultValue); addCallback(propertyChangeCallback, property); return property; }
public ServerSslConfig(String[] protocols, String[] ciphers, File certChainFile, File keyFile, byte[] metatronPolicy, ClientAuth clientAuth, File clientAuthTrustStoreFile, String clientAuthTrustStorePassword, boolean sessionTicketsEnabled) { this.protocols = protocols; this.ciphers = Arrays.asList(ciphers); this.certChainFile = certChainFile; this.keyFile = keyFile; this.decryptKeyUsingMetatronPolicy = (metatronPolicy != null); this.decryptKeyUsingMetatronBundle = false; this.metatronPolicy = metatronPolicy; this.clientAuth = clientAuth; this.clientAuthTrustStoreFile = clientAuthTrustStoreFile; this.clientAuthTrustStorePassword = clientAuthTrustStorePassword; this.clientAuthTrustStorePasswordFile = null; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT.get(); this.sessionTicketsEnabled = sessionTicketsEnabled; }
public LongProperty(String name, LongProperty next) { super(next); // setup next pointer sProp = DynamicPropertyFactory.getInstance().getLongProperty(name, Long.MIN_VALUE); callback = new Runnable() { @Override public void run() { logger.info("Property changed: '" + getName() + " = " + getValue() + "'"); checkAndFlip(); } }; sProp.addCallback(callback); checkAndFlip(); }
public ServerSslConfig(String[] protocols, String[] ciphers, File certChainFile, File keyFile, boolean metatronBundle, ClientAuth clientAuth, File clientAuthTrustStoreFile, String clientAuthTrustStorePassword, boolean sessionTicketsEnabled) { this.protocols = protocols; this.ciphers = Arrays.asList(ciphers); this.certChainFile = certChainFile; this.keyFile = keyFile; this.decryptKeyUsingMetatronBundle = metatronBundle; this.decryptKeyUsingMetatronPolicy = false; this.metatronPolicy = null; this.clientAuth = clientAuth; this.clientAuthTrustStoreFile = clientAuthTrustStoreFile; this.clientAuthTrustStorePassword = clientAuthTrustStorePassword; this.clientAuthTrustStorePasswordFile = null; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT.get(); this.sessionTicketsEnabled = sessionTicketsEnabled; }
@Override public long getRetentionTimeInMSInDeltaQueue() { return configInstance.getLongProperty( namespace + "retentionTimeInMSInDeltaQueue", (3 * 60 * 1000)) .get(); }
@Override public long getMaxIdleThreadInMinutesAgeForStatusReplication() { return configInstance .getLongProperty( namespace + "maxIdleThreadAgeInMinutesForStatusReplication", 10).get(); }
@Override public long getEvictionIntervalTimerInMs() { return configInstance.getLongProperty( namespace + "evictionIntervalTimerInMs", (60 * 1000)).get(); }
@Override public long getDeltaRetentionTimerIntervalInMs() { return configInstance.getLongProperty( namespace + "deltaRetentionTimerIntervalInMs", (30 * 1000)) .get(); }
@Override public long getRoute53DomainTTL() { return configInstance.getLongProperty( namespace + "route53DomainTTL", 30l) .get(); }
public ServerSslConfig(String[] protocols, String[] ciphers, File certChainFile, File keyFile, byte[] metatronPolicy, ClientAuth clientAuth, File clientAuthTrustStoreFile, File clientAuthTrustStorePasswordFile, boolean sessionTicketsEnabled) { this.protocols = protocols; this.ciphers = ciphers != null ? Arrays.asList(ciphers) : null; this.certChainFile = certChainFile; this.keyFile = keyFile; this.decryptKeyUsingMetatronPolicy = (metatronPolicy != null); this.decryptKeyUsingMetatronBundle = false; this.metatronPolicy = metatronPolicy; this.clientAuth = clientAuth; this.clientAuthTrustStoreFile = clientAuthTrustStoreFile; this.clientAuthTrustStorePassword = null; this.clientAuthTrustStorePasswordFile = clientAuthTrustStorePasswordFile; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT.get(); this.sessionTicketsEnabled = sessionTicketsEnabled; }
public ServerSslConfig(String[] protocols, String[] ciphers, File certChainFile, File keyFile, byte[] metatronPolicy, ClientAuth clientAuth, File clientAuthTrustStoreFile, String clientAuthTrustStorePassword, boolean sessionTicketsEnabled) { this.protocols = protocols; this.ciphers = Arrays.asList(ciphers); this.certChainFile = certChainFile; this.keyFile = keyFile; this.decryptKeyUsingMetatronPolicy = (metatronPolicy != null); this.decryptKeyUsingMetatronBundle = false; this.metatronPolicy = metatronPolicy; this.clientAuth = clientAuth; this.clientAuthTrustStoreFile = clientAuthTrustStoreFile; this.clientAuthTrustStorePassword = clientAuthTrustStorePassword; this.clientAuthTrustStorePasswordFile = null; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT.get(); this.sessionTicketsEnabled = sessionTicketsEnabled; }
public ServerSslConfig(String[] protocols, String[] ciphers, File certChainFile, File keyFile, boolean metatronBundle, ClientAuth clientAuth, File clientAuthTrustStoreFile, String clientAuthTrustStorePassword, boolean sessionTicketsEnabled) { this.protocols = protocols; this.ciphers = Arrays.asList(ciphers); this.certChainFile = certChainFile; this.keyFile = keyFile; this.decryptKeyUsingMetatronBundle = metatronBundle; this.decryptKeyUsingMetatronPolicy = false; this.metatronPolicy = null; this.clientAuth = clientAuth; this.clientAuthTrustStoreFile = clientAuthTrustStoreFile; this.clientAuthTrustStorePassword = clientAuthTrustStorePassword; this.clientAuthTrustStorePasswordFile = null; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT.get(); this.sessionTicketsEnabled = sessionTicketsEnabled; }
@Override public void run() { synchronized ( isOpen ) { // Keep writing after closed until buffer is flushed (empty) while ( isOpen.get() || !buffer.isEmpty() ) { try { Result result = buffer.pollLast( waitTime.get(), TimeUnit.MILLISECONDS ); if ( result != null ) { resultCount.incrementAndGet(); jgen.writeObject( result ); } } catch ( InterruptedException e ) { LOG.error( "ResultLog thread interrupted.", e ); } catch ( JsonProcessingException e ) { LOG.error( "Failed to generate the JSON for a result.", e ); } catch ( IOException e ) { LOG.error( "Failed to write JSON to output stream for a result", e ); } } isOpen.notifyAll(); } } }