src/org/ohmage/cache/UserBin.java
private static synchronized void expire() {
		if(LOGGER.isDebugEnabled()) {
			LOGGER.debug("Beginning user expiration process");
		}

		Set<String> keySet = USERS.keySet();

		if(LOGGER.isDebugEnabled()) {
			LOGGER
				.debug("Number of users before expiration: " + keySet.size());
		}

		long currentTime = System.currentTimeMillis();

		for(String key : keySet) {
			UserTime ut = USERS.get(key);
			if(currentTime - ut.time > LIFETIME) {

				if(LOGGER.isDebugEnabled()) {
					LOGGER.debug("Removing user with Id " + key);
				}

				USERS.remove(key);
			}
		}

		if(LOGGER.isDebugEnabled()) {
			LOGGER.debug("Number of users after expiration: " + USERS.size());
		}
	}
/**
	 * Checks every bin location and removes Users whose tokens have expired.
	 */
Checks every bin location and removes Users whose tokens have expired.
Checks every bin location and removes Users whose tokens have expired .
private static synchronized void expire() {
		if(LOGGER.isDebugEnabled()) {
			LOGGER.debug("Beginning user expiration process");
		}
		Set<String> keySet = USERS.keySet();
		if(LOGGER.isDebugEnabled()) {
			LOGGER
				.debug("Number of users before expiration: " + keySet.size());
		}
		long currentTime = System.currentTimeMillis();
		for(String key : keySet) {
			UserTime ut = USERS.get(key);
			if(currentTime - ut.time > LIFETIME) {
				if(LOGGER.isDebugEnabled()) {
					LOGGER.debug("Removing user with Id " + key);
				}
				USERS.remove(key);
			}
		}
		if(LOGGER.isDebugEnabled()) {
			LOGGER.debug("Number of users after expiration: " + USERS.size());
		}
	}
private static synchronized void expire ( ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Beginning user expiration process" ) ; } Set < String > keySet = USERS . keySet ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Number of users before expiration: " + keySet . size ( ) ) ; } long currentTime = System . currentTimeMillis ( ) ; for ( String key : keySet ) { UserTime ut = USERS . get ( key ) ; if ( currentTime - ut . time > LIFETIME ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Removing user with Id " + key ) ; } USERS . remove ( key ) ; } } if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Number of users after expiration: " + USERS . size ( ) ) ; } }
Checks every bin location and removes Users whose tokens have expired.
Checks every bin location and removes Users whose tokens have expired .