Search in sources :

Example 16 with IcException

use of eu.bcvsolutions.idm.ic.exception.IcException in project CzechIdMng by bcvsolutions.

the class CzechIdMIcConnectorService method search.

@Override
public void search(IcConnectorInstance connectorInstance, IcConnectorConfiguration connectorConfiguration, IcObjectClass objectClass, IcFilter filter, IcResultsHandler handler) {
    Assert.notNull(connectorInstance);
    Assert.notNull(connectorInstance.getConnectorKey());
    Assert.notNull(connectorConfiguration);
    Assert.notNull(objectClass);
    Assert.notNull(handler);
    String key = connectorInstance.getConnectorKey().toString();
    LOG.debug("Start search for connector {} and objectClass {} and filter {} - CzechIdM", key, objectClass.getDisplayName(), filter);
    IcConnector connector = this.getConnectorInstance(connectorInstance, connectorConfiguration);
    if (!(connector instanceof IcCanSearch)) {
        throw new IcException(MessageFormat.format("Connector [{0}] not supports search operation!", key));
    }
    ((IcCanSearch) connector).search(objectClass, filter, handler);
}
Also used : IcConnector(eu.bcvsolutions.idm.ic.api.IcConnector) IcException(eu.bcvsolutions.idm.ic.exception.IcException) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) IcCanSearch(eu.bcvsolutions.idm.ic.api.operation.IcCanSearch)

Example 17 with IcException

use of eu.bcvsolutions.idm.ic.exception.IcException in project CzechIdMng by bcvsolutions.

the class CzechIdMIcConnectorService method readObject.

@Override
public IcConnectorObject readObject(IcConnectorInstance connectorInstance, IcConnectorConfiguration connectorConfiguration, IcObjectClass objectClass, IcUidAttribute uid) {
    Assert.notNull(connectorInstance);
    Assert.notNull(connectorInstance.getConnectorKey());
    Assert.notNull(connectorConfiguration);
    Assert.notNull(uid);
    String key = connectorInstance.getConnectorKey().toString();
    LOG.debug("Read object - CzechIdM (Uid= {} {})", uid, key);
    if (objectClass == null) {
        objectClass = new IcObjectClassImpl(IcObjectClassInfo.ACCOUNT);
    }
    IcConnector connector = this.getConnectorInstance(connectorInstance, connectorConfiguration);
    if (!(connector instanceof IcCanRead)) {
        throw new IcException(MessageFormat.format("Connector [{0}] not supports read operation!", key));
    }
    IcConnectorObject object = ((IcCanRead) connector).read(uid, objectClass);
    LOG.debug("Readed object - CzechIdM ({}) Uid= {}", object, uid);
    return object;
}
Also used : IcObjectClassImpl(eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject) IcCanRead(eu.bcvsolutions.idm.ic.api.operation.IcCanRead) IcConnector(eu.bcvsolutions.idm.ic.api.IcConnector) IcException(eu.bcvsolutions.idm.ic.exception.IcException) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString)

Example 18 with IcException

use of eu.bcvsolutions.idm.ic.exception.IcException in project CzechIdMng by bcvsolutions.

the class CzechIdMIcConnectorService method createObject.

@Override
public IcUidAttribute createObject(IcConnectorInstance connectorInstance, IcConnectorConfiguration connectorConfiguration, IcObjectClass objectClass, List<IcAttribute> attributes) {
    Assert.notNull(connectorInstance);
    Assert.notNull(connectorInstance.getConnectorKey());
    Assert.notNull(connectorConfiguration);
    Assert.notNull(attributes);
    String key = connectorInstance.getConnectorKey().toString();
    LOG.debug("Create object - CzechIdM ({} {})", key, attributes.toString());
    if (objectClass == null) {
        objectClass = new IcObjectClassImpl(IcObjectClassInfo.ACCOUNT);
    }
    IcConnector connector = this.getConnectorInstance(connectorInstance, connectorConfiguration);
    if (!(connector instanceof IcCanCreate)) {
        throw new IcException(MessageFormat.format("Connector [{0}] not supports create operation!", key));
    }
    IcUidAttribute uid = ((IcCanCreate) connector).create(objectClass, attributes);
    LOG.debug("Created object - CzechIdM ({} {}) Uid= {}", key, attributes.toString(), uid);
    return null;
}
Also used : IcObjectClassImpl(eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl) IcCanCreate(eu.bcvsolutions.idm.ic.api.operation.IcCanCreate) IcConnector(eu.bcvsolutions.idm.ic.api.IcConnector) IcException(eu.bcvsolutions.idm.ic.exception.IcException) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) IcUidAttribute(eu.bcvsolutions.idm.ic.api.IcUidAttribute)

