use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.
the class TestDBTable method test000Integrity.
@Test
public void test000Integrity() throws ObjectNotFoundException, SchemaException {
OperationResult result = createOperationResult();
ResourceType resource = repositoryService.getObject(ResourceType.class, RESOURCE_DERBY_OID, null, result).asObjectable();
String connectorOid = resource.getConnectorRef().getOid();
ConnectorType connector = repositoryService.getObject(ConnectorType.class, connectorOid, null, result).asObjectable();
assertNotNull(connector);
display("DB Connector", connector);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.
the class TestDummyFoundAgain method test101AddAccountWithoutName.
@Test
public void test101AddAccountWithoutName() throws Exception {
// GIVEN
Task syncTask = getTestTask();
OperationResult result = syncTask.getResult();
syncServiceMock.reset();
List<PrismObject<ConnectorType>> connectors = repositoryService.searchObjects(ConnectorType.class, null, null, result);
assertNotNull(connectors);
// lets take first connector
PrismObject<ConnectorType> toBeFoundAgain = connectors.get(0);
connectorManager.invalidate(ConnectorType.class, toBeFoundAgain.getOid(), null);
repositoryService.deleteObject(ConnectorType.class, toBeFoundAgain.getOid(), result);
Holder<ConnectorType> discovered = new Holder<>();
// Consumer is called after initial inRepo check, we add connector again
// so add should fail.
connectorManager.setNotFoundInRepoConsumer(c -> {
discovered.setValue(c);
try {
repositoryService.addObject(toBeFoundAgain, null, result);
} catch (Exception e) {
throw new RuntimeException(e);
}
});
provisioningService.discoverConnectors(null, result);
assertNotNull(discovered.getValue());
assertEquals(discovered.getValue().getConnectorType(), toBeFoundAgain.asObjectable().getConnectorType());
List<PrismObject<ConnectorType>> connectorsAfter = repositoryService.searchObjects(ConnectorType.class, null, null, result);
assertEquals(connectorsAfter.size(), connectors.size());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.
the class ConnIdNameMapper method objectClassToConnId.
@Nullable
ObjectClass objectClassToConnId(PrismObject<? extends ShadowType> shadow, ConnectorType connectorBean, boolean legacySchema) {
ShadowType shadowBean = shadow.asObjectable();
QName objectClassName = shadowBean.getObjectClass();
if (objectClassName == null) {
ResourceAttributeContainer attrContainer = ShadowUtil.getAttributesContainer(shadowBean);
if (attrContainer == null) {
return null;
}
ResourceAttributeContainerDefinition objectClassDefinition = attrContainer.getDefinition();
objectClassName = objectClassDefinition.getTypeName();
}
return objectClassToConnId(objectClassName, connectorBean, legacySchema);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.
the class UcfUtil method getConnectorSchema.
public static PrismSchema getConnectorSchema(ConnectorType connectorType, PrismContext prismContext) throws SchemaException {
XmlSchemaType xmlSchema = connectorType.getSchema();
if (xmlSchema == null) {
return null;
}
Element xsdElement = ObjectTypeUtil.findXsdElement(xmlSchema);
if (xsdElement == null) {
return null;
}
MutablePrismSchema connectorSchema = prismContext.schemaFactory().createPrismSchema(DOMUtil.getSchemaTargetNamespace(xsdElement));
connectorSchema.parseThis(xsdElement, true, connectorType.toString(), prismContext);
return connectorSchema;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.
the class ConnectorFactoryConnIdImpl method listRemoteConnectors.
private Set<ConnectorType> listRemoteConnectors(ConnectorHostType host) {
ConnectorInfoManager remoteConnectorInfoManager = getRemoteConnectorInfoManager(host);
Set<ConnectorType> connectorTypes = new HashSet<>();
List<ConnectorInfo> connectorInfos = remoteConnectorInfoManager.getConnectorInfos();
for (ConnectorInfo connectorInfo : connectorInfos) {
try {
ConnectorType connectorType = convertToConnectorType(connectorInfo, host);
connectorTypes.add(connectorType);
} catch (SchemaException e) {
LOGGER.error("Schema error while initializing ConnId connector {}: {}", getConnectorDesc(connectorInfo), e.getMessage(), e);
}
}
return connectorTypes;
}
Aggregations