Package java.util

Examples of java.util.Calendar.roll()


    }

    protected void processDeletions() {
        Map<String, Object> parameters = new HashMap<String, Object>(1);
        Calendar cal = Calendar.getInstance();
        cal.roll(Calendar.MINUTE, TIMEOUT);
        parameters.put("creation", cal.getTime());
        List<TemporalFile> outdated = dao.findByNamedQuery(TemporalFile.FIND_TIMED_OUT, 0, 50, parameters);
        if (log.isInfoEnabled()) log.info("Found [" + outdated.size() + "] outdated temporal files to remove");
        for (TemporalFile tempFile : outdated) {
            String uri = tempFile.getUri();
View Full Code Here


        if (request instanceof HttpServletRequest) {
            filterChain.doFilter(request, response);
            HttpServletResponse httpResponse = (HttpServletResponse) response;
            httpResponse.setHeader("Pragma", "public");
            Calendar cal = new GregorianCalendar();
            cal.roll(Calendar.SECOND, seconds);
            httpResponse.setHeader("Cache-Control", "PUBLIC, max-age=" + seconds + ", must-revalidate");
            httpResponse.setHeader("Expires", httpDateFormat.format(cal.getTime()));
        }
    }
View Full Code Here

  @Override
  public IValue visitDateTime(Type type) {
    Calendar cal = Calendar.getInstance();
    int milliOffset = stRandom.nextInt(1000) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MILLISECOND, milliOffset);
    int second = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.SECOND, second);
    int minute = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MINUTE, minute);
    int hour = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
View Full Code Here

  public IValue visitDateTime(Type type) {
    Calendar cal = Calendar.getInstance();
    int milliOffset = stRandom.nextInt(1000) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MILLISECOND, milliOffset);
    int second = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.SECOND, second);
    int minute = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MINUTE, minute);
    int hour = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.HOUR_OF_DAY, hour);
    int day = stRandom.nextInt(30) * (stRandom.nextBoolean() ? -1 : 1);
View Full Code Here

    int milliOffset = stRandom.nextInt(1000) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MILLISECOND, milliOffset);
    int second = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.SECOND, second);
    int minute = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MINUTE, minute);
    int hour = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.HOUR_OF_DAY, hour);
    int day = stRandom.nextInt(30) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.DAY_OF_MONTH, day);
    int month = stRandom.nextInt(12) * (stRandom.nextBoolean() ? -1 : 1);
View Full Code Here

    int second = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.SECOND, second);
    int minute = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MINUTE, minute);
    int hour = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.HOUR_OF_DAY, hour);
    int day = stRandom.nextInt(30) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.DAY_OF_MONTH, day);
    int month = stRandom.nextInt(12) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MONTH, month);
   
View Full Code Here

    int minute = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MINUTE, minute);
    int hour = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.HOUR_OF_DAY, hour);
    int day = stRandom.nextInt(30) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.DAY_OF_MONTH, day);
    int month = stRandom.nextInt(12) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MONTH, month);
   
    // make sure we do not go over the 4 digit year limit, which breaks things
    int year = stRandom.nextInt(5000) * (stRandom.nextBoolean() ? -1 : 1);
View Full Code Here

    int hour = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.HOUR_OF_DAY, hour);
    int day = stRandom.nextInt(30) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.DAY_OF_MONTH, day);
    int month = stRandom.nextInt(12) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MONTH, month);
   
    // make sure we do not go over the 4 digit year limit, which breaks things
    int year = stRandom.nextInt(5000) * (stRandom.nextBoolean() ? -1 : 1);
   
    // make sure we don't go into negative territory
View Full Code Here

  // TODO: this is broken!
  public IValue arbDateTime() {
    Calendar cal = Calendar.getInstance();
    int milliOffset = random.nextInt(1000) * (random.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MILLISECOND, milliOffset);
    int second = random.nextInt(60) * (random.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.SECOND, second);
    int minute = random.nextInt(60) * (random.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MINUTE, minute);
    int hour = random.nextInt(60) * (random.nextBoolean() ? -1 : 1);
View Full Code Here

  public IValue arbDateTime() {
    Calendar cal = Calendar.getInstance();
    int milliOffset = random.nextInt(1000) * (random.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MILLISECOND, milliOffset);
    int second = random.nextInt(60) * (random.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.SECOND, second);
    int minute = random.nextInt(60) * (random.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MINUTE, minute);
    int hour = random.nextInt(60) * (random.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.HOUR_OF_DAY, hour);
    int day = random.nextInt(30) * (random.nextBoolean() ? -1 : 1);
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.