Tabnine Logo
ConnectorInstance.configure
Code IndexAdd Tabnine to your IDE (free)

How to use
configure
method
in
com.evolveum.midpoint.provisioning.ucf.api.ConnectorInstance

Best Java code snippets using com.evolveum.midpoint.provisioning.ucf.api.ConnectorInstance.configure (Showing top 8 results out of 315)

origin: Evolveum/midpoint

@Test
public void test031ResourceSchemaAccountObjectClass() throws Exception {
  final String TEST_NAME = "test031ResourceSchemaAccountObjectClass";
  TestUtil.displayTestTitle(TEST_NAME);
  OperationResult result = new OperationResult(TestUcfDummy.class + "." + TEST_NAME);
  cc = connectorFactory.createConnectorInstance(connectorType, ResourceTypeUtil.getResourceNamespace(resourceType),
      "dummy",
      "description of dummy test connector instance");
  assertNotNull("Failed to instantiate connector", cc);
  PrismContainerValue<ConnectorConfigurationType> configContainer = resourceType.getConnectorConfiguration().asPrismContainerValue();
  display("Configuration container", configContainer);
  cc.configure(configContainer, result);
  List<QName> objectClassesToGenerate = new ArrayList<>();
  QName accountObjectClass = new QName(resource.asObjectable().getNamespace(), "AccountObjectClass");
  objectClassesToGenerate.add(accountObjectClass);
  // WHEN
  resourceSchema = cc.fetchResourceSchema(objectClassesToGenerate, result);
  // THEN
  display("Generated resource schema", resourceSchema);
  assertEquals("Unexpected number of definitions", 1, resourceSchema.getDefinitions().size());
  assertEquals("Unexpected number of object class definitions", 1, resourceSchema.getObjectClassDefinitions().size());
  display("RESOURCE SCHEMA DEFINITION" + resourceSchema.getDefinitions().iterator().next().getTypeName());
}
origin: Evolveum/midpoint

@Test
public void test020CreateConfiguredConnector() throws Exception {
  final String TEST_NAME = "test020CreateConfiguredConnector";
  TestUtil.displayTestTitle(TEST_NAME);
  cc = connectorFactory.createConnectorInstance(connectorType, ResourceTypeUtil.getResourceNamespace(resourceType),
      "dummy",
      "description of dummy test connector instance");
  assertNotNull("Failed to instantiate connector", cc);
  OperationResult result = new OperationResult(TestUcfDummy.class.getName() + "." + TEST_NAME);
  PrismContainerValue<ConnectorConfigurationType> configContainer = resourceType.getConnectorConfiguration().asPrismContainerValue();
  display("Configuration container", configContainer);
  // WHEN
  cc.configure(configContainer, result);
  // THEN
  result.computeStatus();
  TestUtil.assertSuccess(result);
}
origin: Evolveum/midpoint

@Test
public void test020CreateConfiguredConnector() throws Exception {
  final String TEST_NAME = "test020CreateConfiguredConnector";
  TestUtil.displayTestTitle(TEST_NAME);
  cc = connectorFactory.createConnectorInstance(connectorType, 
      ResourceTypeUtil.getResourceNamespace(resourceType),
      "dummy",
      "description of dummy test connector instance");
  assertNotNull("Failed to instantiate connector", cc);
  OperationResult result = new OperationResult(TestUcfDummyMulti.class.getName() + "." + TEST_NAME);
  PrismContainerValue<ConnectorConfigurationType> configContainer = resourceType.getConnectorConfiguration().asPrismContainerValue();
  display("Configuration container", configContainer);
  // WHEN
  cc.configure(configContainer, result);
  // THEN
  result.computeStatus();
  TestUtil.assertSuccess(result);
  resourceSchema = cc.fetchResourceSchema(null, result);
  assertNotNull("No resource schema", resourceSchema);
}
origin: Evolveum/midpoint

