Search in sources :

Example 1 with IcConnectorInstance

use of eu.bcvsolutions.idm.ic.api.IcConnectorInstance 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;
}
Also used : IcConnectorInfo(eu.bcvsolutions.idm.ic.api.IcConnectorInfo) IcConnectorInstance(eu.bcvsolutions.idm.ic.api.IcConnectorInstance) IcConnectorInstanceImpl(eu.bcvsolutions.idm.ic.impl.IcConnectorInstanceImpl) IcException(eu.bcvsolutions.idm.ic.exception.IcException) IcConnector(eu.bcvsolutions.idm.ic.api.IcConnector) VsVirtualConnector(eu.bcvsolutions.idm.vs.connector.api.VsVirtualConnector)

Example 2 with IcConnectorInstance

use of eu.bcvsolutions.idm.ic.api.IcConnectorInstance in project CzechIdMng by bcvsolutions.

the class OperationOptionsIntegrationTest method t1_testOperationOptionsSetting.

@Test
public void t1_testOperationOptionsSetting() {
    Mockito.when(mockFacadeFactory.getConnectorFacade(Mockito.any(), Mockito.any())).thenReturn(mockConnector);
    SysSystemDto system = systemService.getByCode(TEST_SYSTEM_NAME);
    SysSystemMappingDto mapping = accTestHelper.createMapping(system);
    IcConnectorInstance connectorInstance = systemService.getConnectorInstance(system);
    IdmFormDefinitionDto operationOptionsConnectorFormDefinition = systemService.getOperationOptionsConnectorFormDefinition(system);
    IcObjectClassImpl icObjectClass = new IcObjectClassImpl(sysSchemaObjectClassService.get(mapping.getObjectClass()).getObjectClassName());
    connIdIcConnectorService.search(connectorInstance, systemService.getConnectorConfiguration(system), icObjectClass, null, a -> true);
    Mockito.verify(mockFacadeFactory, Mockito.atLeastOnce()).getConnectorFacade(Mockito.any(), Mockito.any());
    Mockito.verify(mockConnector, Mockito.times(1)).search(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.argThat(operationOptions -> operationOptions.getOptions().isEmpty()));
    formService.saveValues(system, operationOptionsConnectorFormDefinition, OperationOptions.OP_PAGE_SIZE, Collections.singletonList(42069));
    formService.saveValues(system, operationOptionsConnectorFormDefinition, OperationOptions.OP_ATTRIBUTES_TO_GET, Arrays.asList("attr1", "attr2"));
    connIdIcConnectorService.search(connectorInstance, systemService.getConnectorConfiguration(system), icObjectClass, null, a -> true);
    connIdIcConnectorService.createObject(connectorInstance, systemService.getConnectorConfiguration(system), icObjectClass, Collections.emptyList());
    connIdIcConnectorService.updateObject(connectorInstance, systemService.getConnectorConfiguration(system), icObjectClass, new IcUidAttributeImpl("a", "a", "a"), Collections.emptyList());
    connIdIcConnectorService.authenticateObject(connectorInstance, systemService.getConnectorConfiguration(system), icObjectClass, "aaa", new GuardedString("a"));
    connIdIcConnectorService.deleteObject(connectorInstance, systemService.getConnectorConfiguration(system), icObjectClass, new IcUidAttributeImpl("a", "a", "a"));
    connIdIcConnectorService.readObject(connectorInstance, systemService.getConnectorConfiguration(system), icObjectClass, new IcUidAttributeImpl("a", "a", "a"));
    connIdIcConnectorService.synchronization(connectorInstance, systemService.getConnectorConfiguration(system), icObjectClass, null, a -> true);
    ArgumentMatcher<OperationOptions> optionsMatcher = operationOptions -> !operationOptions.getOptions().isEmpty() && operationOptions.getPageSize() == 42069 && Arrays.asList(operationOptions.getAttributesToGet()).containsAll(Arrays.asList("attr1", "attr2"));
    Mockito.verify(mockConnector, Mockito.times(1)).search(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.argThat(optionsMatcher));
    Mockito.verify(mockConnector, Mockito.times(1)).getObject(Mockito.any(), Mockito.any(), Mockito.argThat(optionsMatcher));
    Mockito.verify(mockConnector, Mockito.times(1)).create(Mockito.any(), Mockito.any(), Mockito.argThat(optionsMatcher));
    Mockito.verify(mockConnector, Mockito.times(1)).update(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.argThat(optionsMatcher));
    Mockito.verify(mockConnector, Mockito.times(1)).delete(Mockito.any(), Mockito.any(), Mockito.argThat(optionsMatcher));
    Mockito.verify(mockConnector, Mockito.times(1)).sync(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.argThat(optionsMatcher));
    Mockito.verify(mockConnector, Mockito.times(1)).authenticate(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.argThat(optionsMatcher));
}
Also used : MethodSorters(org.junit.runners.MethodSorters) IcConnectorFacade(eu.bcvsolutions.idm.ic.service.api.IcConnectorFacade) Arrays(java.util.Arrays) Mock(org.mockito.Mock) Autowired(org.springframework.beans.factory.annotation.Autowired) FormService(eu.bcvsolutions.idm.core.eav.api.service.FormService) IcObjectClassImpl(eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) ArgumentMatcher(org.mockito.ArgumentMatcher) IcConnectorInstance(eu.bcvsolutions.idm.ic.api.IcConnectorInstance) IcUidAttributeImpl(eu.bcvsolutions.idm.ic.impl.IcUidAttributeImpl) OperationOptions(org.identityconnectors.framework.common.objects.OperationOptions) Spy(org.mockito.Spy) ConnectorFacade(org.identityconnectors.framework.api.ConnectorFacade) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) DefaultIcConnectorFacadeFactory(eu.bcvsolutions.idm.ic.connid.service.impl.DefaultIcConnectorFacadeFactory) IdmFormInstanceDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto) InjectMocks(org.mockito.InjectMocks) SysSystem(eu.bcvsolutions.idm.acc.entity.SysSystem) SysSystemService(eu.bcvsolutions.idm.acc.service.api.SysSystemService) Test(org.junit.Test) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) ConnIdIcConnectorService(eu.bcvsolutions.idm.ic.connid.service.impl.ConnIdIcConnectorService) Mockito(org.mockito.Mockito) DefaultAccTestHelper(eu.bcvsolutions.idm.acc.DefaultAccTestHelper) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) Assert(org.junit.Assert) FixMethodOrder(org.junit.FixMethodOrder) TestResource(eu.bcvsolutions.idm.acc.entity.TestResource) Collections(java.util.Collections) OperationOptions(org.identityconnectors.framework.common.objects.OperationOptions) IcObjectClassImpl(eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl) IcUidAttributeImpl(eu.bcvsolutions.idm.ic.impl.IcUidAttributeImpl) IcConnectorInstance(eu.bcvsolutions.idm.ic.api.IcConnectorInstance) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 3 with IcConnectorInstance

