//check if profile to be created already exists
RegistryEntry existingEntry =
Registry.getEntry(registry, entryName);
if (existingEntry != null)
{
throw new EntityExistsException(
"RegistryEntry: " + entryName + " Already Exists!");
}
RegistryEntry registryEntry = Registry.createEntry(registry);
registryEntry.setName(entryName);