Package java.util

Examples of java.util.Calendar.before()


                         return next.getTime();
            case WEEKLY : final Calendar nextW = Calendar.getInstance();
                          nextW.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
                          nextW.set(Calendar.MINUTE, this.minuteOfHour);
                          nextW.set(Calendar.DAY_OF_WEEK, this.dayOfWeek);
                          if ( nextW.before(now) ) {
                              nextW.add(Calendar.WEEK_OF_YEAR, 1);
                          }
                          return nextW.getTime();
            case HOURLY : final Calendar nextH = Calendar.getInstance();
                          nextH.set(Calendar.MINUTE, this.minuteOfHour);
View Full Code Here


                              nextW.add(Calendar.WEEK_OF_YEAR, 1);
                          }
                          return nextW.getTime();
            case HOURLY : final Calendar nextH = Calendar.getInstance();
                          nextH.set(Calendar.MINUTE, this.minuteOfHour);
                          if ( nextH.before(now) ) {
                              nextH.add(Calendar.HOUR_OF_DAY, 1);
                          }
                          return nextH.getTime();
            case MONTHLY : final Calendar nextM = Calendar.getInstance();
                           nextM.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
View Full Code Here

                          return nextH.getTime();
            case MONTHLY : final Calendar nextM = Calendar.getInstance();
                           nextM.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
                           nextM.set(Calendar.MINUTE, this.minuteOfHour);
                           nextM.set(Calendar.DAY_OF_MONTH, this.dayOfWeek);
                           if ( nextM.before(now) ) {
                               nextM.add(Calendar.MONTH, 1);
                           }
                           return nextM.getTime();
            case YEARLY : final Calendar nextY = Calendar.getInstance();
                          nextY.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
View Full Code Here

            case YEARLY : final Calendar nextY = Calendar.getInstance();
                          nextY.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
                          nextY.set(Calendar.MINUTE, this.minuteOfHour);
                          nextY.set(Calendar.DAY_OF_MONTH, this.dayOfWeek);
                          nextY.set(Calendar.MONTH, this.monthOfYear - 1);
                          if ( nextY.before(now) ) {
                              nextY.add(Calendar.YEAR, 1);
                          }
                          return nextY.getTime();
            case CRON : try {
                            final CronExpression exp = new CronExpression(this.expression);
View Full Code Here

            if ( caps.isActive() ) {
                final ValueMap vm = ResourceUtil.getValueMap(childResource);
                final Calendar created = vm.get(Utility.PROPERTY_LOCK_CREATED, Calendar.class);
                if ( created != null ) {
                    // lock resource
                    if ( created.before(startDate) ) {
                        candidates.add(childResource);
                    }
                } else {
                    lockCleanup(caps, candidates, childResource, startDate);
                }
View Full Code Here

                        if (node.isNodeType(JcrConstants.NT_FILE)) {
                            // assume that we are intending to replace this file
                            targetParent = node.getParent();
                            targetName = node.getName();
                            Calendar nodeLastMod = JcrUtils.getLastModified(node);
                            if (!nodeLastMod.before(fileLastMod)) {
                                log.info("File '{}' does not have a newer timestamp than '{}'. Skipping import.",
                                        dataSource, target);
                                return;
                            }
                        } else {
View Full Code Here

                            targetParent = node;
                            targetName = fileName;
                            if (targetParent.hasNode(targetName)) {
                                Node targetNode = targetParent.getNode(targetName);
                                Calendar nodeLastMod = JcrUtils.getLastModified(targetNode);
                                if (!nodeLastMod.before(fileLastMod)) {
                                    log.info("File '{}' does not have a newer timestamp than '{}'. Skipping import.",
                                            dataSource, targetNode.getPath());
                                    return;
                                }
                            }
View Full Code Here

    }

    // Validate whether the security semantics have expired
    Calendar rightNow = Calendar.getInstance();
    Calendar exp = timestamp.getExpires();
    if (exp != null && wssConfig.isTimeStampStrict() && exp.before(rightNow)) {
      throw new WSSecurityException(
          WSSecurityException.INVALID_SECURITY,
          "invalidTimestamp",
          new Object[] { "The security semantics of message have expired" });
    }
View Full Code Here

        } else {
            Calendar now = Calendar.getInstance();
            now.setTimeInMillis( workingMemory.getSessionClock().getCurrentTime() );

            if ( this.dateEffective != null && this.dateExpires != null ) {
                return (now.after( this.dateEffective ) && now.before( this.dateExpires ));
            } else if ( this.dateEffective != null ) {
                return (now.after( this.dateEffective ));
            } else {
                return (now.before( this.dateExpires ));
            }
View Full Code Here

            if ( this.dateEffective != null && this.dateExpires != null ) {
                return (now.after( this.dateEffective ) && now.before( this.dateExpires ));
            } else if ( this.dateEffective != null ) {
                return (now.after( this.dateEffective ));
            } else {
                return (now.before( this.dateExpires ));
            }
        }
    }

    public void setNoLoop(final boolean noLoop) {
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.