use of eu.bcvsolutions.idm.acc.domain.SynchronizationContext in project CzechIdMng by bcvsolutions.
the class DefaultSynchronizationService method resolveLinkedSituation.
@Override
public SysSyncItemLogDto resolveLinkedSituation(String uid, SystemEntityType entityType, List<IcAttribute> icAttributes, UUID accountId, UUID configId, String actionType) {
Assert.notNull(uid, "Uid is required.");
Assert.notNull(entityType, "Entity type is required.");
Assert.notNull(icAttributes, "Connector attribues are required.");
Assert.notNull(configId, "Configuration identifier is required.");
Assert.notNull(actionType, "Action type is required.");
Assert.notNull(accountId, "Account identifier is required.");
SysSyncItemLogDto itemLog = new SysSyncItemLogDto();
AbstractSysSyncConfigDto config = synchronizationConfigService.get(configId);
SysSystemMappingDto mapping = systemMappingService.get(config.getSystemMapping());
AccAccountDto account = accountService.get(accountId);
SysSystemAttributeMappingFilter attributeHandlingFilter = new SysSystemAttributeMappingFilter();
attributeHandlingFilter.setSystemMappingId(mapping.getId());
List<SysSystemAttributeMappingDto> mappedAttributes = attributeHandlingService.find(attributeHandlingFilter, null).getContent();
// Little workaround, we have only IcAttributes ... we create IcObject manually
IcConnectorObjectImpl icObject = new IcConnectorObjectImpl();
icObject.setAttributes(icAttributes);
icObject.setUidValue(uid);
SynchronizationContext context = new SynchronizationContext();
//
context.addUid(uid).addAccount(//
account).addConfig(//
config).addEntityType(//
entityType).addLogItem(//
itemLog).addMappedAttributes(//
mappedAttributes).addIcObject(//
icObject);
getSyncExecutor(entityType, configId).resolveLinkedSituation(SynchronizationLinkedActionType.valueOf(actionType), context);
return itemLog;
}
use of eu.bcvsolutions.idm.acc.domain.SynchronizationContext in project CzechIdMng by bcvsolutions.
the class DefaultSynchronizationService method resolveUnlinkedSituation.
@Override
public SysSyncItemLogDto resolveUnlinkedSituation(String uid, SystemEntityType entityType, UUID entityId, UUID configId, String actionType, List<IcAttribute> icAttributes) {
Assert.notNull(uid, "Uid is required.");
Assert.notNull(entityType, "Entity type is required.");
Assert.notNull(configId, "Configuration identifier is required.");
Assert.notNull(actionType, "Action type is required.");
Assert.notNull(entityId, "Entity identifier is required.");
AbstractSysSyncConfigDto config = synchronizationConfigService.get(configId);
SysSystemMappingDto mapping = systemMappingService.get(config.getSystemMapping());
SysSchemaObjectClassDto sysSchemaObjectClassDto = schemaObjectClassService.get(mapping.getObjectClass());
SysSystemDto system = DtoUtils.getEmbedded(sysSchemaObjectClassDto, SysSchemaObjectClass_.system);
SysSystemEntityDto systemEntity = findSystemEntity(uid, system, entityType);
SysSyncItemLogDto itemLog = new SysSyncItemLogDto();
SysSystemAttributeMappingFilter attributeHandlingFilter = new SysSystemAttributeMappingFilter();
attributeHandlingFilter.setSystemMappingId(mapping.getId());
List<SysSystemAttributeMappingDto> mappedAttributes = attributeHandlingService.find(attributeHandlingFilter, null).getContent();
// Little workaround, we have only IcAttributes ... we create IcObject manually
IcConnectorObjectImpl icObject = new IcConnectorObjectImpl();
icObject.setAttributes(icAttributes);
icObject.setUidValue(uid);
SynchronizationContext context = new SynchronizationContext();
//
context.addUid(uid).addSystem(//
system).addConfig(//
config).addEntityType(//
entityType).addEntityId(//
entityId).addLogItem(//
itemLog).addSystemEntity(//
systemEntity).addIcObject(//
icObject).addMappedAttributes(//
mappedAttributes);
getSyncExecutor(entityType, configId).resolveUnlinkedSituation(SynchronizationUnlinkedActionType.valueOf(actionType), context);
return itemLog;
}
Aggregations