com.evolveum.midpoint.repo.api.RepositoryService类的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.6k)|赞(0)|评价(0)|浏览(73)

本文整理了Java中com.evolveum.midpoint.repo.api.RepositoryService类的一些代码示例,展示了RepositoryService类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RepositoryService类的具体详情如下:
包路径:com.evolveum.midpoint.repo.api.RepositoryService
类名称:RepositoryService

RepositoryService介绍

暂无

代码示例

代码示例来源:origin: Evolveum/midpoint

@Override
public <O extends ObjectType> PrismObject<O> getObject(Class<O> expectedType, String oid,
    Collection<SelectorOptions<GetOperationOptions>> options, OperationResult parentResult)
    throws ObjectNotFoundException, SchemaException {
  return cacheRepositoryService.getObject(expectedType, oid, options, parentResult);
}

代码示例来源:origin: Evolveum/midpoint

@NotNull
  protected SearchResultList<PrismObject<AccessCertificationCampaignType>> getAllCampaigns(OperationResult result) throws SchemaException {
    return repositoryService.searchObjects(AccessCertificationCampaignType.class, null, null, result);
  }
}

代码示例来源:origin: Evolveum/midpoint

protected void assertShadows(int expected, OperationResult result) throws SchemaException {
  int actual = repositoryService.countObjects(ShadowType.class, null, null, result);
  if (expected != actual) {
    if (actual > 20) {
      AssertJUnit.fail("Unexpected number of (repository) shadows. Expected " + expected + " but was " + actual + " (too many to display)");
    }
    ResultHandler<ShadowType> handler = (object, parentResult) -> {
      display("found shadow", object);
      return true;
    };
    repositoryService.searchObjectsIterative(ShadowType.class, null, handler, null, true, result);
    AssertJUnit.fail("Unexpected number of (repository) shadows. Expected " + expected + " but was " + actual);
  }
}

代码示例来源:origin: Evolveum/midpoint

private void markWorkComplete(Task task, OperationResult result)
    throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException {
  List<ItemDelta<?, ?>> itemDeltas = prismContext.deltaFor(TaskType.class)
      .item(TaskType.F_WORK_STATE, TaskWorkStateType.F_ALL_WORK_COMPLETE).replace(true)
      .asItemDeltas();
  repositoryService.modifyObject(TaskType.class, task.getOid(), itemDeltas, result);
}

代码示例来源:origin: Evolveum/midpoint

protected void removeAllAssignments(String oid, OperationResult result) throws Exception {
  PrismObject<UserType> user = repositoryService.getObject(UserType.class, oid, null, result);
  for (AssignmentType at : user.asObjectable().getAssignment()) {
    ObjectDelta delta = prismContext.deltaFactory().object()
        .createModificationDeleteContainer(UserType.class, oid, UserType.F_ASSIGNMENT,
            at.asPrismContainerValue().clone());
    repositoryService.modifyObject(UserType.class, oid, delta.getModifications(), result);
    LOGGER.info("Removed assignment " + at + " from " + user);
  }
}

代码示例来源:origin: Evolveum/midpoint

@Test(expectedExceptions = ObjectAlreadyExistsException.class)
public void test105AddTableNonOverwriteExisting() throws Exception {
  PrismObject<LookupTableType> table = prismContext.parseObject(new File(TEST_DIR, "table-0.xml"));
  OperationResult result = new OperationResult("test105AddTableNonOverwriteExisting");
  repositoryService.addObject(table, null, result);
}

代码示例来源:origin: Evolveum/midpoint

@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
  super.initSystem(initTask, initResult);
  initDummyResourcePirate(DUMMY_FOR_CHECKER, RESOURCE_DUMMY_FOR_CHECKER_FILE, RESOURCE_DUMMY_FOR_CHECKER_OID, initTask, initResult);
  List<PrismObject<ShadowType>> shadows = repositoryService
      .searchObjects(ShadowType.class, null, null, initResult);
  for (PrismObject<ShadowType> shadow : shadows) {
    repositoryService.deleteObject(ShadowType.class, shadow.getOid(), initResult);
  }
  repoAddObjectFromFile(SHADOW_1_FILE, initResult);
  repoAddObjectFromFile(SHADOW_2_FILE, initResult);
  repoAddObjectFromFile(SHADOW_2_DUPLICATE_FILE, initResult);
}

代码示例来源:origin: Evolveum/midpoint

@Test
public void delete0002() throws Exception {
  PrismObject<SystemConfigurationType> configuration = prismContext.parseObject(new File(FOLDER_BASIC, "systemConfiguration.xml"));
  OperationResult result = new OperationResult("add system configuration");
  final String oid = repositoryService.addObject(configuration, null, result);
  repositoryService.deleteObject(SystemConfigurationType.class, oid, result);
  result.recomputeStatus();
  AssertJUnit.assertTrue(result.isSuccess());
}

代码示例来源:origin: Evolveum/midpoint

public void deleteResource(String oid, ProvisioningOperationOptions options, Task task, OperationResult parentResult) throws ObjectNotFoundException {
  resourceCache.remove(oid);
  repositoryService.deleteObject(ResourceType.class, oid, parentResult);
}

代码示例来源:origin: Evolveum/midpoint