/**
 * Simple call to connector test() method.
 *
 * @throws Exception
 */
@Test
public void test310TestConnectionNegative() throws Exception {
  final String TEST_NAME = "test310TestConnectionNegative";
  TestUtil.displayTestTitle(this, TEST_NAME);
  // GIVEN
  OperationResult result = new OperationResult(TEST_NAME);
  ConnectorInstance badConnector = factory.createConnectorInstance(connectorType,
      ResourceTypeUtil.getResourceNamespace(badResourceType), "bad resource", "bad resource description");
  badConnector.configure(badResourceType.getConnectorConfiguration().asPrismContainerValue(), result);
  // WHEN
  badConnector.test(result);
  // THEN
  result.computeStatus("test failed");
  display("Test result (FAILURE EXPECTED)", result);
  AssertJUnit.assertNotNull(result);
  OperationResult connectorConnectionResult = result.getSubresults().get(1);
  AssertJUnit.assertNotNull(connectorConnectionResult);
  System.out.println("Test \"connector connection\" result: " + connectorConnectionResult
      + " (FAILURE EXPECTED)");
  AssertJUnit.assertTrue("Unexpected success of bad connector test",
      !connectorConnectionResult.isSuccess());
  AssertJUnit.assertTrue(!result.isSuccess());
}
origin: Evolveum/midpoint

private ConnectorInstance createConfiguredConnectorInstance(ConnectorSpec connectorSpec, OperationResult result)
    throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException {
  ConnectorInstance connector = createConnectorInstance(connectorSpec, result);
  PrismContainerValue<ConnectorConfigurationType> connectorConfigurationVal = connectorSpec.getConnectorConfiguration() != null ?
      connectorSpec.getConnectorConfiguration().getValue() : null;
  if (connectorConfigurationVal == null) {
    SchemaException e = new SchemaException("No connector configuration in "+connectorSpec);
    result.recordFatalError(e);
    throw e;
  }
  try {
    connector.configure(connectorConfigurationVal, result);
    ResourceSchema resourceSchema = RefinedResourceSchemaImpl.getResourceSchema(connectorSpec.getResource(), prismContext);
    Collection<Object> capabilities = ResourceTypeUtil.getNativeCapabilitiesCollection(connectorSpec.getResource().asObjectable());
    connector.initialize(resourceSchema, capabilities, ResourceTypeUtil.isCaseIgnoreAttributeNames(connectorSpec.getResource().asObjectable()), result);
  } catch (GenericFrameworkException e) {
    // Not expected. Transform to system exception
    result.recordFatalError("Generic provisioning framework error", e);
    throw new SystemException("Generic provisioning framework error: " + e.getMessage(), e);
  } catch (CommunicationException e) {
    result.recordFatalError(e);
    throw e;
  } catch (ConfigurationException e) {
    result.recordFatalError(e);
    throw e;
  }
  return connector;
}
origin: Evolveum/midpoint

@Test
public void test030ResourceSchema() throws Exception {
  final String TEST_NAME = "test030ResourceSchema";
  TestUtil.displayTestTitle(TEST_NAME);
  OperationResult result = new OperationResult(TestUcfDummy.class + "." + TEST_NAME);
  cc = connectorFactory.createConnectorInstance(connectorType, ResourceTypeUtil.getResourceNamespace(resourceType),
      "dummy",
      "description of dummy test connector instance");
  assertNotNull("Failed to instantiate connector", cc);
  PrismContainerValue<ConnectorConfigurationType> configContainer = resourceType.getConnectorConfiguration().asPrismContainerValue();
  display("Configuration container", configContainer);
  cc.configure(configContainer, result);
  // WHEN
  resourceSchema = cc.fetchResourceSchema(null, result);
  // THEN
  display("Generated resource schema", resourceSchema);
  assertEquals("Unexpected number of definitions", 4, resourceSchema.getDefinitions().size());
  dummyResourceCtl.assertDummyResourceSchemaSanityExtended(resourceSchema, resourceType, true);
  Document xsdSchemaDom = resourceSchema.serializeToXsd();
  assertNotNull("No serialized resource schema", xsdSchemaDom);
  display("Serialized XSD resource schema", DOMUtil.serializeDOMToString(xsdSchemaDom));
  // Try to re-parse
  ResourceSchema reparsedResourceSchema = ResourceSchemaImpl.parse(DOMUtil.getFirstChildElement(xsdSchemaDom),
      "serialized schema", PrismTestUtil.getPrismContext());
  display("Re-parsed resource schema", reparsedResourceSchema);
  assertEquals("Unexpected number of definitions in re-parsed schema", 4, reparsedResourceSchema.getDefinitions().size());
  dummyResourceCtl.assertDummyResourceSchemaSanityExtended(reparsedResourceSchema, resourceType, true);
}
origin: Evolveum/midpoint

