Package com.volantis.mcs.policies

Examples of com.volantis.mcs.policies.PolicyFactory


            addPage(pages[i]);
        }
    }

    protected List getCategories() {
        PolicyFactory policyFactory = PolicyFactory.getDefaultInstance();

        PolicyEditorContext context = (PolicyEditorContext)getContext();

        List categories = new ArrayList();
        List categoryValues = context.getCategoryValues();
        if (categoryValues != null && !categoryValues.isEmpty()) {
            Iterator it = categoryValues.iterator();
            while (it.hasNext()) {
                String value = (String) it.next();
                CategoryReference categoryRef =
                        policyFactory.createCategoryReference(value);
                categories.add(categoryRef);
            }
        }
        return categories;
    }
View Full Code Here


        // Set the Layout (needed for FormatReference and panes)
        CanvasLayout layout = new CanvasLayout();

        // Don't actual resolve anything as it requires repository connections,
        // branding information, etc.
        PolicyFactory factory = PolicyFactory.getDefaultInstance();
        RolloverImagePolicyBuilder rolloverBuilder =
                factory.createRolloverImagePolicyBuilder();
        rolloverBuilder.setName("Test rollover response");
        rolloverBuilder.setNormalPolicy(factory.createPolicyReference("Normal",
                PolicyType.IMAGE));
        rolloverBuilder.setOverPolicy(factory.createPolicyReference("Over",
                PolicyType.IMAGE));
        //pageContext.setRollover(rollover);

        // Intitialise the context
        pageContext.pushRequestContext(requestContext);
View Full Code Here

            = ContextInternals.getMarinerPageContext (mrc);
       
        pageContext.pushIMDAPIElement(this);

        // Create the base URL builder.
        PolicyFactory factory = PolicyFactory.getDefaultInstance();
        BaseURLPolicyBuilder builder = factory.createBaseURLPolicyBuilder();
        builder.setName(attrs.getName());

        String locationTypeAsString = attrs.getLocationType();
        BaseLocation baseLocation = getBaseLocation(locationTypeAsString);
        builder.setBaseLocation(baseLocation);
View Full Code Here

        }
    }

    public boolean perform(final PolicyBuilderManager manager) {

        final PolicyFactory factory = PolicyFactory.getDefaultInstance();

        FileEx sourceDirEx = new FileEx(sourceDirectory);
        sourceDirEx.forEachDirectory(new FileExOperation() {
            public void perform(File policyDir) {

                try {
                    logger.info("processing-policy",
                            policyDir.getName());

                    // Figure out the location of the component.
                    String policyName = policyDir.getName() + "." +
                            FileExtension.IMAGE_COMPONENT.getExtension();

                    if (componentNamePrefix != null) {
                        policyName = componentNamePrefix + policyName;
                    }

                    // Create the component, if any.
                    VariablePolicyBuilder policyBuilder = (VariablePolicyBuilder)
                            manager.getPolicyBuilder(policyName);

                    // Check to see whether the existing container should
                    // be updated, or a new one created.
                    boolean update = (policyBuilder != null && replace);
                    if (policyBuilder != null) {
                        if (replace) {

                            // ... then remove it
                            logger.info("removing-existing", policyName);

                            manager.removePolicyBuilder(policyName);
                        } else {
                            // ... else all we can do is log a warning.
                            logger.info("found-existing-ignoring-new",
                                        new Object[] {policyName});
                        }
                    }

                    if (policyBuilder == null) {
                        policyBuilder = factory.createVariablePolicyBuilder(
                                PolicyType.IMAGE);
                        policyBuilder.setName(policyName);
                        update = false;
                    } else {
                        update = true;
View Full Code Here

        this.defaultMinRetryInterval = DEFAULT_MIN_RETRY_INTERVAL;
        this.defaultAllowRetainDuringRetry = DEFAULT_ALLOW_RETAIN_DURING_RETRY;
        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);
View Full Code Here

            maxRetryMaxCount = 0;
        }

        // 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(),
View Full Code Here

            final boolean cacheThisPolicy, final boolean retainDuringRetry,
            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);
View Full Code Here

public class RuntimeVariablePolicyTestCase
        extends TestCaseAbstract {

    public void testDeviceTargeted() {

        PolicyFactory factory = PolicyFactory.getDefaultInstance();

       
        // todo
    }
View Full Code Here

TOP

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

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.