src/org/ohmage/cache/UserBin.java
public static synchronized String addUser(User user)
		throws DomainException {

		if(!initialized) {
			new UserBin();
		}

		if(LOGGER.isDebugEnabled()) {
			LOGGER.debug("adding user to bin");
		}

		String uuid = UUID.randomUUID().toString();
		UserTime ut = new UserTime(user, System.currentTimeMillis());
		user.setToken(uuid);
		if(USERS.put(uuid, ut) != null) {
			throw new DomainException("UUID collision: " + uuid);
		}

		return uuid;
	}
/**
	 * Adds a user to the bin and returns an Id (token) representing that user.
	 * If the user is already resident in the bin, their old token is removed
	 * and a new one is generated and returned.
	 */
Adds a user to the bin and returns an Id (token) representing that user.
If the user is already resident in the bin, their old token is removed
and a new one is generated and returned.
Adds a user to the bin and returns an Id ( token ) representing that user . If the user is already resident in the bin their old token is removed and a new one is generated and returned .
public static synchronized String addUser(User user)
		throws DomainException {
		if(!initialized) {
			new UserBin();
		}
		if(LOGGER.isDebugEnabled()) {
			LOGGER.debug("adding user to bin");
		}
		String uuid = UUID.randomUUID().toString();
		UserTime ut = new UserTime(user, System.currentTimeMillis());
		user.setToken(uuid);
		if(USERS.put(uuid, ut) != null) {
			throw new DomainException("UUID collision: " + uuid);
		}
		return uuid;
	}
public static synchronized String addUser ( User user ) throws DomainException { if ( ! initialized ) { new UserBin ( ) ; } if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "adding user to bin" ) ; } String uuid = UUID . randomUUID ( ) . toString ( ) ; UserTime ut = new UserTime ( user , System . currentTimeMillis ( ) ) ; user . setToken ( uuid ) ; if ( USERS . put ( uuid , ut ) != null ) { throw new DomainException ( "UUID collision: " + uuid ) ; } return uuid ; }
Adds a user to the bin and returns an Id (token) representing that user.
Adds a user to the bin and returns an Id ( token ) representing that user .