@Override public void run() { try { cc.search(accountDefinition, null, handler1, null, null, null, null, result1); } catch (CommunicationException | GenericFrameworkException | SchemaException | SecurityViolationException | ObjectNotFoundException e) { LOGGER.error("Error in the search: {}", e.getMessage(), e); } } });
@Override public void run() { try { cc.search(accountDefinition, null, handler, null, null, null, null, result); } catch (CommunicationException | GenericFrameworkException | SchemaException | SecurityViolationException | ObjectNotFoundException e) { LOGGER.error("Error in the search: {}", e.getMessage(), e); } } });
@Override public void run() { try { cc.search(accountDefinition, null, handler2, null, null, null, null, result2); } catch (CommunicationException | GenericFrameworkException | SchemaException | SecurityViolationException | ObjectNotFoundException e) { LOGGER.error("Error in the search: {}", e.getMessage(), e); } } });
@Test public void test510Search() throws Exception { final String TEST_NAME = "test510Search"; TestUtil.displayTestTitle(this, TEST_NAME); // GIVEN ObjectClassComplexTypeDefinition accountDefinition = resourceSchema.findObjectClassDefinition(OpenDJController.OBJECT_CLASS_INETORGPERSON_NAME); // Determine object class from the schema ShadowResultHandler handler = new ShadowResultHandler() { @Override public boolean handle(PrismObject<ShadowType> object) { System.out.println("Search: found: " + object); return true; } }; OperationResult result = new OperationResult(this.getClass().getName() + "." + TEST_NAME); // WHEN cc.search(accountDefinition, null, handler, null, null, null, null, result); // THEN }
@Test public void test050Search() throws Exception { final String TEST_NAME = "test050Search"; TestUtil.displayTestTitle(TEST_NAME); // GIVEN final ObjectClassComplexTypeDefinition accountDefinition = resourceSchema.findDefaultObjectClassDefinition(ShadowKindType.ACCOUNT); // Determine object class from the schema final List<PrismObject<ShadowType>> searchResults = new ArrayList<>(); ShadowResultHandler handler = new ShadowResultHandler() { @Override public boolean handle(PrismObject<ShadowType> shadow) { display("Search: found", shadow); checkUcfShadow(shadow, accountDefinition); searchResults.add(shadow); return true; } }; OperationResult result = new OperationResult(this.getClass().getName() + "." + TEST_NAME); // WHEN cc.search(accountDefinition, null, handler, null, null, null, null, result); // THEN assertEquals("Unexpected number of search results", 1, searchResults.size()); }
@Test public void test110SearchNonBlocking() throws Exception { final String TEST_NAME = "test100SearchNonBlocking"; TestUtil.displayTestTitle(TEST_NAME); // GIVEN final ObjectClassComplexTypeDefinition accountDefinition = resourceSchema.findDefaultObjectClassDefinition(ShadowKindType.ACCOUNT); // Determine object class from the schema final List<PrismObject<ShadowType>> searchResults = new ArrayList<>(); ShadowResultHandler handler = new ShadowResultHandler() { @Override public boolean handle(PrismObject<ShadowType> shadow) { System.out.println("Search: found: " + shadow); checkUcfShadow(shadow, accountDefinition); searchResults.add(shadow); return true; } }; OperationResult result = new OperationResult(this.getClass().getName() + "." + TEST_NAME); // WHEN cc.search(accountDefinition, null, handler, null, null, null, null, result); // THEN assertEquals("Unexpected number of search results", 1, searchResults.size()); ConnectorOperationalStatus opStat = cc.getOperationalStatus(); display("stats", opStat); assertEquals("Wrong pool active", (Integer)0, opStat.getPoolStatusNumActive()); assertEquals("Wrong pool active", (Integer)1, opStat.getPoolStatusNumIdle()); }
connector.search(ctx.getObjectClassDefinition(), query, handler, attributesToReturn, null, null, ctx, parentResult); if (shadowHolder.isEmpty()) { throw new ObjectNotFoundException("No object found for secondary identifier "+secondaryIdentifier);
connector.search(entitlementDef, query, handler, attributesToReturn, null, searchHierarchyConstraints, subjectCtx, parentResult); } catch (GenericFrameworkException e) { throw new GenericConnectorException("Generic error in the connector " + connector + ". Reason: "
try { metadata = connector.search(objectClassDef, query, (shadow) -> {
LOGGER.trace("Searching for associations in deleted shadow, query: {}", query); ConnectorInstance connector = subjectCtx.getConnector(ReadCapabilityType.class, parentResult); connector.search(entitlementOcDef, query, handler, attributesToReturn, null, searchHierarchyConstraints, subjectCtx, parentResult); } catch (TunnelException e) { throw (SchemaException)e.getCause();