use of org.forgerock.openam.upgrade.ServiceSchemaModificationWrapper in project OpenAM by OpenRock.
the class ServiceSchemaModifications method createServiceModifications.
/**
* This will use the service schemas to find any upgrade handlers registered for the service and
* populate the NewServiceWrapper's ServiceSchemaModificationWrappers.
* @param newSchemaMap The service schemas representing the service.
* @throws UpgradeException If an upgrade error occurs.
*/
private void createServiceModifications(Map<String, ServiceSchemaImpl> newSchemaMap) throws UpgradeException {
try {
final Map<String, ServiceSchemaModificationWrapper> serviceSchemaMap = new HashMap<String, ServiceSchemaModificationWrapper>();
for (Map.Entry<String, ServiceSchemaImpl> newAttrSchemaEntry : newSchemaMap.entrySet()) {
final ServiceSchemaModificationWrapper attributesAdded = getServiceModificationsRecursive(newAttrSchemaEntry.getKey(), newAttrSchemaEntry.getValue());
if (attributesAdded.hasBeenModified()) {
serviceSchemaMap.put(newAttrSchemaEntry.getKey(), attributesAdded);
}
}
newServiceWrapper = new NewServiceWrapper(serviceName, serviceSchemaMap, serviceSchemaDoc);
} catch (SMSException smse) {
UpgradeUtils.debug.error("Error whilst determining schema changes for service: " + serviceName, smse);
throw new UpgradeException(smse.getMessage(), smse);
}
}
Aggregations