use of eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningArchiveServiceIntegrationTest method testOperationArchivateWithMultiRemovedAttribute.
@Test
public void testOperationArchivateWithMultiRemovedAttribute() {
SysSystemDto system = getHelper().createTestResourceSystem(false);
//
IcAttribute icAttributeOne = new IcAttributeImpl(getHelper().createName(), Lists.newArrayList());
IcConnectorObject connectorObject = new IcConnectorObjectImpl(getHelper().createName(), new IcObjectClassImpl("__mock__"), ImmutableList.of(icAttributeOne));
//
SysProvisioningOperationDto operation = prepareProvisioningOperation(system);
operation.getProvisioningContext().setConnectorObject(connectorObject);
//
SysProvisioningArchiveDto archive = service.archive(operation);
//
List<SysProvisioningAttribute> attributes = provisioningAttributeRepository.findAllByProvisioningId(archive.getId());
//
Assert.assertEquals(1, attributes.size());
Assert.assertEquals(icAttributeOne.getName(), attributes.get(0).getName());
Assert.assertTrue(attributes.get(0).isRemoved());
}
use of eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl in project CzechIdMng by bcvsolutions.
the class ConnIdIcConvertUtil method convertConnIdObjectClass.
public static IcObjectClass convertConnIdObjectClass(ObjectClass objectClass) {
if (objectClass == null) {
return null;
}
IcObjectClassImpl objectClassDto = new IcObjectClassImpl(objectClass.getObjectClassValue());
objectClassDto.setDisplayName(objectClass.getDisplayNameKey());
return objectClassDto;
}
use of eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl 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, "Connector instance is required.");
Assert.notNull(connectorInstance.getConnectorKey(), "Connector key is required.");
Assert.notNull(connectorConfiguration, "Configuration is required.");
Assert.notNull(uid, "Uid is required.");
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;
}
use of eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl 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, "Connector instance is required.");
Assert.notNull(connectorInstance.getConnectorKey(), "Connector key is required.");
Assert.notNull(connectorConfiguration, "Configuration is required.");
Assert.notNull(attributes, "Attributes are required.");
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;
}
use of eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl 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, "Connector instance is required.");
Assert.notNull(connectorInstance.getConnectorKey(), "Connector key is required.");
Assert.notNull(connectorConfiguration, "Configuration is required.");
Assert.notNull(uid, "Uid is required.");
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);
}
Aggregations