Package com.volantis.mcs.policies

Examples of com.volantis.mcs.policies.PolicyType


        // Create the branded name by prepending it to the project relative
        // name minus the leading /.
        String brandedName = brandName + projectRelativeName.substring(1);

        RuntimeProject project = (RuntimeProject) reference.getProject();
        PolicyType expectedPolicyType = reference.getExpectedPolicyType();
        if (remoteBrandName) {
            // The brand name is remote so we need to renormalize the
            // branded reference, as it could refer to another policy.
            reference = referenceFactory.createLazyNormalizedReference(
                    project, DUMMY, brandedName, expectedPolicyType);
View Full Code Here


    private StyleValue activateStyleComponentURI(
            StyleProperty property, StyleComponentURI componentURI) {

        String expression = componentURI.getExpressionAsString();

        PolicyType expectedPolicyType;
        if (property == StylePropertyDetails.MCS_BACKGROUND_DYNAMIC_VISUAL) {
            expectedPolicyType = PolicyType.VIDEO;
        } else {
            expectedPolicyType = PolicyType.IMAGE;
        }
View Full Code Here

                context, policy, requiredEncodings);

        if (selection == null) {

            // Try fallback.
            PolicyType policyType = policy.getPolicyType();
            RuntimePolicyReference fallbackReference = (RuntimePolicyReference)
                    policy.getAlternatePolicy(policyType);
            if (fallbackReference != null) {
                PolicyFetcher fetcher = context.getPolicyFetcher();
                policy = (ActivatedVariablePolicy)
View Full Code Here

        }

        Group policyGroup = null;
        if (policy != null) {
            // Get the group specific to the policy type.
            PolicyType policyType = policy.getPolicyType();
            policyGroup = baseGroup.findGroup(policyType);
        }

        if (policyGroup == null) {
            policyGroup = baseGroup;
View Full Code Here

    public ActivatedPolicy activate(
            RuntimeProject actualProject, PolicyBuilder policyBuilder,
            RuntimeProject logicalProject) {

        // Activate the cache control
        PolicyType policyType = policyBuilder.getPolicyType();
        CacheControlConstraintsMap constraintsMap =
                logicalProject.getCacheControlConstraintsMap();
        CacheControlConstraints constraints = constraintsMap.getConstraints(
                policyType);
View Full Code Here

        PolicyActivator variablePolicyActivator =
                new VariablePolicyActivator(referenceFactory);
        for (Iterator i = VariablePolicyType.getVariablePolicyTypes().iterator();
             i.hasNext();) {
            PolicyType policyType = (PolicyType) i.next();

            PolicyActivator activator;
            if (policyType == PolicyType.THEME) {
                activator = new ThemeActivator(referenceFactory);
            } else if (policyType == PolicyType.LAYOUT) {
View Full Code Here

        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) {
View Full Code Here

        int localSize = 0;
        Collection policyTypes = PolicyType.getPolicyTypes();
        for (Iterator i = policyTypes.iterator();
             i.hasNext() && localSize < Integer.MAX_VALUE;) {

            PolicyType policyType = (PolicyType) i.next();
            PolicyCacheConfiguration groupConfiguration =
                    getPolicyCacheConfiguration(policyType);
            if (groupConfiguration != null) {
                Integer integer = groupConfiguration.getMaxEntries();
                if (integer != null) {
                    if (integer.intValue() != -1) {
                        localSize += integer.intValue();
                    } else {
                        localSize = Integer.MAX_VALUE;
                    }
                } else {
                    localSize = Integer.MAX_VALUE;
                }
            }
        }

        // If the local size is still 0 then set it to one so that the cache
        // can be built.
        if (localSize == 0) {
            localSize = 1;
        }

        RemotePoliciesConfiguration remotePolicies =
                marinerConfig.getRemotePolicies();
        RemotePolicyCacheConfiguration policyCacheConfiguration =
                remotePolicies.getPolicyCache();
        if (policyCacheConfiguration == null) {
            policyCacheConfiguration = new RemotePolicyCacheConfiguration();
        }

        int remoteSize;
        remoteSize = getInteger(policyCacheConfiguration.getMaxCacheSize(),
                DEFAULT_REMOTE_GROUP_SIZE);

        PolicyCacheBuilder builder = new PolicyCacheBuilder(
                localSize, remoteSize);

        CacheControlConstraints localConstraints = createLocalCacheConstraints(
                Boolean.TRUE, null);

        PolicyCachePartitionConstraints localPartitionConstraints =
                createPartitionConstraints(localSize, localConstraints);

        builder.setLocalPartitionConstraints(localPartitionConstraints);

        PolicyCachePartitionConstraints remotePartitionConstraints =
                createPartitionConstraints(remoteSize, remoteConstraints);

        builder.setRemotePartitionConstraints(remotePartitionConstraints);

        // Now build the policy specific groups to the local group.
        for (Iterator i = policyTypes.iterator(); i.hasNext();) {

            PolicyType policyType = (PolicyType) i.next();
            PolicyCacheConfiguration groupConfiguration =
                    getPolicyCacheConfiguration(policyType);
            int maxCount;
            if (groupConfiguration == null) {
                // Allow some entries in the group to ensure that when a policy
View Full Code Here

TOP

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

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.