Examples of Predictor


Examples of it.sauronsoftware.cron4j.Predictor

        logger.debug("Sending song reminder based on {} allowed songs for "
                + "dj {}", numAllowedSongs, dj);
        jizzEmailServices.sendSongReminderEmail(dj, broadcast);

        try {
            Predictor cron = new Predictor(
                    station.getSongReminderMessageSchedule());
            cron.setTimeZone(station.getTimeZone());
            Date when = cron.nextMatchingDate();

            if (logger.isTraceEnabled()) {
                logger.trace("Scheduling song reminder task based on "
                        + "cron schedule "
                        + station.getNewBroadcastMessageSchedule()
View Full Code Here

Examples of it.sauronsoftware.cron4j.Predictor

        broadcast.setStation(station);

        // The most important part of a new broadcast is its end date which is
        // calculated based on the Cron expression of the station
        try {
            Predictor cron = new Predictor(station.getBroadcastSchedule());
            cron.setTimeZone(station.getTimeZone());
            broadcast.setFinale(cron.nextMatchingDate());
        } catch (InvalidPatternException pEx) {
            logger.error("Cron trigger " + station.getBroadcastSchedule()
                    + " is invalid", pEx);

            // Send error to the admins
            String msg = JizzServicesErrors.getString(station.getLocale(),
                    MSG_ERR_INVALID_BROADCAST_SCHEDULE);
            msg = MessageFormat.format(msg, station.getBroadcastSchedule());
            jizzErrorServices.reportErrorToAdmins(station, msg, pEx);

            throw new RuntimeException("The cron trigger '"
                    + station.getBroadcastSchedule()
                    + "' is not valid, can't make a new broadcast", pEx);
        }

        // The estimated start date for now is 2 hours before the end. In the
        // future might try and inspect past broadcasts and guess an average,
        // but not now!
        long millis = broadcast.getFinale().getTime();
        broadcast.setEstimatedStart(new Date(millis
                - GUESSED_BROADCAST_LENGTH_IN_MILLIS));

        broadcast = jizzBroadcastDao.createOrUpdateBroadcast(broadcast);

        try {
            Predictor cron = new Predictor(
                    station.getNewBroadcastMessageSchedule());
            cron.setTimeZone(station.getTimeZone());
            Date when = cron.nextMatchingDate();

            if (logger.isTraceEnabled()) {
                logger.trace("Scheduling new broadcast messages task based on "
                        + "cron schedule "
                        + station.getNewBroadcastMessageSchedule()
View Full Code Here

Examples of it.sauronsoftware.cron4j.Predictor

        logger.trace("Sending all DJ's for station {} an alert that there's "
                + "a new broadcast {}", station, broadcast);

        Date when;
        try {
            Predictor cron = new Predictor(
                    station.getSongReminderMessageSchedule());
            cron.setTimeZone(station.getTimeZone());
            when = cron.nextMatchingDate();

            if (logger.isTraceEnabled()) {
                logger.trace("Song reminder messages will be scheduled based "
                        + "on cron schedule "
                        + station.getSongReminderMessageSchedule()
View Full Code Here

Examples of pattern.predictor.Predictor

    for (int i = 0; i < child_nodes.getLength(); i++) {
      Node child = child_nodes.item(i);

      if (child.getNodeType() == Node.ELEMENT_NODE) {
        Predictor pred = PredictorFactory.getPredictor(schema,
            (Element) child);
        predictors.add(pred);
        LOG.debug(pred.toString());
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.