use of eu.bcvsolutions.idm.ic.api.IcConnectorInstance 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());
}
Also used : IcConnectorConfiguration(eu.bcvsolutions.idm.ic.api.IcConnectorConfiguration) IcConnectorKey(eu.bcvsolutions.idm.ic.api.IcConnectorKey) IcConnectorInstance(eu.bcvsolutions.idm.ic.api.IcConnectorInstance) IcConnectorInstanceImpl(eu.bcvsolutions.idm.ic.impl.IcConnectorInstanceImpl) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 4 with IcConnectorInstance

use of eu.bcvsolutions.idm.ic.api.IcConnectorInstance in project CzechIdMng by bcvsolutions.

the class AdUserConnectorType method getConnectorValuesByAttribute.

/**
 * Search connector values for given attribute.
 * If is system in cross-domain system group, then is will be call this method for all systems in a group.
 * For searching in other systems will be used SID, GROUPS and 'foreignSecurityPrincipals' container.
 */
@Override
public List<Object> getConnectorValuesByAttribute(String uid, IcObjectClass objectClass, String schemaAttributeName, SysSystemDto system, IcConnectorObject connectorObject, SysSystemGroupSystemDto systemGroupSystem) {
    List<Object> connectorValues = super.getConnectorValuesByAttribute(uid, objectClass, schemaAttributeName, system, connectorObject, systemGroupSystem);
    if (systemGroupSystem == null) {
        // Find if the system is in a group with cross-domain type and for given schema attribute.
        SysSystemGroupSystemFilter systemGroupSystemFilter = new SysSystemGroupSystemFilter();
        systemGroupSystemFilter.setGroupType(SystemGroupType.CROSS_DOMAIN);
        systemGroupSystemFilter.setDisabled(Boolean.FALSE);
        systemGroupSystemFilter.setSystemId(system.getId());
        systemGroupSystemFilter.setMergeAttributeCode(schemaAttributeName);
        UUID systemGroupId = systemGroupSystemService.find(systemGroupSystemFilter, null).getContent().stream().findFirst().map(SysSystemGroupSystemDto::getSystemGroup).orElse(null);
        if (systemGroupId == null) {
            // System is not in a cross-domain group -> we have all connector values.
            return connectorValues;
        }
        // Found all group-systems for this group (without given system).
        systemGroupSystemFilter.setSystemGroupId(systemGroupId);
        systemGroupSystemFilter.setSystemId(null);
        List<SysSystemGroupSystemDto> groupSystems = systemGroupSystemService.find(systemGroupSystemFilter, null).getContent().stream().filter(groupSystem -> !system.getId().equals(groupSystem.getSystem())).collect(Collectors.toList());
        // Call connector type for every system and load values for given attribute.
        groupSystems.forEach(groupSystem -> {
            SysSystemDto systemInGroup = DtoUtils.getEmbedded(groupSystem, SysSystemGroupSystem_.system, SysSystemDto.class);
            ConnectorType connectorType = getConnectorManager().findConnectorTypeBySystem(systemInGroup);
            if (connectorType != null) {
                List<Object> connectorValuesForSystemInGroup = connectorType.getConnectorValuesByAttribute(uid, objectClass, schemaAttributeName, systemInGroup, connectorObject, groupSystem);
                if (connectorValuesForSystemInGroup != null) {
                    connectorValuesForSystemInGroup.forEach(value -> {
                        if (!connectorValues.contains(value)) {
                            connectorValues.add(value);
                        }
                    });
                }
            }
        });
    } else {
        // System group is not null, so this is sub system in group. We need to get groups by SID.
        Assert.notNull(connectorObject, "The parent connector object cannot be null!");
        IcAttribute sid = connectorObject.getAttributeByName(SID_ATTRIBUTE_KEY);
        Assert.notNull(sid, "SID attribute cannot be null!");
        Object sidValue = sid.getValue();
        Assert.notNull(sidValue, "SID value cannot be null!");
        IdmFormDefinitionDto operationOptionsFormDefinition = this.getSystemService().getOperationOptionsConnectorFormDefinition(system);
        Assert.notNull(operationOptionsFormDefinition, "Operation options form-definition cannot be null!");
        // Find attribute with container with existed users.
        String userContainer = getValueFromConnectorInstance(USER_SEARCH_CONTAINER_KEY, system, operationOptionsFormDefinition);
        Assert.notNull(userContainer, "User container cannot be null!");
        // First we have to find root DN (only DCs).
        String dcs = getRoot(userContainer);
        String foreignSecurityPrincipalsDN = MessageFormat.format("CN={0},CN={1},{2}", convertSidToStr((byte[]) sidValue), FOREIGN_SECURITY_PRINCIPALS_CN, dcs);
        IcConnectorConfiguration connectorConfiguration = getSystemService().getConnectorConfiguration(system);
        IcConnectorInstance connectorInstance = getSystemService().getConnectorInstance(system);
        Set<String> groups = searchGroups("member", connectorConfiguration, connectorInstance, foreignSecurityPrincipalsDN);
        connectorValues.addAll(groups);
    }
    return connectorValues;
}
Also used : ModificationItem(javax.naming.directory.ModificationItem) SSLContext(javax.net.ssl.SSLContext) DtoUtils(eu.bcvsolutions.idm.core.api.utils.DtoUtils) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) Autowired(org.springframework.beans.factory.annotation.Autowired) SysSystemAttributeMapping_(eu.bcvsolutions.idm.acc.entity.SysSystemAttributeMapping_) IcConnectorInstance(eu.bcvsolutions.idm.ic.api.IcConnectorInstance) Map(java.util.Map) SynchronizationUnlinkedActionType(eu.bcvsolutions.idm.acc.domain.SynchronizationUnlinkedActionType) AbstractSysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto) IdmEntityStateService(eu.bcvsolutions.idm.core.api.service.IdmEntityStateService) IdmIdentity(eu.bcvsolutions.idm.core.model.entity.IdmIdentity) IcFilter(eu.bcvsolutions.idm.ic.filter.api.IcFilter) SysSchemaAttributeFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSchemaAttributeFilter) SystemOperationType(eu.bcvsolutions.idm.acc.domain.SystemOperationType) Set(java.util.Set) KeyManagementException(java.security.KeyManagementException) ReconciliationMissingAccountActionType(eu.bcvsolutions.idm.acc.domain.ReconciliationMissingAccountActionType) SysSchemaObjectClassFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSchemaObjectClassFilter) ZoneId(java.time.ZoneId) Serializable(java.io.Serializable) SSLSocketFactory(javax.net.ssl.SSLSocketFactory) ByteOrder(java.nio.ByteOrder) SSLException(javax.net.ssl.SSLException) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject) Attributes(javax.naming.directory.Attributes) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) Strings(org.apache.logging.log4j.util.Strings) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) AccResultCode(eu.bcvsolutions.idm.acc.domain.AccResultCode) SearchResult(javax.naming.directory.SearchResult) IcConnectorFacade(eu.bcvsolutions.idm.ic.service.api.IcConnectorFacade) SysSystemGroupSystem_(eu.bcvsolutions.idm.acc.entity.SysSystemGroupSystem_) Pair(eu.bcvsolutions.idm.core.api.domain.Pair) SysSystemGroupSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemGroupSystemFilter) IdmAttachmentDto(eu.bcvsolutions.idm.core.ecm.api.dto.IdmAttachmentDto) SynchronizationInactiveOwnerBehaviorType(eu.bcvsolutions.idm.acc.domain.SynchronizationInactiveOwnerBehaviorType) ConnectorType(eu.bcvsolutions.idm.acc.service.api.ConnectorType) InitialDirContext(javax.naming.directory.InitialDirContext) BasicAttribute(javax.naming.directory.BasicAttribute) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) Lists(com.google.common.collect.Lists) SSLSession(javax.net.ssl.SSLSession) SynchronizationLinkedActionType(eu.bcvsolutions.idm.acc.domain.SynchronizationLinkedActionType) IcObjectClass(eu.bcvsolutions.idm.ic.api.IcObjectClass) ConnectorTypeDto(eu.bcvsolutions.idm.acc.dto.ConnectorTypeDto) Context(javax.naming.Context) IcAttributeInfo(eu.bcvsolutions.idm.ic.api.IcAttributeInfo) IcFilterBuilder(eu.bcvsolutions.idm.ic.filter.impl.IcFilterBuilder) CoreException(eu.bcvsolutions.idm.core.api.exception.CoreException) IcConnectorKey(eu.bcvsolutions.idm.ic.api.IcConnectorKey) DirContext(javax.naming.directory.DirContext) OperationState(eu.bcvsolutions.idm.core.api.domain.OperationState) NameAlreadyBoundException(javax.naming.NameAlreadyBoundException) SystemMappingEvent(eu.bcvsolutions.idm.acc.event.SystemMappingEvent) IOException(java.io.IOException) FileUtils(org.apache.commons.io.FileUtils) IcAttribute(eu.bcvsolutions.idm.ic.api.IcAttribute) UnknownHostException(java.net.UnknownHostException) File(java.io.File) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) IcConnectorConfigurationImpl(eu.bcvsolutions.idm.ic.impl.IcConnectorConfigurationImpl) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) Paths(java.nio.file.Paths) X509TrustManager(javax.net.ssl.X509TrustManager) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) IdmIdentity_(eu.bcvsolutions.idm.core.model.entity.IdmIdentity_) X509Certificate(java.security.cert.X509Certificate) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) SysSystemGroupSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemGroupSystemDto) Date(java.util.Date) SysSyncConfigFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncConfigFilter) SSLSocket(javax.net.ssl.SSLSocket) TrustManager(javax.net.ssl.TrustManager) NamingException(javax.naming.NamingException) AuthenticationException(javax.naming.AuthenticationException) ByteBuffer(java.nio.ByteBuffer) SysConnectorKeyDto(eu.bcvsolutions.idm.acc.dto.SysConnectorKeyDto) Attribute(javax.naming.directory.Attribute) ByteArrayInputStream(java.io.ByteArrayInputStream) SysSchemaAttribute_(eu.bcvsolutions.idm.acc.entity.SysSchemaAttribute_) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) SynchronizationMissingEntityActionType(eu.bcvsolutions.idm.acc.domain.SynchronizationMissingEntityActionType) IdmFormAttributeService(eu.bcvsolutions.idm.core.eav.api.service.IdmFormAttributeService) SysSyncConfigService(eu.bcvsolutions.idm.acc.service.api.SysSyncConfigService) ImmutableMap(com.google.common.collect.ImmutableMap) BasicAttributes(javax.naming.directory.BasicAttributes) SysSchemaObjectClassDto(eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto) IdmEntityStateFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityStateFilter) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) SysSyncIdentityConfigDto(eu.bcvsolutions.idm.acc.dto.SysSyncIdentityConfigDto) IdmEntityStateDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto) List(java.util.List) Certificate(java.security.cert.Certificate) NamingEnumeration(javax.naming.NamingEnumeration) SysSchemaObjectClassService(eu.bcvsolutions.idm.acc.service.api.SysSchemaObjectClassService) DefaultResultModel(eu.bcvsolutions.idm.core.api.dto.DefaultResultModel) IcConnectorConfiguration(eu.bcvsolutions.idm.ic.api.IcConnectorConfiguration) CertificateUtils(eu.bcvsolutions.idm.core.api.utils.CertificateUtils) HashMap(java.util.HashMap) IcObjectClassImpl(eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) ConnectorException(org.identityconnectors.framework.common.exceptions.ConnectorException) SearchControls(javax.naming.directory.SearchControls) PersistentType(eu.bcvsolutions.idm.core.eav.api.domain.PersistentType) MessageFormat(java.text.MessageFormat) SysSystemMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemMappingService) EntityStateManager(eu.bcvsolutions.idm.core.api.service.EntityStateManager) IcObjectClassInfo(eu.bcvsolutions.idm.ic.api.IcObjectClassInfo) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) OperationResultDto(eu.bcvsolutions.idm.core.api.dto.OperationResultDto) IcAttributeImpl(eu.bcvsolutions.idm.ic.impl.IcAttributeImpl) SysSystemGroupSystemService(eu.bcvsolutions.idm.acc.service.api.SysSystemGroupSystemService) Hashtable(java.util.Hashtable) SysSystemMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemMappingFilter) AttachmentManager(eu.bcvsolutions.idm.core.ecm.api.service.AttachmentManager) CertificateException(java.security.cert.CertificateException) SysSchemaAttributeService(eu.bcvsolutions.idm.acc.service.api.SysSchemaAttributeService) SpinalCase(eu.bcvsolutions.idm.core.api.utils.SpinalCase) SystemGroupType(eu.bcvsolutions.idm.acc.domain.SystemGroupType) Component(org.springframework.stereotype.Component) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) CommunicationException(javax.naming.CommunicationException) Comparator(java.util.Comparator) DigestUtils(org.apache.commons.codec.digest.DigestUtils) SysSystemAttributeMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemAttributeMappingService) ResultModel(eu.bcvsolutions.idm.core.api.dto.ResultModel) Transactional(org.springframework.transaction.annotation.Transactional) Assert(org.springframework.util.Assert) IcConnectorConfiguration(eu.bcvsolutions.idm.ic.api.IcConnectorConfiguration) SysSystemGroupSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemGroupSystemFilter) ConnectorType(eu.bcvsolutions.idm.acc.service.api.ConnectorType) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) SysSystemGroupSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemGroupSystemDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) IcAttribute(eu.bcvsolutions.idm.ic.api.IcAttribute) IcConnectorInstance(eu.bcvsolutions.idm.ic.api.IcConnectorInstance) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject) UUID(java.util.UUID)

