public class QualificationUpdateReminderAutoMail extends SimpleQualificationOperation {

  private static final ILogger LOGGER =
      AppServiceFacade.getLoggerService().getLogger(QualificationUpdateReminderAutoMail.class);

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

  public QualificationUpdateReminderAutoMail(
      OperationConfiguration conf, UserId userId, TldServiceFacade tld) {
    super(conf.setType(OperationType.UpdateReminderAutoMail), userId, tld);
  }

  @Override
  protected OperationStatus executeSimpleImpl() throws Exception {
    LOGGER.debug("QualificationUpdateReminderAutoMail");
    Qualification qualification = this.getQualification();
    AppServiceFacade.getQualificationService()
        .createQualificationCheckAutoReachability(
            qualification, true, this.userIdCaller, this.tldCaller);

    return OperationStatus.Succed;
  }
}
Example #2
0
 public ContactSnapshot getHolderSnapshot() throws ServiceException {
   if (this.holderSnapshotId != null && !"0".equals(this.holderSnapshotId)) {
     return AppServiceFacade.getWhoisContactService()
         .getSnapshot(this.holderSnapshotId, this.userIdCaller, this.tldCaller);
   } else {
     return null;
   }
 }
Example #3
0
 public Customer getCustomer() throws ServiceException {
   try {
     return this.customerId.getObjectOwner(this.userIdCaller, this.tldCaller);
   } catch (InvalidDataException e) {
     return AppServiceFacade.getWhoisContactService()
         .getContactWithHandle(this.holderNicHandle, this.userIdCaller, this.tldCaller)
         .getCustomer();
   }
 }
  @Override
  protected OperationStatus executeSimpleImpl() throws Exception {
    LOGGER.debug("QualificationUpdateReminderAutoMail");
    Qualification qualification = this.getQualification();
    AppServiceFacade.getQualificationService()
        .createQualificationCheckAutoReachability(
            qualification, true, this.userIdCaller, this.tldCaller);

    return OperationStatus.Succed;
  }
  protected String listDomain() throws ServiceException {
    StringBuilder stringBuilder = new StringBuilder();
    List<String> domains =
        AppServiceFacade.getDomainService()
            .getDomainNamesWithHolderHandle(
                this.getHolderNicHandle(), this.userIdCaller, this.tldCaller);

    for (String domain : domains) {
      stringBuilder.append("DOMAIN=" + domain + this.separator);
    }

    return stringBuilder.toString();
  }
Example #6
0
  /** Crée et execute une opération pour la qualification */
  public Qualification execute(
      QualificationOperationType qualificationOperationType,
      Map<OperationType, String> comment,
      Map<OperationType, Email> email)
      throws ServiceException {
    Operation operation =
        qualificationOperationType.createOperation(
            this, comment, email, this.userIdCaller, this.tldCaller);

    operation.execute();
    return AppServiceFacade.getQualificationService()
        .getQualification(this.getId(), this.userIdCaller, this.tldCaller);
  }
Example #7
0
  private void populateElements() throws ServiceException {
    this.elements = new ArrayList<Element>();

    String mainLegalHandle =
        AppServiceFacade.getDocumentService()
            .getTree(this.userIdCaller, this.tldCaller)
            .getMainLegal()
            .getHandle();
    this.elements.add(
        AppServiceFacade.getDocumentService()
            .getElementWithHandle(
                mainLegalHandle, Folder.class, this.userIdCaller, this.tldCaller));

    String mainOperationHandle =
        AppServiceFacade.getDocumentService()
            .getTree(this.userIdCaller, this.tldCaller)
            .getMainOperation()
            .getHandle();
    this.elements.add(
        AppServiceFacade.getDocumentService()
            .getElementWithHandle(
                mainOperationHandle, Folder.class, this.userIdCaller, this.tldCaller));
  }
public class CustomerStatusDescriber implements IDescriber<CustomerStatus> {

  private static final ILogger LOGGER =
      AppServiceFacade.getLoggerService().getLogger(CustomerStatusDescriber.class);

  @Override
  public String getDescription(
      CustomerStatus status, Locale locale, UserId userId, TldServiceFacade tld) {

    if (status == CustomerStatus.ACTIVE) return "Actif";
    if (status == CustomerStatus.ARCHIVED) return "Archivé";
    if (status == CustomerStatus.INACTIVE) return "Inactif";
    if (status instanceof Blocked) return "Bloqué";

    CustomerStatusDescriber.LOGGER.warn("No description defined for customer status:" + status);
    return status.getDictionaryKey();
  }
}
Example #9
0
  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();
  }
Example #10
0
 public WhoisContact getHolder() throws ServiceException {
   if (this.holderNicHandle != null) {
     try {
       return AppServiceFacade.getWhoisContactService()
           .getContactWithHandle(this.holderNicHandle, this.userIdCaller, this.tldCaller);
     } catch (NotFoundException e) {
       if (this.hasHolderSnapshot()) {
         return this.getHolderSnapshot().getContact();
       } else {
         throw new NotFoundException(
             "No contact or snapshot found for handle " + this.holderNicHandle,
             CorporateEntityWhoisContact.class);
       }
     }
   } else {
     throw new ServiceException("No contactHolderHandle defined");
   }
 }
Example #11
0
  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;
  }
Example #13
0
 @Override
 public void populate() throws ServiceException {
   AppServiceFacade.getQualificationService()
       .populateQualification(this, this.userIdCaller, this.tldCaller);
 }