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

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

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

origin: Evolveum/midpoint

@Test
public void test500FetchObject() throws Exception {
  final String TEST_NAME = "test500FetchObject";
  TestUtil.displayTestTitle(this, TEST_NAME);
  // GIVEN
  ResourceAttributeContainer resourceObject = createResourceObject(
      "uid=Teell,ou=People,dc=example,dc=com", "Teell William", "Teell");
  OperationResult addResult = new OperationResult(this.getClass().getName() + "." + TEST_NAME);
  PrismObject<ShadowType> shadow = wrapInShadow(ShadowType.class, resourceObject);
  // Add a testing object
  cc.addObject(shadow, null, null, addResult);
  ObjectClassComplexTypeDefinition accountDefinition = resourceObject.getDefinition().getComplexTypeDefinition();
  Collection<ResourceAttribute<?>> identifiers = resourceObject.getPrimaryIdentifiers();
  // Determine object class from the schema
  ResourceObjectIdentification identification = new ResourceObjectIdentification(accountDefinition, identifiers, null);
  OperationResult result = new OperationResult(this.getClass().getName() + "." + TEST_NAME);
  // WHEN
  PrismObject<ShadowType> ro = cc.fetchObject(identification, null, null, result);
  // THEN
  AssertJUnit.assertNotNull(ro);
  System.out.println("Fetched object " + ro);
  System.out.println("Result:");
  System.out.println(result.debugDump());
}
origin: Evolveum/midpoint

cc.addObject(shadow, additionalOperations, null, addResult);
origin: Evolveum/midpoint

AsynchronousOperationReturnValue<Collection<ResourceAttribute<?>>> ret = cc.addObject(shadow, operation, null, result);
Collection<ResourceAttribute<?>> resourceAttributes = ret.getReturnValue();
return resourceAttributes;
origin: Evolveum/midpoint

cc.addObject(shadow, null, null, addResult);
origin: Evolveum/midpoint

@Test
public void test040AddAccount() throws Exception {
  final String TEST_NAME = "test040AddAccount";
  TestUtil.displayTestTitle(this, TEST_NAME);
  OperationResult result = new OperationResult(this.getClass().getName() + "." + TEST_NAME);
  ObjectClassComplexTypeDefinition defaultAccountDefinition = resourceSchema.findDefaultObjectClassDefinition(ShadowKindType.ACCOUNT);
  ShadowType shadowType = new ShadowType();
  PrismTestUtil.getPrismContext().adopt(shadowType);
  shadowType.setName(PrismTestUtil.createPolyStringType(ACCOUNT_JACK_USERNAME));
  ObjectReferenceType resourceRef = new ObjectReferenceType();
  resourceRef.setOid(resource.getOid());
  shadowType.setResourceRef(resourceRef);
  shadowType.setObjectClass(defaultAccountDefinition.getTypeName());
  PrismObject<ShadowType> shadow = shadowType.asPrismObject();
  ResourceAttributeContainer attributesContainer = ShadowUtil.getOrCreateAttributesContainer(shadow, defaultAccountDefinition);
  ResourceAttribute<String> icfsNameProp = attributesContainer.findOrCreateAttribute(SchemaConstants.ICFS_NAME);
  icfsNameProp.setRealValue(ACCOUNT_JACK_USERNAME);
  // WHEN
  cc.addObject(shadow, null, null, result);
  // THEN
  DummyAccount dummyAccount = dummyResource.getAccountByUsername(ACCOUNT_JACK_USERNAME);
  assertNotNull("Account "+ACCOUNT_JACK_USERNAME+" was not created", dummyAccount);
  assertNotNull("Account "+ACCOUNT_JACK_USERNAME+" has no username", dummyAccount.getName());
}
origin: Evolveum/midpoint

@Test
public void test100AddAccount() throws Exception {
  final String TEST_NAME = "test100AddAccount";
  TestUtil.displayTestTitle(this, TEST_NAME);
  OperationResult result = new OperationResult(this.getClass().getName() + "." + TEST_NAME);
  ObjectClassComplexTypeDefinition defaultAccountDefinition = resourceSchema.findDefaultObjectClassDefinition(ShadowKindType.ACCOUNT);
  ShadowType shadowType = new ShadowType();
  PrismTestUtil.getPrismContext().adopt(shadowType);
  shadowType.setName(PrismTestUtil.createPolyStringType(ACCOUNT_JACK_USERNAME));
  ObjectReferenceType resourceRef = new ObjectReferenceType();
  resourceRef.setOid(resource.getOid());
  shadowType.setResourceRef(resourceRef);
  shadowType.setObjectClass(defaultAccountDefinition.getTypeName());
  PrismObject<ShadowType> shadow = shadowType.asPrismObject();
  ResourceAttributeContainer attributesContainer = ShadowUtil.getOrCreateAttributesContainer(shadow, defaultAccountDefinition);
  ResourceAttribute<String> icfsNameProp = attributesContainer.findOrCreateAttribute(SchemaConstants.ICFS_NAME);
  icfsNameProp.setRealValue(ACCOUNT_JACK_USERNAME);
  // WHEN
  cc.addObject(shadow, null, null, result);
  // THEN
  DummyAccount dummyAccount = dummyResource.getAccountByUsername(ACCOUNT_JACK_USERNAME);
  assertNotNull("Account "+ACCOUNT_JACK_USERNAME+" was not created", dummyAccount);
  assertNotNull("Account "+ACCOUNT_JACK_USERNAME+" has no username", dummyAccount.getName());
}
origin: Evolveum/midpoint

connectorAsyncOpRet = connector.addObject(shadowClone, additionalOperations, ctx, result);
resourceAttributesAfterAdd = connectorAsyncOpRet.getReturnValue();
com.evolveum.midpoint.provisioning.ucf.apiConnectorInstanceaddObject

Javadoc

TODO: This should return indication how the operation went, e.g. what changes were applied, what were not and what were not determined. The exception should be thrown only if the connector is sure that nothing was done on the resource. E.g. in case of connect timeout or connection refused. Timeout during operation should not cause the exception as something might have been done already. The connector may return some (or all) of the attributes of created object. The connector should do this only such operation is efficient, e.g. in case that the created object is normal return value from the create operation. The connector must not execute additional operation to fetch the state of created resource. In case that the new state is not such a normal result, the connector must return null. Returning empty set means that the connector supports returning of new state, but nothing was returned (e.g. due to a limiting configuration). Returning null means that connector does not support returning of new object state and the caller should explicitly invoke fetchObject() in case that the information is needed.

Popular methods of ConnectorInstance

  • test
  • 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
  • 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

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Collectors (java.util.stream)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top plugins for WebStorm
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