public Qualification(UserId userId, TldServiceFacade tld) {
   super(
       OperationConfiguration.create()
           .setType(OperationType.Qualification)
           .setCreateUserId(userId),
       userId,
       tld);
 }
  public void updateReachability(ReachStatus newValue, String comment) throws ServiceException {

    OperationConfiguration conf = OperationConfiguration.create();
    conf = conf.setParentId(this.getId());
    conf = conf.setComment(comment);
    conf = conf.setCreateUserId(this.userIdCaller);

    OperationId id =
        this.createAndAddSimpleOperation(
            new QualificationAddReachability(
                conf, this.getReachStatus(), newValue, this.userIdCaller, this.tldCaller));

    QualificationAddReachability operation =
        AppServiceFacade.getOperationService()
            .getOperation(
                id, QualificationAddReachability.class, this.userIdCaller, this.tldCaller);
    operation.execute();
  }
  public void updateTopLevelStatut(TopLevelOperationStatus newValue, String comment)
      throws ServiceException {

    OperationConfiguration conf = OperationConfiguration.create();
    conf = conf.setParentId(this.getId());
    conf = conf.setComment(comment);
    conf = conf.setCreateUserId(this.userIdCaller);

    OperationId id =
        this.createAndAddSimpleOperation(
            new TopLevelOperationStatusUpdate(
                conf, this.getTopLevelStatus(), newValue, this.userIdCaller, this.tldCaller));

    TopLevelOperationStatusUpdate operation =
        AppServiceFacade.getOperationService()
            .getOperation(
                id, TopLevelOperationStatusUpdate.class, this.userIdCaller, this.tldCaller);
    operation.execute();
  }
  @Override
  public QualificationFinishJustification create(
      Qualification qualification,
      Map<OperationType, String> comment,
      Map<OperationType, Email> mapEmail,
      UserId userId,
      TldServiceFacade tld)
      throws ServiceException {

    QualificationFinishJustification operation =
        AppServiceFacade.getOperationService()
            .createAndGet(
                new QualificationFinishJustification(qualification, userId, tld), userId, tld);

    OperationConfiguration conf =
        OperationConfiguration.create()
            .setParentId(operation.getId())
            .setBlocking(true)
            .setCreateUserId(userId);

    OperationId previousId = operation.getId();
    if ((qualification.getPortfolioStatus() == PortfolioStatus.Blocked)
        || (qualification.getPortfolioStatus() == PortfolioStatus.PendingSuppress)) {
      previousId =
          operation.createAndAddSimpleOperation(
              new UnblockHolderDomainPortfolio(
                  conf.setPreviousOperationId(previousId), userId, tld));
    } else {
      previousId =
          operation.createAndAddSimpleOperation(
              new UnfreezeHolderDomainPortfolio(
                  conf.setPreviousOperationId(previousId), userId, tld));
    }
    previousId =
        operation.createAndAddSimpleOperation(
            new PortfolioStatusUpdate(
                conf.setPreviousOperationId(previousId),
                qualification.getPortfolioStatus(),
                PortfolioStatus.Active,
                userId,
                tld));

    previousId =
        operation.createAndAddSimpleOperation(
            new UpdateContactWhoisQualification(
                conf.setPreviousOperationId(previousId), userId, tld));

    previousId =
        operation.createAndAddSimpleOperation(
            new SendEmail(
                conf.setPreviousOperationId(previousId),
                comment.get(OperationType.NotifyEmailFinishedToRegistrar),
                mapEmail.get(OperationType.NotifyEmailFinishedToRegistrar),
                userId,
                tld));
    previousId =
        operation.createAndAddSimpleOperation(
            new SendEmail(
                conf.setPreviousOperationId(previousId),
                comment.get(OperationType.NotifyEmailFinishedToHolder),
                mapEmail.get(OperationType.NotifyEmailFinishedToHolder),
                userId,
                tld));

    if (qualification.isExternalSource()) {
      previousId =
          operation.createAndAddSimpleOperation(
              new SendEmail(
                  conf.setPreviousOperationId(previousId),
                  comment.get(OperationType.NotifyEmailFinishedToInitiator),
                  mapEmail.get(OperationType.NotifyEmailFinishedToInitiator),
                  userId,
                  tld));
    }

    previousId =
        operation.createAndAddSimpleOperation(
            new NotifyEppQualificationFinished(conf, userId, tld));
    previousId =
        operation.createAndAddSimpleOperation(
            new TopLevelOperationStatusUpdate(
                conf.setPreviousOperationId(previousId),
                qualification.getTopLevelStatus(),
                TopLevelOperationStatus.Finished,
                userId,
                tld));

    return operation;
  }
 public QualificationUpdateReminderAutoMail(UserId userId, TldServiceFacade tld) {
   this(OperationConfiguration.create(), userId, tld);
 }