/**
* Returns a new site id that is unique for the given user.
*/
private static String nextSiteId(UserInfo user) {
Base64Counter counter = new Base64Counter();
String userName = user.getUserName();
JSONObject sitesObject = getSites(user);
String candidate = userName + '-' + counter.toString();
while (sitesObject.has(candidate)) {
counter.increment();
candidate = userName + '-' + counter.toString();
}
return candidate;
}