use of eu.bcvsolutions.idm.ic.impl.IcConnectorInstanceImpl in project CzechIdMng by bcvsolutions.
the class DefaultVsRequestService method getVirtualConnector.
/**
* Get virtual connector by vs request
*
* @param request
* @return
*/
private VsVirtualConnector getVirtualConnector(VsRequestDto request) {
IcConnectorInfo connectorInfo = //
czechIdMConfigurationService.getAvailableLocalConnectors().stream().filter(//
info -> request.getConnectorKey().equals(info.getConnectorKey().getFullName())).findFirst().orElse(null);
if (connectorInfo == null) {
throw new IcException(MessageFormat.format("We cannot found connector info by connector key [{0}] from virtual system request!", request.getConnectorKey()));
}
IcConnectorInstance connectorKeyInstance = new IcConnectorInstanceImpl(null, connectorInfo.getConnectorKey(), false);
IcConnector connectorInstance = czechIdMConnectorService.getConnectorInstance(connectorKeyInstance, request.getConfiguration());
if (!(connectorInstance instanceof VsVirtualConnector)) {
throw new IcException("Found connector instance is not virtual system connector!");
}
VsVirtualConnector virtualConnector = (VsVirtualConnector) connectorInstance;
return virtualConnector;
}
use of eu.bcvsolutions.idm.ic.impl.IcConnectorInstanceImpl in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemServiceIntegrationTest method testCreateConnectorConfiguration.
@Test
public void testCreateConnectorConfiguration() {
// TODO: test system will be moved here, after UI eav form implementation
@SuppressWarnings("deprecation") IcConnectorKey connectorKey = systemService.getTestConnectorKey();
// create connector instance impl with connector key
IcConnectorInstance connectorInstance = new IcConnectorInstanceImpl(null, connectorKey, false);
IcConnectorConfiguration conf = icConfigurationAggregatorService.getConnectorConfiguration(connectorInstance);
IdmFormDefinitionDto savedFormDefinition = systemService.getConnectorFormDefinition(connectorInstance);
assertEquals(conf.getConfigurationProperties().getProperties().size(), savedFormDefinition.getFormAttributes().size());
assertEquals(conf.getConfigurationProperties().getProperties().get(3).getDisplayName(), savedFormDefinition.getFormAttributes().get(3).getName());
}
use of eu.bcvsolutions.idm.ic.impl.IcConnectorInstanceImpl in project CzechIdMng by bcvsolutions.
the class DefaultVsSystemService method getConnectorInstance.
@Transactional
@Override
public IcConnector getConnectorInstance(UUID systemId, IcConnectorInfo connectorInfo) {
Assert.notNull(systemId, "System ID is required!");
Assert.notNull(connectorInfo, "Connector info is required.");
IcConnectorInstance connectorKeyInstance = new IcConnectorInstanceImpl(null, connectorInfo.getConnectorKey(), false);
IcConnectorConfiguration configuration = systemService.getConnectorConfiguration(systemService.get(systemId));
// VŠ: !Bigger change ... configuration of system is not load from the request,
// but is online loading.
// There was problem with implementers. They was updated by implementers stored
// in the request configuration!
IcConnector connectorInstance = czechIdMConnectorService.getConnectorInstance(connectorKeyInstance, configuration);
return connectorInstance;
}
use of eu.bcvsolutions.idm.ic.impl.IcConnectorInstanceImpl in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemServiceTest method testCreateConnectorConfiguration.
@Test
public void testCreateConnectorConfiguration() {
// TODO: test system will be moved here, after UI eav form implementation
@SuppressWarnings("deprecation") IcConnectorKey connectorKey = systemService.getTestConnectorKey();
// create connector instance impl with connector key
IcConnectorInstance connectorInstance = new IcConnectorInstanceImpl(null, connectorKey, false);
IcConnectorConfiguration conf = icConfigurationAggregatorService.getConnectorConfiguration(connectorInstance);
IdmFormDefinitionDto savedFormDefinition = systemService.getConnectorFormDefinition(connectorInstance);
assertEquals(conf.getConfigurationProperties().getProperties().size(), savedFormDefinition.getFormAttributes().size());
assertEquals(conf.getConfigurationProperties().getProperties().get(3).getDisplayName(), savedFormDefinition.getFormAttributes().get(3).getName());
}
Aggregations