Package com.volantis.shared.time

Examples of com.volantis.shared.time.Period.inMillis()


                headers.remove(oldHeader);
            }
        }
        // compute the current age
        final Period currentAge = state.getCurrentAge(clock.getCurrentTime());
        final long currentAgeLong = currentAge.inMillis() / 1000;
        final int currentAgeInt;
        if (currentAgeLong > Integer.MAX_VALUE) {
            currentAgeInt = Integer.MAX_VALUE;
        } else {
            currentAgeInt = (int) currentAgeLong;
View Full Code Here


            throw new IllegalArgumentException(
                    "Statistics not gathered from same source");
        }

        Period period = gatherTime.getPeriodSince(snapshot.gatherTime);
        if (period.inMillis() < 0) {
            throw new IllegalArgumentException("Other snapshot must have been " +
                    "gathered before this snapshot");
        }

        int deltaHitCount = getHitCount() - snapshot.getHitCount();
View Full Code Here

                // compute max-age value
                final Period timeToLive = cachingDirectives.getTimeToLive();
                long maxAgeInSeconds = 0;
                if (timeToLive != null) {
                    maxAgeInSeconds =
                        LongHelper.asInt(timeToLive.inMillis() / 1000);
                    if (maxAgeInSeconds < 0) {
                        maxAgeInSeconds = 0;
                    }
                }
                response.addHeader("Cache-Control", "max-age=" + maxAgeInSeconds);
View Full Code Here

            context.getEnvironmentContext().getCachingDirectives();
        long timeToLive = -1;
        if (cachingDirectives != null) {
            final Period ttl = cachingDirectives.getTimeToLive();
            if (ttl != null) {
                timeToLive = ttl.inMillis();
            }
        }

        // Create and store CSS Cache Entry.
        final CacheIdentity identity =
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.