コード例 #1
0
  @Override
  public void stopByUser(String subscriberNumber, ProgramType programType) {
    Subscription subscription =
        validation.validateSubscriptionToStop(subscriberNumber, programType);

    if (subscription != null) {
      subscription.setStatus(SubscriptionStatus.EXPIRED);
      for (ISubscriptionFlowProcess process : asList(campaign, persistence)) {
        if (process.stopByUser(subscription)) continue;
        break;
      }
    }
  }
コード例 #2
0
 Subscription rollOverSubscriptionFrom(Subscription subscription) {
   return subscription != null
       ? new Subscription(
               subscription.getSubscriber(),
               subscription.rollOverProgramType(),
               SubscriptionStatus.ACTIVE,
               new WeekAndDay(
                   new Week(subscription.rollOverProgramType().getMinWeek()),
                   new DateUtils().today()),
               DateUtil.now())
           .updateCycleInfo(programMessageCycle)
       : null;
 }
コード例 #3
0
 @Override
 public void stopExpired(Subscription subscription) {
   subscription.setStatus(SubscriptionStatus.EXPIRED);
   for (ISubscriptionFlowProcess process : asList(campaign, persistence)) {
     if (process.stopExpired(subscription)) continue;
     break;
   }
 }
コード例 #4
0
 @Override
 public void start(Subscription subscription) {
   subscription.updateCycleInfo(programMessageCycle);
   for (ISubscriptionFlowProcess process : asList(validation, persistence, campaign)) {
     if (process.startFor(subscription)) continue;
     break;
   }
 }
コード例 #5
0
 @Override
 public void rollOverByEvent(Subscription subscription) {
   if (!subscription.canRollOff()) stopExpired(subscription);
   else performRollOver(subscription);
 }