boolean identifierInUse = true;
String identifier = "";
Iterator<LocationAttribute> iter = location.getAttributes().iterator();
String prefix = "NEW";
while (iter.hasNext()) {
LocationAttribute la = iter.next();
if (la.getAttributeType().getName().equals("identifierPrefix")) {
prefix = la.getValue().toString();
}
}
while (identifierInUse) {
//TODO: set this identifier prefix based on location
identifier = prefix + (int) (Math.random() * 100000);