Examples of SeparateCacheControlConstraintsMap


Examples of com.volantis.mcs.runtime.policies.cache.SeparateCacheControlConstraintsMap

        parent.setAssetsConfiguration(assetsConfiguration);

        // Set the PolicySource
        parent.setPolicySource(policySourceMock);

        SeparateCacheControlConstraintsMap cacheConstraintsMap = new SeparateCacheControlConstraintsMap();

        DynamicProjectKey key = new DynamicProjectKey(policySourceMock,
                assetsConfiguration, null, cacheConstraintsMap);
       
        ProjectManagerMock pmMock = new ProjectManagerMock("pmMock", expectations);
View Full Code Here

Examples of com.volantis.mcs.runtime.policies.cache.SeparateCacheControlConstraintsMap

                            partitionConstraints.getConstraints(),
                            partitionConfiguration);

            builder.setCacheControlDefaults(base.getDefaultCacheControl());

            SeparateCacheControlConstraintsMap constraintsMap =
                    new SeparateCacheControlConstraintsMap();
            for (Iterator i = PolicyType.getPolicyTypes().iterator(); i.hasNext();) {
                PolicyType policyType = (PolicyType) i.next();
                PolicyTypePartitionConfiguration typePartitionConfiguration =
                        partition.getTypePartition(policyType);
                CacheControlConstraints typeConstraints;
                groupBuilder = cacheFactory.createGroupBuilder();
                if (typePartitionConfiguration == null) {
                    typeConstraints = base;
                    groupBuilder.setMaxCount(partitionSize);
                } else {
                    RemotePolicyCacheConfiguration typeConfiguration =
                            typePartitionConfiguration.getConstraints();
                    if (typeConfiguration == null) {
                        typeConstraints = base;
                    } else {
                        typeConstraints = new CacheControlConstraints(base,
                                typeConfiguration);
                    }
                    groupBuilder.setMaxCount(typePartitionConfiguration.getSize());
                }
                partitionGroup.addGroup(policyType, groupBuilder);
                constraintsMap.addConstraints(policyType, typeConstraints);
            }

            builder.setCacheGroup(partitionGroup);
            builder.setCacheControlDefaultsMap(constraintsMap);
        }
View Full Code Here

Examples of com.volantis.mcs.runtime.policies.cache.SeparateCacheControlConstraintsMap

        // =====================================================================

        // =====================================================================
        //   Test Expectations
        // =====================================================================
        final SeparateCacheControlConstraintsMap cacheControlConstraintsMap =
                new SeparateCacheControlConstraintsMap();
        DynamicProjectKey key1 = new DynamicProjectKey(
                policySourceMock,
                new AssetsConfiguration(), "", cacheControlConstraintsMap);
        DynamicProjectKey key2 = new DynamicProjectKey(
                policySourceMock,
View Full Code Here

Examples of com.volantis.mcs.runtime.policies.cache.SeparateCacheControlConstraintsMap

     *
     * @return A map of constraints one for each policy type.
     */
    private CacheControlConstraintsMap createLocalCacheControlConstraintsMap() {

        SeparateCacheControlConstraintsMap map = new SeparateCacheControlConstraintsMap();

        // Now create the set of defaults for the different policy types.
        Collection policyTypes = PolicyType.getPolicyTypes();
        for (Iterator i = policyTypes.iterator(); i.hasNext();) {
            PolicyType policyType = (PolicyType) i.next();
            PolicyCacheConfiguration configuration =
                    getPolicyCacheConfiguration(policyType);
            Boolean allowCacheThisPolicy;
            Integer timeout;
            if (configuration == null) {
                // Policies are not to be cached so do not create a group
                // for them.
                allowCacheThisPolicy = Boolean.FALSE;
                timeout = INTEGER_MAX_VALUE;
            } else {

                allowCacheThisPolicy = Boolean.TRUE;
                timeout = configuration.getTimeout();
                if (timeout == null || timeout.intValue() == -1) {
                    timeout = INTEGER_MAX_VALUE;
                }
            }

            CacheControlConstraints constraints = createLocalCacheConstraints(
                    allowCacheThisPolicy, timeout);

            map.addConstraints(policyType, constraints);
        }

        return map;
    }
View Full Code Here

Examples of com.volantis.mcs.runtime.policies.cache.SeparateCacheControlConstraintsMap

        // =====================================================================

        urlMapperMock = new ExternalPathToInternalURLMapperMock(
                "urlMapperMock", expectations);

        remoteConstraintsMap = new SeparateCacheControlConstraintsMap();
        localConstraintsMap = new SeparateCacheControlConstraintsMap();

        policyCacheMock = new PolicyCacheMock("policyCacheMock", expectations);

        policySourceFactoryMock = new RuntimePolicySourceFactoryMock(
                "policySourceFactoryMock", expectations);
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.