@BeforeMethod
public void initUcf() throws Exception {
  TestUtil.displayTestTitle("initUcf");
  // Resource
  PrismObject<ResourceType> resource = PrismTestUtil.parseObject(RESOURCE_OPENDJ_FILE);
  resourceType = resource.asObjectable();
  // Resource: Second copy for negative test cases
  PrismObject<ResourceType> badResource = PrismTestUtil.parseObject(RESOURCE_OPENDJ_BAD_FILE);
  badResourceType = badResource.asObjectable();
  // Connector
  PrismObject<ConnectorType> connector = PrismTestUtil.parseObject(CONNECTOR_LDAP_FILE);
  connectorType = connector.asObjectable();
  factory = connectorFactoryIcfImpl;
  connectorSchema = factory.generateConnectorConfigurationSchema(connectorType);
  AssertJUnit.assertNotNull("Cannot generate connector schema", connectorSchema);
  display("Connector schema", connectorSchema);
  cc = factory.createConnectorInstance(connectorType, ResourceTypeUtil.getResourceNamespace(resourceType), 
      "OpenDJ resource",
      "description of OpenDJ connector instance");
  OperationResult result = new OperationResult("initUcf");
  cc.configure(resourceType.getConnectorConfiguration().asPrismContainerValue(), result);
  cc.initialize(null, null, false, result);
  // TODO: assert something
  resourceSchema = cc.fetchResourceSchema(null, result);
  display("Resource schema", resourceSchema);
  AssertJUnit.assertNotNull(resourceSchema);
}
origin: Evolveum/midpoint

PrismContainerValue<ConnectorConfigurationType> connectorConfiguration = connectorSpec.getConnectorConfiguration().getValue();
connector.configure(connectorConfiguration, configResult);
com.evolveum.midpoint.provisioning.ucf.apiConnectorInstanceconfigure

Javadoc

The connector instance will be configured to the state that it can immediately access the resource. The resource configuration is provided as a parameter to this method.

Popular methods of ConnectorInstance

  • test
  • addObject
    TODO: This should return indication how the operation went, e.g. what changes were applied, what wer
  • deleteObject
  • fetchCapabilities
    Retrieves native connector capabilities. The capabilities specify what the connector can do without
  • fetchChanges
    Token may be null. That means "from the beginning of history".
  • fetchCurrentToken
    Returns the latest token. In other words, returns a token that corresponds to a current state of the
  • fetchObject
    Retrieves a specific object from the resource. This method is fetching an object from the resource t
  • fetchResourceSchema
    Retrieves the schema from the resource. The schema may be considered to be an XSD schema, but it is
  • getOperationalStatus
  • initialize
    Get necessary information from the remote system. This method will initialize the configured connect
  • modifyObject
    TODO: This should return indication how the operation went, e.g. what changes were applied, what wer
  • search
    Execute iterative search operation. This method will execute search operation on the resource and wi
  • modifyObject,
  • search,
  • count,
  • dispose,
  • executeScript

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JFrame (javax.swing)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now