@Override
public <O extends ObjectType> void searchIterative(Class<O> type, ObjectQuery query,
    Collection<SelectorOptions<GetOperationOptions>> options, ResultHandler<O> handler, Task task,
    OperationResult parentResult)
    throws SchemaException {
  cacheRepositoryService.searchObjectsIterative(type, query, handler, options, true, parentResult);
}

代码示例来源:origin: Evolveum/midpoint

/**
 * Used to count objects using model or any similar higher-level interface. Defaults to repository count.
 */
protected <O extends ObjectType> Integer countObjects(Class<O> type, ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> queryOptions, Task coordinatorTask, OperationResult opResult) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException {
  return repositoryService.countObjects(type, query, queryOptions, opResult);
}

代码示例来源:origin: Evolveum/midpoint

private void deleteWorkState(Task task, OperationResult opResult) throws SchemaException, ObjectNotFoundException, ObjectAlreadyExistsException {
  List<ItemDelta<?, ?>> itemDeltas = prismContext.deltaFor(TaskType.class)
      .item(TaskType.F_WORK_STATE).replace()
      .asItemDeltas();
  repositoryService.modifyObject(TaskType.class, task.getOid(), itemDeltas, opResult);
}

代码示例来源:origin: Evolveum/midpoint

protected void removeAllAssignments(String oid, OperationResult result) throws Exception {
  PrismObject<UserType> user = repositoryService.getObject(UserType.class, oid, null, result);
  for (AssignmentType at : user.asObjectable().getAssignment()) {
    ObjectDelta delta = prismContext.deltaFactory().object()
        .createModificationDeleteContainer(UserType.class, oid, UserType.F_ASSIGNMENT,
            at.asPrismContainerValue().clone());
    repositoryService.modifyObject(UserType.class, oid, delta.getModifications(), result);
    display("Removed assignment " + at + " from " + user);
  }
}

代码示例来源:origin: Evolveum/midpoint

@Test
public void test010Add() throws Exception {
  PrismObject<UserType> user = PrismTestUtil.parseObject(new File(FOLDER_BASIC, "user.xml"));
  userOid = repositoryService.addObject(user, null, new OperationResult("asdf"));
  user = PrismTestUtil.parseObject(new File(FOLDER_BASIC, "user-big.xml"));
  userBigOid = repositoryService.addObject(user, null, new OperationResult("asdf"));
  PrismObject<ShadowType> shadow = PrismTestUtil.parseObject(new File(FOLDER_BASIC, "account-shadow.xml"));
  shadowOid = repositoryService.addObject(shadow, null, new OperationResult("asdf"));
}

代码示例来源:origin: Evolveum/midpoint

/**
 * Checks that after removing a user the photo is removed as well.
 */
@Test
public void test099DeleteUser() throws Exception {
  OperationResult result = new OperationResult(UserPhotoTest.class.getName() + ".test099DeleteUser");
  repositoryService.deleteObject(UserType.class, userOid, result);
  PrismObject<UserType> user = PrismTestUtil.parseObject(USER_FILE);
  user.asObjectable().setJpegPhoto(null);
  String oid = repositoryService.addObject(user, null, result);
  assertEquals("Oid was changed", userOid, oid);
  checkObject(userOid, user, true, result);       // there should be no photo there
}

代码示例来源:origin: Evolveum/midpoint

public void deleteShadow(ProvisioningContext ctx, PrismObject<ShadowType> oldRepoShadow, OperationResult parentResult) 
    throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, ExpressionEvaluationException {
  LOGGER.trace("Deleting repository {}", oldRepoShadow);
  repositoryService.deleteObject(ShadowType.class, oldRepoShadow.getOid(), parentResult);
}

代码示例来源:origin: Evolveum/midpoint

public <O extends ObjectType> void searchIterative(Class<O> type, ObjectQuery query,
    Collection<SelectorOptions<GetOperationOptions>> options, ResultHandler<O> handler, Object task,
    OperationResult parentResult)
    throws SchemaException {
  cacheRepositoryService.searchObjectsIterative(type, query, handler, options, true, parentResult);
}

代码示例来源:origin: Evolveum/midpoint

public <O extends ObjectType> Integer countObjects(Class<O> type, ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException {
  if (ObjectTypes.isClassManagedByProvisioning(type)) {
    return provisioning.countObjects(type, query, options, task, parentResult);
  } else {
    return cacheRepositoryService.countObjects(type, query, options, parentResult);
  }
}

代码示例来源:origin: Evolveum/midpoint

@Override
void assertsRootTaskFinishes(Task task, List<Task> subtasks, OperationResult result) throws Exception {
  PrismObject<UserType> jack = repositoryService.getObject(UserType.class, USER_JACK_OID, null, result);
  assertAssignedRole(jack, ROLE_R10_OID);
  checkDummyTransportMessages("simpleUserNotifier", 1);
}

代码示例来源:origin: Evolveum/midpoint

public List<PrismObject<NodeType>> getAllNodes(OperationResult result) {
  try {
    return getRepositoryService().searchObjects(NodeType.class, null, null, result);
  } catch (SchemaException e) {       // should not occur
    throw new SystemException("Cannot get the list of nodes from the repository", e);
  }
}

相关文章

微信公众号

最新文章

更多