Example 19 with IcException

use of eu.bcvsolutions.idm.ic.exception.IcException in project CzechIdMng by bcvsolutions.

the class CzechIdMIcConnectorService method deleteObject.

@Override
public void deleteObject(IcConnectorInstance connectorInstance, IcConnectorConfiguration connectorConfiguration, IcObjectClass objectClass, IcUidAttribute uid) {
    Assert.notNull(connectorInstance);
    Assert.notNull(connectorInstance.getConnectorKey());
    Assert.notNull(connectorConfiguration);
    Assert.notNull(uid);
    String key = connectorInstance.getConnectorKey().toString();
    LOG.debug("Delete object - CzechIdM (Uid= {} {})", uid, key);
    if (objectClass == null) {
        objectClass = new IcObjectClassImpl(IcObjectClassInfo.ACCOUNT);
    }
    IcConnector connector = this.getConnectorInstance(connectorInstance, connectorConfiguration);
    if (!(connector instanceof IcCanDelete)) {
        throw new IcException(MessageFormat.format("Connector [{0}] not supports delete operation!", key));
    }
    ((IcCanDelete) connector).delete(uid, objectClass);
    LOG.debug("Deleted object - CzechIdM ({}) Uid= {}", key, uid);
}
Also used : IcCanDelete(eu.bcvsolutions.idm.ic.api.operation.IcCanDelete) IcObjectClassImpl(eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl) IcConnector(eu.bcvsolutions.idm.ic.api.IcConnector) IcException(eu.bcvsolutions.idm.ic.exception.IcException) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString)

Example 20 with IcException

use of eu.bcvsolutions.idm.ic.exception.IcException in project CzechIdMng by bcvsolutions.

the class CzechIdMIcConnectorService method authenticateObject.

@Override
public IcUidAttribute authenticateObject(IcConnectorInstance connectorInstance, IcConnectorConfiguration connectorConfiguration, IcObjectClass objectClass, String username, GuardedString password) {
    Assert.notNull(connectorInstance);
    Assert.notNull(connectorInstance.getConnectorKey());
    Assert.notNull(connectorConfiguration);
    Assert.notNull(username);
    String key = connectorInstance.getConnectorKey().toString();
    LOG.debug("Authenticate object - CzechIdM (username= {} {})", username, key);
    throw new IcException(MessageFormat.format("Connector [{0}] not supports authentication operation!", key));
}
Also used : IcException(eu.bcvsolutions.idm.ic.exception.IcException) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString)

Aggregations

IcException (eu.bcvsolutions.idm.ic.exception.IcException)25 IcConnector (eu.bcvsolutions.idm.ic.api.IcConnector)10 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)7 IcAttribute (eu.bcvsolutions.idm.ic.api.IcAttribute)6 IcConnectorObject (eu.bcvsolutions.idm.ic.api.IcConnectorObject)6 VsAccountDto (eu.bcvsolutions.idm.vs.dto.VsAccountDto)6 IcConnectorInfo (eu.bcvsolutions.idm.ic.api.IcConnectorInfo)4 IcObjectClassImpl (eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl)4 VsRequestDto (eu.bcvsolutions.idm.vs.dto.VsRequestDto)4 ArrayList (java.util.ArrayList)4 UUID (java.util.UUID)4 IcUidAttribute (eu.bcvsolutions.idm.ic.api.IcUidAttribute)3 IcUidAttributeImpl (eu.bcvsolutions.idm.ic.impl.IcUidAttributeImpl)3 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)2 ConfigurationClass (eu.bcvsolutions.idm.core.api.domain.ConfigurationClass)2 IcConnectorInstance (eu.bcvsolutions.idm.ic.api.IcConnectorInstance)2 IcConnectorClass (eu.bcvsolutions.idm.ic.api.annotation.IcConnectorClass)2 IcConnectorInstanceImpl (eu.bcvsolutions.idm.ic.impl.IcConnectorInstanceImpl)2 VsVirtualConnector (eu.bcvsolutions.idm.vs.connector.api.VsVirtualConnector)2 PageRequest (org.springframework.data.domain.PageRequest)2