@Test public void test100ListConnectorFactories() throws Exception { final String TEST_NAME = "test100ListConnectorFactories"; TestUtil.displayTestTile(TEST_NAME); OperationResult result = new OperationResult(TestConnectorDiscovery.class.getName() + "." + TEST_NAME); TestUtil.displayWhen(TEST_NAME); Collection<ConnectorFactory> connectorFactories = connectorManager.getConnectorFactories(); TestUtil.displayThen(TEST_NAME); assertNotNull("Null connector factories", connectorFactories); assertFalse("No connector factories found", connectorFactories.isEmpty()); display("Found "+connectorFactories.size()+" connector factories"); result.computeStatus(); TestUtil.assertSuccess(result); for (ConnectorFactory connectorFactory : connectorFactories) { display("Found connector factory " +connectorFactory, connectorFactory); } PrismAsserts.assertEqualsUnordered("Wrong connector factories", connectorFactories.stream().map(x -> x.getClass().getName()), "com.evolveum.midpoint.provisioning.ucf.impl.connid.ConnectorFactoryConnIdImpl", "com.evolveum.midpoint.provisioning.ucf.impl.builtin.ConnectorFactoryBuiltinImpl"); }
public Collection<ConnectorFactory> getConnectorFactories() { if (connectorFactories == null) { String[] connectorFactoryBeanNames = springContext.getBeanNamesForType(ConnectorFactory.class); LOGGER.debug("Connector factories bean names: {}", Arrays.toString(connectorFactoryBeanNames)); if (connectorFactoryBeanNames == null) { return null; } connectorFactories = new ArrayList<>(connectorFactoryBeanNames.length); for (String connectorFactoryBeanName: connectorFactoryBeanNames) { Object bean = springContext.getBean(connectorFactoryBeanName); if (bean instanceof ConnectorFactory) { connectorFactories.add((ConnectorFactory)bean); } else { LOGGER.error("Bean {} is not instance of ConnectorFactory, it is {}, skipping", connectorFactoryBeanName, bean.getClass()); } } } return connectorFactories; }
ConnectorManager { public Collection<ConnectorFactory> getConnectorFactories() { if (connectorFactories == null) { String[] connectorFactoryBeanNames = springContext.getBeanNamesForType(ConnectorFactory.class); LOGGER.debug("Connector factories bean names: {}", Arrays.toString(connectorFactoryBeanNames)); if (connectorFactoryBeanNames == null) { return null; } connectorFactories = new ArrayList<>(connectorFactoryBeanNames.length); for (String connectorFactoryBeanName: connectorFactoryBeanNames) { Object bean = springContext.getBean(connectorFactoryBeanName); if (bean instanceof ConnectorFactory) { connectorFactories.add((ConnectorFactory)bean); } else { LOGGER.error("Bean {} is not instance of ConnectorFactory, it is {}, skipping", connectorFactoryBeanName, bean.getClass()); } } } return connectorFactories; } }
ConnectorManager { public Collection<ConnectorFactory> getConnectorFactories() { if (connectorFactories == null) { String[] connectorFactoryBeanNames = springContext.getBeanNamesForType(ConnectorFactory.class); LOGGER.debug("Connector factories bean names: {}", Arrays.toString(connectorFactoryBeanNames)); if (connectorFactoryBeanNames == null) { return null; } connectorFactories = new ArrayList<>(connectorFactoryBeanNames.length); for (String connectorFactoryBeanName: connectorFactoryBeanNames) { Object bean = springContext.getBean(connectorFactoryBeanName); if (bean instanceof ConnectorFactory) { connectorFactories.add((ConnectorFactory)bean); } else { LOGGER.error("Bean {} is not instance of ConnectorFactory, it is {}, skipping", connectorFactoryBeanName, bean.getClass()); } } } return connectorFactories; }  }
ConnectorManager { public Collection<ConnectorFactory> getConnectorFactories() { if (connectorFactories == null) { String[] connectorFactoryBeanNames = springContext.getBeanNamesForType(ConnectorFactory.class); LOGGER.debug("Connector factories bean names: {}", Arrays.toString(connectorFactoryBeanNames)); if (connectorFactoryBeanNames == null) { return null; } connectorFactories = new ArrayList<>(connectorFactoryBeanNames.length); for (String connectorFactoryBeanName: connectorFactoryBeanNames) { Object bean = springContext.getBean(connectorFactoryBeanName); if (bean instanceof ConnectorFactory) { connectorFactories.add((ConnectorFactory)bean); } else { LOGGER.error("Bean {} is not instance of ConnectorFactory, it is {}, skipping", connectorFactoryBeanName, bean.getClass()); } } } return connectorFactories; }  Collection<ConnectorFactory> getConnectorFactories(); ConnectorInstance getConfiguredConnectorInstance(ConnectorSpec connectorSpec, boolean forceFresh, OperationResult result); ConnectorType getConnectorTypeReadOnly(ConnectorSpec connectorSpec, OperationResult result); PrismSchema getConnectorSchema(ConnectorType connectorType); Set<ConnectorType> discoverLocalConnectors(OperationResult parentResult); Set<ConnectorType> discoverConnectors(ConnectorHostType hostType, OperationResult parentResult); String getFrameworkVersion(); void connectorFrameworkSelfTest(OperationResult parentTestResult, Task task); void shutdown(); }
ConnectorManager { public Collection<ConnectorFactory> getConnectorFactories() { if (connectorFactories == null) { String[] connectorFactoryBeanNames = springContext.getBeanNamesForType(ConnectorFactory.class); LOGGER.debug("Connector factories bean names: {}", Arrays.toString(connectorFactoryBeanNames)); if (connectorFactoryBeanNames == null) { return null; } connectorFactories = new ArrayList<>(connectorFactoryBeanNames.length); for (String connectorFactoryBeanName: connectorFactoryBeanNames) { Object bean = springContext.getBean(connectorFactoryBeanName); if (bean instanceof ConnectorFactory) { connectorFactories.add((ConnectorFactory)bean); } else { LOGGER.error("Bean {} is not instance of ConnectorFactory, it is {}, skipping", connectorFactoryBeanName, bean.getClass()); } } } return connectorFactories; }  Collection<ConnectorFactory> getConnectorFactories(); ConnectorInstance getConfiguredConnectorInstance(ConnectorSpec connectorSpec, boolean forceFresh, OperationResult result); ConnectorType getConnectorTypeReadOnly(ConnectorSpec connectorSpec, OperationResult result); PrismSchema getConnectorSchema(ConnectorType connectorType); Set<ConnectorType> discoverLocalConnectors(OperationResult parentResult); Set<ConnectorType> discoverConnectors(ConnectorHostType hostType, OperationResult parentResult); String getFrameworkVersion(); void connectorFrameworkSelfTest(OperationResult parentTestResult, Task task); void shutdown();  }