@AfterClass
 public static void stopLdap() throws Exception {
   openDJController.stop();
   LOGGER.info("------------------------------------------------------------------------------");
   LOGGER.info("STOP:  OpenDjUcfTest");
   LOGGER.info("------------------------------------------------------------------------------");
 }
 @BeforeClass
 public static void startLdap() throws Exception {
   LOGGER.info("------------------------------------------------------------------------------");
   LOGGER.info("START:  OpenDjUcfTest");
   LOGGER.info("------------------------------------------------------------------------------");
   openDJController.startCleanServer();
 }
  @Override
  public TaskRunResult run(Task task) {

    OperationResult result =
        task.getResult().createSubresult(WaitForTasksTaskHandler.class.getName() + ".run");
    result.recordInProgress();

    LOGGER.info("WaitForTasksTaskHandler run starting; in task " + task.getName());
    try {
      // todo resolve this brutal hack
      taskManagerImpl.pauseTask(task, TaskWaitingReason.OTHER, result);
      task.startWaitingForTasksImmediate(result);
    } catch (SchemaException e) {
      throw new SystemException(
          "Couldn't mark task as waiting for prerequisite tasks",
          e); // should not occur; will be handled by task runner
    } catch (ObjectNotFoundException e) {
      throw new SystemException(
          "Couldn't mark task as waiting for prerequisite tasks",
          e); // should not occur; will be handled by task runner
    }
    LOGGER.info("WaitForTasksTaskHandler run finishing; in task " + task.getName());

    result.computeStatus();

    TaskRunResult runResult = new TaskRunResult();
    runResult.setOperationResult(result);
    runResult.setProgress(task.getProgress()); // not to overwrite task's progress
    runResult.setRunResultStatus(TaskRunResultStatus.FINISHED);
    return runResult;
  }
 // region Initialization and Configuration
 @PostConstruct
 public void init() {
   processorConfigurationType = gcpConfigurationHelper.configure(this);
   if (isEnabled()) {
     // print startup message
     int scenarios = processorConfigurationType.getScenario().size();
     if (scenarios > 0) {
       LOGGER.info(
           getBeanName() + " initialized correctly (number of scenarios: " + scenarios + ")");
     } else {
       LOGGER.warn(
           getBeanName()
               + " initialized correctly, but there are no scenarios - so it will never be invoked");
     }
   }
 }
  private SecurityQuestionAnswerDTO checkIfQuestionisValid(
      SecurityQuestionAnswerDTO questionIdentifier,
      List<SecurityQuestionDefinitionType> securityQuestionList) {

    for (Iterator iterator = securityQuestionList.iterator(); iterator.hasNext(); ) {
      SecurityQuestionDefinitionType securityQuestionDefinitionType =
          (SecurityQuestionDefinitionType) iterator.next();
      LOGGER.debug("List For" + securityQuestionDefinitionType.getIdentifier().trim());
      if (securityQuestionDefinitionType
          .getIdentifier()
          .trim()
          .equalsIgnoreCase((questionIdentifier.getPwdQuestion().trim()))) {
        questionIdentifier.setQuestionItself(securityQuestionDefinitionType.getQuestionText());

        LOGGER.info(": TRUE QUESTION");
        return questionIdentifier;
      } else {
        return null;
      }
    }

    return null;
  }
Beispiel #6
0
  private List<ContainerWrapper> createContainerWrapper(
      PrismContainer parent, ItemPath path, PageBase pageBase) {

    PrismContainerDefinition definition = parent.getDefinition();
    List<ContainerWrapper> wrappers = new ArrayList<ContainerWrapper>();

    List<ItemPathSegment> segments = new ArrayList<ItemPathSegment>();
    if (path != null) {
      segments.addAll(path.getSegments());
    }
    ItemPath parentPath = new ItemPath(segments);
    for (ItemDefinition def : (Collection<ItemDefinition>) definition.getDefinitions()) {
      if (!(def instanceof PrismContainerDefinition)) {
        continue;
      }
      if (ObjectSpecificationType.COMPLEX_TYPE.equals(def.getTypeName())) {
        continue; // TEMPORARY FIX
      }
      if (TriggerType.COMPLEX_TYPE.equals(def.getTypeName())) {
        continue; // TEMPORARY FIX TODO: remove after getEditSchema
        // (authorization) will be fixed.
      }
      if (ApprovalSchemaType.COMPLEX_TYPE.equals(def.getTypeName())) {
        continue;
      }

      LOGGER.trace("ObjectWrapper.createContainerWrapper processing definition: {}", def);

      PrismContainerDefinition containerDef = (PrismContainerDefinition) def;
      if (!showAssignments && AssignmentType.COMPLEX_TYPE.equals(containerDef.getTypeName())) {
        continue;
      }
      if (!showInheritedObjectAttributes) {
        boolean result = INHERITED_OBJECT_SUBCONTAINERS.contains(containerDef.getName());
        LOGGER.info("checking " + containerDef.getName() + ", result = " + result);
        if (result) {
          continue;
        }
      }

      ItemPath newPath = createPropertyPath(parentPath, containerDef.getName());

      // [med]
      // The following code fails to work when parent is multivalued or
      // potentially multivalued.
      // Therefore (as a brutal hack), for multivalued parents we simply
      // skip it.
      if (parent.size() <= 1) {

        // the same check as in getValue() implementation
        boolean isMultiValued =
            parent.getDefinition() != null
                && !parent.getDefinition().isDynamic()
                && !parent.getDefinition().isSingleValue();
        if (!isMultiValued) {
          PrismContainer prismContainer = parent.findContainer(def.getName());

          ContainerWrapper container;
          if (prismContainer != null) {
            container =
                new ContainerWrapper(
                    this, prismContainer, ContainerStatus.MODIFYING, newPath, pageBase);
          } else {
            prismContainer = containerDef.instantiate();
            container =
                new ContainerWrapper(
                    this, prismContainer, ContainerStatus.ADDING, newPath, pageBase);
          }
          addSubresult(container.getResult());
          wrappers.add(container);

          if (!AssignmentType.COMPLEX_TYPE.equals(containerDef.getTypeName())
              || !ShadowType.F_ASSOCIATION.equals(parent.getElementName())) { // do
            // not
            // show
            // internals
            // of
            // Assignments
            // (e.g.
            // activation)
            wrappers.addAll(createContainerWrapper(prismContainer, newPath, pageBase));
          }
        }
      }
    }

    return wrappers;
  }