Examples of CacheControlBuilder


Examples of com.volantis.mcs.policies.CacheControlBuilder

        this.defaultMaxRetryMaxCount = DEFAULT_MAX_RETRY_MAX_COUNT;

        // Set up the default cache control.
        PolicyFactory factory = PolicyFactory.getDefaultInstance();

        CacheControlBuilder builder = factory.createCacheControlBuilder();
        builder.setCacheThisPolicy(DEFAULT_CACHE_THIS_POLICY);
        builder.setRetainDuringRetry(DEFAULT_RETAIN_DURING_RETRY);
        builder.setRetryFailedRetrieval(DEFAULT_RETRY_FAILED_RETRIEVAL);
        builder.setRetryInterval(DEFAULT_RETRY_INTERVAL);
        builder.setRetryMaxCount(DEFAULT_RETRY_MAX_COUNT);
        builder.setTimeToLive(DEFAULT_TIME_TO_LIVE);

        // Force the defaults to adhere to restrictions.
        applyConstraints(builder);

        this.defaultCacheControl = builder.getCacheControl();
    }
View Full Code Here

Examples of com.volantis.mcs.policies.CacheControlBuilder

        // Create the default CacheControlBuilder.
        PolicyFactory factory = PolicyFactory.getDefaultInstance();

        CacheControl baseCacheControl = base.getDefaultCacheControl();

        CacheControlBuilder builder = factory.createCacheControlBuilder();
        builder.setCacheThisPolicy(getBoolean(
                configuration.getDefaultCacheThisPolicy(),
                baseCacheControl.getCacheThisPolicy()));
        builder.setRetainDuringRetry(getBoolean(
                configuration.getDefaultRetainDuringRetry(),
                baseCacheControl.getRetainDuringRetry()));
        builder.setRetryFailedRetrieval(getBoolean(
                configuration.getDefaultRetryFailedRetrieval(),
                baseCacheControl.getRetryFailedRetrieval()));
        builder.setRetryInterval(getInteger(
                configuration.getDefaultRetryInterval(),
                baseCacheControl.getRetryInterval()));
        builder.setRetryMaxCount(getInteger(
                configuration.getDefaultRetryMaxCount(),
                baseCacheControl.getRetryMaxCount()));
        builder.setTimeToLive(getInteger(configuration.getDefaultTimeToLive(),
                baseCacheControl.getTimeToLive()));

        // Force the defaults to adhere to restrictions.
        applyConstraints(builder);

        // Force the builder to create the cache control so that it can be
        // accessed concurrently.
        this.defaultCacheControl = builder.getCacheControl();

        // At the moment the derived constraints default to using the current
        // value of these constraints.
        defaultAllowCacheThisPolicy = allowCacheThisPolicy;
        defaultAllowRetainDuringRetry = allowRetainDuringRetry;
View Full Code Here

Examples of com.volantis.mcs.policies.CacheControlBuilder

                logicalProject.getCacheControlConstraintsMap();
        CacheControlConstraints constraints = constraintsMap.getConstraints(
                policyType);

        // Get the cache control builder from the policy.
        CacheControlBuilder cacheControlBuilder =
                policyBuilder.getCacheControlBuilder();
        if (cacheControlBuilder == null) {
            // No builder was set so use a default builder.
            cacheControlBuilder = constraints.getDefaultCacheControl()
                    .getCacheControlBuilder();
View Full Code Here

Examples of com.volantis.mcs.policies.CacheControlBuilder

            final boolean retryFailedRetrieval,
            final int retryInterval,
            final int retryMaxCount,
            final int timeToLive) {
        PolicyFactory factory = PolicyFactory.getDefaultInstance();
        CacheControlBuilder builder = factory.createCacheControlBuilder();
        builder.setCacheThisPolicy(cacheThisPolicy);
        builder.setRetainDuringRetry(retainDuringRetry);
        builder.setRetryFailedRetrieval(retryFailedRetrieval);
        builder.setRetryInterval(retryInterval);
        builder.setRetryMaxCount(retryMaxCount);
        builder.setTimeToLive(timeToLive);
        CacheControl cacheControl = builder.getCacheControl();
        return cacheControl;
    }
View Full Code Here

