private void waitForNextCheck() throws InterruptedException { long lastCheck = JiveGlobals.getLongProperty("update.lastCheck", 0); if (lastCheck == 0) { // This is the first time the server is used (since we added this feature) Thread.sleep(30000); } else { long elapsed = System.currentTimeMillis() - lastCheck; long frequency = getCheckFrequency() * JiveConstants.HOUR; // Sleep until we've waited the appropriate amount of time. while (elapsed < frequency) { Thread.sleep(frequency - elapsed); // Update the elapsed time. This check is necessary just in case the // thread woke up early. elapsed = System.currentTimeMillis() - lastCheck; } } } };
/** * Constructs a new login limit manager. Exposed for test use only. */ LoginLimitManager(final SecurityAuditManager securityAuditManager, final TaskEngine taskEngine) { this.securityAuditManager = securityAuditManager; // Set up initial maps attemptsPerIP = new ConcurrentHashMap<>(); attemptsPerUsername = new ConcurrentHashMap<>(); // Max number of attempts per ip address that can be performed in given time frame (10 attempts default) maxAttemptsPerIP = JiveGlobals.getLongProperty("adminConsole.maxAttemptsPerIP", 10); // Time frame before attempts per ip addresses are reset (15 minutes default) millisecondsBetweenPerIP = JiveGlobals.getLongProperty("adminConsole.perIPAttemptResetInterval", 900000); // Max number of attempts per username that can be performed in a given time frame (10 attempts default) maxAttemptsPerUsername = JiveGlobals.getLongProperty("adminConsole.maxAttemptsPerUsername", 10); // Time frame before attempts per ip addresses are reset (15 minutes default) millisecondsBetweenPerUsername = JiveGlobals.getLongProperty("adminConsole.perUsernameAttemptResetInterval", 900000); // Set up per username attempt reset task taskEngine.scheduleAtFixedRate(new PerUsernameTask(), 0, millisecondsBetweenPerUsername); // Set up per IP attempt reset task taskEngine.scheduleAtFixedRate(new PerIPAddressTask(), 0, millisecondsBetweenPerIP); }
final long requestFrequency = JiveGlobals.getLongProperty( "stream.management.requestFrequency", 5 ); final int size;
setMinEvictableIdleTimeMillis( JiveGlobals.getLongProperty( "sms.smpp.connections.idleMillis", 1000 * 60 * 2 ) ); if ( getMinEvictableIdleTimeMillis() > 0 )
if (now != JiveGlobals.getLongProperty("update.lastCheck", 0)) { Log.error("Error: update service check did not save correctly. " + "Stopping update service.");
final long period = JiveGlobals.getLongProperty( "jetty.temp-file-toucher.period", JiveConstants.DAY ); TaskEngine.getInstance().schedule( tempFileToucherTask, period, period );
SMPPSessionPool() { super( new SMPPSessionFactory() ); setMaxTotal( JiveGlobals.getIntProperty( "sms.smpp.connections.maxAmount", 1 ) ); setNumTestsPerEvictionRun( getMaxTotal() ); setMinEvictableIdleTimeMillis( JiveGlobals.getLongProperty( "sms.smpp.connections.idleMillis", 1000 * 60 * 2 ) ); if ( getMinEvictableIdleTimeMillis() > 0 ) { setTimeBetweenEvictionRunsMillis( getMinEvictableIdleTimeMillis() / 10 ); } setTestOnBorrow( true ); setTestWhileIdle( true ); }
user.toBareJID().intern().wait(JiveGlobals.getLongProperty("usermanager.remote-disco-info-timeout-seconds", 60) * JiveConstants.SECOND);
public void addIqResultHandler(IQ iq, GtmsCallState callState) { addIqResultHandler(iq, callState, JiveGlobals.getLongProperty(GlobalConstants.Properties.ACTION_TIMEOUT, GlobalConstants.DEFAULT_ACTION_TIMEOUT)); }
private void waitForNextCheck() throws InterruptedException { long lastCheck = JiveGlobals.getLongProperty("update.lastCheck", 0); if (lastCheck == 0) { // This is the first time the server is used (since we added this feature) Thread.sleep(30000); } else { long elapsed = System.currentTimeMillis() - lastCheck; long frequency = getCheckFrequency() * JiveConstants.HOUR; // Sleep until we've waited the appropriate amount of time. while (elapsed < frequency) { Thread.sleep(frequency - elapsed); // Update the elapsed time. This check is necessary just in case the // thread woke up early. elapsed = System.currentTimeMillis() - lastCheck; } } } };
/** * Constructs a new login limit manager. */ private LoginLimitManager() { // Set up initial maps attemptsPerIP = new ConcurrentHashMap<>(); attemptsPerUsername = new ConcurrentHashMap<>(); // Max number of attempts per ip address that can be performed in given time frame (10 attempts default) maxAttemptsPerIP = JiveGlobals.getLongProperty("adminConsole.maxAttemptsPerIP", 10); // Time frame before attempts per ip addresses are reset (15 minutes default) millisecondsBetweenPerIP = JiveGlobals.getLongProperty("adminConsole.perIPAttemptResetInterval", 900000); // Max number of attempts per username that can be performed in a given time frame (10 attempts default) maxAttemptsPerUsername = JiveGlobals.getLongProperty("adminConsole.maxAttemptsPerUsername", 10); // Time frame before attempts per ip addresses are reset (15 minutes default) millisecondsBetweenPerUsername = JiveGlobals.getLongProperty("adminConsole.perUsernameAttemptResetInterval", 900000); // Set up per username attempt reset task TaskEngine.getInstance().scheduleAtFixedRate(new PerUsernameTask(), 0, millisecondsBetweenPerUsername); // Set up per IP attempt reset task TaskEngine.getInstance().scheduleAtFixedRate(new PerIPAddressTask(), 0, millisecondsBetweenPerIP); }
final long requestFrequency = JiveGlobals.getLongProperty( "stream.management.requestFrequency", 5 ); final int size;
setMinEvictableIdleTimeMillis( JiveGlobals.getLongProperty( "sms.smpp.connections.idleMillis", 1000 * 60 * 2 ) ); if ( getMinEvictableIdleTimeMillis() > 0 )
if (now != JiveGlobals.getLongProperty("update.lastCheck", 0)) { Log.error("Error: update service check did not save correctly. " + "Stopping update service.");
SMPPSessionPool() { super( new SMPPSessionFactory() ); setMaxTotal( JiveGlobals.getIntProperty( "sms.smpp.connections.maxAmount", 1 ) ); setNumTestsPerEvictionRun( getMaxTotal() ); setMinEvictableIdleTimeMillis( JiveGlobals.getLongProperty( "sms.smpp.connections.idleMillis", 1000 * 60 * 2 ) ); if ( getMinEvictableIdleTimeMillis() > 0 ) { setTimeBetweenEvictionRunsMillis( getMinEvictableIdleTimeMillis() / 10 ); } setTestOnBorrow( true ); setTestWhileIdle( true ); }