Package com.volantis.mcs.policies

Examples of com.volantis.mcs.policies.CacheControlBuilder


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

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


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

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

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

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

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

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

        VariablePolicyBuilder builder = createOriginalPolicyBuilder(remoteName);

        ActivatedPolicy originalPolicy =
                new TestActivatedPolicy(builder.getPolicy(), projectMock);

        CacheControlBuilder cacheControlBuilder =
                builder.getCacheControlBuilder();
        cacheControlBuilder.setTimeToLive(2);
        cacheControlBuilder.setRetryMaxCount(1);

        ActivatedPolicy refreshedPolicy =
                new TestActivatedPolicy(builder.getPolicy(), projectMock);;
        assertNotEquals(originalPolicy, refreshedPolicy);
View Full Code Here

            String policyName) {
        VariablePolicyBuilder builder =
                policyFactory.createVariablePolicyBuilder(PolicyType.AUDIO);
        builder.setName(policyName);

        CacheControlBuilder cacheControlBuilder =
                policyFactory.createCacheControlBuilder();
        cacheControlBuilder.setCacheThisPolicy(true);
        cacheControlBuilder.setTimeToLive(1);
        cacheControlBuilder.setRetryFailedRetrieval(true);
        cacheControlBuilder.setRetryInterval(1);
        cacheControlBuilder.setRetryMaxCount(2);
        builder.setCacheControlBuilder(cacheControlBuilder);
        constraints.applyConstraints(cacheControlBuilder);
        return builder;
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.policies.CacheControlBuilder

Copyright © 2018 www.massapicom. 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.