Examples of com.volantis.mcs.policies.CacheControlBuilder

        //   Test Expectations
        // =====================================================================
        RemotePolicyCacheConfiguration configuration =
                new RemotePolicyCacheConfiguration();
        CacheControlConstraints constraints = new CacheControlConstraints(configuration);
        CacheControlBuilder builder = policyFactory.createCacheControlBuilder();
        builder.setRetainDuringRetry(true);
        builder.setRetryFailedRetrieval(true);
        builder.setRetryInterval(-10);
        builder.setRetryMaxCount(100);
        builder.setTimeToLive(100000);
        constraints.applyConstraints(builder);

        CacheControl cacheControl = builder.getCacheControl();
        checkCacheControl(cacheControl, true, true, true, 0, 10, 100000);
    }
View Full Code Here

Examples of com.volantis.mcs.policies.CacheControlBuilder

        // =====================================================================
        RemotePolicyCacheConfiguration configuration =
                new RemotePolicyCacheConfiguration();
        configuration.setAllowCacheThisPolicy(Boolean.FALSE);
        CacheControlConstraints constraints = new CacheControlConstraints(configuration);
        CacheControlBuilder builder = policyFactory.createCacheControlBuilder();
        builder.setRetainDuringRetry(true);
        builder.setCacheThisPolicy(true);
        builder.setRetryInterval(-10);
        builder.setRetryMaxCount(100);
        builder.setTimeToLive(1000);
        constraints.applyConstraints(builder);

        CacheControl cacheControl = builder.getCacheControl();
        checkCacheControl(cacheControl, false, false, false, 0, 0, 0);
    }
View Full Code Here

Examples of com.volantis.mcs.policies.CacheControlBuilder

        // =====================================================================
        RemotePolicyCacheConfiguration configuration =
                new RemotePolicyCacheConfiguration();
        configuration.setAllowRetryFailedRetrieval(Boolean.FALSE);
        CacheControlConstraints constraints = new CacheControlConstraints(configuration);
        CacheControlBuilder builder = policyFactory.createCacheControlBuilder();
        builder.setRetainDuringRetry(true);
        builder.setRetryFailedRetrieval(true);
        builder.setRetryInterval(-10);
        builder.setRetryMaxCount(100);
        builder.setTimeToLive(1000);
        constraints.applyConstraints(builder);

        CacheControl cacheControl = builder.getCacheControl();
        checkCacheControl(cacheControl, true, false, false, 0, 0, 1000);
    }
View Full Code Here

Examples of com.volantis.mcs.policies.CacheControlBuilder

        // =====================================================================
        RemotePolicyCacheConfiguration configuration =
                new RemotePolicyCacheConfiguration();
        configuration.setAllowRetainDuringRetry(Boolean.FALSE);
        CacheControlConstraints constraints = new CacheControlConstraints(configuration);
        CacheControlBuilder builder = policyFactory.createCacheControlBuilder();
        builder.setRetainDuringRetry(true);
        builder.setRetryFailedRetrieval(true);
        builder.setRetryInterval(-10);
        builder.setRetryMaxCount(100);
        builder.setTimeToLive(1000);
        constraints.applyConstraints(builder);

        CacheControl cacheControl = builder.getCacheControl();
        checkCacheControl(cacheControl, true, false, true, 0, 10, 1000);
    }
View Full Code Here

Examples of com.volantis.mcs.policies.CacheControlBuilder

        // =====================================================================
        RemotePolicyCacheConfiguration configuration =
                new RemotePolicyCacheConfiguration();
        configuration.setMinRetryInterval(new Integer(100));
        CacheControlConstraints constraints = new CacheControlConstraints(configuration);
        CacheControlBuilder builder = policyFactory.createCacheControlBuilder();
        builder.setRetryInterval(50);
        constraints.applyConstraints(builder);

        CacheControl cacheControl = builder.getCacheControl();
        assertEquals(100, cacheControl.getRetryInterval());
    }
View Full Code Here

Examples of com.volantis.mcs.policies.CacheControlBuilder

        // =====================================================================
        RemotePolicyCacheConfiguration configuration =
                new RemotePolicyCacheConfiguration();
        configuration.setMinRetryInterval(new Integer(100));
        CacheControlConstraints constraints = new CacheControlConstraints(configuration);
        CacheControlBuilder builder = policyFactory.createCacheControlBuilder();
        builder.setRetryInterval(150);
        constraints.applyConstraints(builder);

        CacheControl cacheControl = builder.getCacheControl();
        assertEquals(150, cacheControl.getRetryInterval());
    }
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.