Пример #1
0
  public String generateReadonlyToken(String token) {
    int count = iterationBusiness.getIterationCountFromReadonlyToken(token);
    while (count > 0) {
      SecureRandom r = new SecureRandom();
      token = new BigInteger(130, r).toString();
      count = iterationBusiness.getIterationCountFromReadonlyToken(token);
    }

    return token;
  }
 protected TimeSeries getPredictedVelocityTimeSeries(
     LocalDate iterationStart,
     LocalDate iterationEnd,
     IterationHistoryEntry yesterdayEntry,
     IterationHistoryEntry todayEntry) {
   LocalDate today = new LocalDate();
   ExactEstimate startValue = getTodaysStartValueWithScoping(yesterdayEntry, todayEntry);
   ExactEstimate velocity =
       iterationBusiness.calculateDailyVelocity(iterationStart, yesterdayEntry);
   LocalDate startDate = (iterationEnd.isBefore(today)) ? iterationEnd : today;
   LocalDate endDate =
       iterationHistoryEntryBusiness.calculateExpectedEffortDoneDate(
           startDate, startValue, velocity);
   if (endDate == null) return null;
   endDate = endDate.plusDays(1);
   if (startDate.isEqual(endDate)) return null;
   return this.getSeriesByStartAndEndPoints(
       EXPECTED_SERIES_NAME,
       today
           .toDateTimeAtCurrentTime()
           .minusMinutes(timeDifferenceMinutes)
           .toLocalDate()
           .toDateTimeAtStartOfDay(),
       startValue,
       endDate
           .toDateTimeAtCurrentTime()
           .minusMinutes(timeDifferenceMinutes)
           .toLocalDate()
           .toDateTimeAtStartOfDay(),
       ExactEstimate.ZERO);
 }