Example 5 with IcConnectorInstance

use of eu.bcvsolutions.idm.ic.api.IcConnectorInstance 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;
}
Also used : IcConnectorConfiguration(eu.bcvsolutions.idm.ic.api.IcConnectorConfiguration) IcConnectorInstance(eu.bcvsolutions.idm.ic.api.IcConnectorInstance) IcConnectorInstanceImpl(eu.bcvsolutions.idm.ic.impl.IcConnectorInstanceImpl) IcConnector(eu.bcvsolutions.idm.ic.api.IcConnector) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

IcConnectorInstance (eu.bcvsolutions.idm.ic.api.IcConnectorInstance)15 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)10 IdmFormDefinitionDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto)10 IcConnectorConfiguration (eu.bcvsolutions.idm.ic.api.IcConnectorConfiguration)9 IcConnectorInstanceImpl (eu.bcvsolutions.idm.ic.impl.IcConnectorInstanceImpl)6 Test (org.junit.Test)6 ConnectorTypeDto (eu.bcvsolutions.idm.acc.dto.ConnectorTypeDto)5 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)5 IcConnectorKey (eu.bcvsolutions.idm.ic.api.IcConnectorKey)5 Autowired (org.springframework.beans.factory.annotation.Autowired)5 Transactional (org.springframework.transaction.annotation.Transactional)5 ImmutableMap (com.google.common.collect.ImmutableMap)4 AccResultCode (eu.bcvsolutions.idm.acc.domain.AccResultCode)4 SysSchemaAttributeDto (eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto)4 SysSchemaObjectClassDto (eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto)4 SysSystemAttributeMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto)4 BaseDto (eu.bcvsolutions.idm.core.api.dto.BaseDto)4 IcConfigurationProperties (eu.bcvsolutions.idm.ic.api.IcConfigurationProperties)4 IcConfigurationProperty (eu.bcvsolutions.idm.ic.api.IcConfigurationProperty)4 IcConnectorObject (eu.bcvsolutions.idm.ic.api.IcConnectorObject)4