congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ConnectorInstance.fetchResourceSchema
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: Evolveum/midpoint

private ResourceSchema fetchResourceSchema(PrismObject<ResourceType> resource, Map<String,Collection<Object>> capabilityMap, Task task, OperationResult parentResult) 
    throws CommunicationException, GenericFrameworkException, ConfigurationException, ObjectNotFoundException, SchemaException {
  ConnectorSpec connectorSpec = selectConnectorSpec(resource, capabilityMap, SchemaCapabilityType.class);
  if (connectorSpec == null) {
    LOGGER.trace("No connector has schema capability, cannot fetch resource schema");
    return null;
  }
  InternalMonitor.recordCount(InternalCounters.RESOURCE_SCHEMA_FETCH_COUNT);
  List<QName> generateObjectClasses = ResourceTypeUtil.getSchemaGenerationConstraints(resource);
  ConnectorInstance connectorInstance = connectorManager.getConfiguredConnectorInstance(connectorSpec, false, parentResult);
  LOGGER.trace("Trying to get schema from {}", connectorSpec);
  ResourceSchema resourceSchema = connectorInstance.fetchResourceSchema(generateObjectClasses, parentResult);
  if (ResourceTypeUtil.isValidateSchema(resource.asObjectable())) {
    ResourceTypeUtil.validateSchema(resourceSchema, resource);
  }
  return resourceSchema;
  
}
 
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(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

@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);
}
com.evolveum.midpoint.provisioning.ucf.apiConnectorInstancefetchResourceSchema

Javadoc

Retrieves the schema from the resource. The schema may be considered to be an XSD schema, but it is returned in a "parsed" format and it is in fact a bit stricter and richer midPoint schema. It may return null. Such case means that the schema cannot be determined.

Popular methods of ConnectorInstance

  • test
  • addObject
    TODO: This should return indication how the operation went, e.g. what changes were applied, what wer
  • configure
    The connector instance will be configured to the state that it can immediately access the resource.
  • 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
  • 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

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • runOnUiThread (Activity)
  • getResourceAsStream (ClassLoader)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • CodeWhisperer alternatives
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