Package com.volantis.mcs.policies

Examples of com.volantis.mcs.policies.Policy


     * @exception RepositoryException if an error occurs
     */
    private void transferPolicy(PolicyType policyType, String name)
        throws RepositoryException {

        Policy policy;
        try {
          policy = srcPolicyAccessor.retrievePolicy(name);
        } catch (RepositoryException e) {
            // Try to report the name of the policy we couldn't read
            throw new RepositoryException(
View Full Code Here


                                             String name) {

        // attempt to retrieve the supplied policy from the repository.

        try {
            Policy retrievedPolicy = accessor.retrievePolicy(name);
            return retrievedPolicy != null;
        } catch (RepositoryException e) {
            // If there was an exception here, we do not know if the policy
            // exists in the repository or not, and if we let the exception
            // go up the stack, then it obscures the original exception which
View Full Code Here

    }

    public Policy retrievePolicy(String name)
            throws RepositoryException {

        Policy policy = null;
        final PolicyBuilder policyBuilder =
                accessor.retrievePolicyBuilder(connection, project, name);
        if (policyBuilder != null) {
            policy = policyBuilder.getPolicy();
        }
View Full Code Here

                        project,
                        new MarinerURL(sAsset.getName()),
                        assetGroupName,
                PolicyType.BASE_URL);

        Policy policy = policyFetcher.fetchPolicy(reference);
        AssetGroup group = null;
        if (policy == null) {
            logger.warn("asset-group-not-found",
                    new Object[]{reference.getName(), asset.getName()});
        } else {
View Full Code Here

        this.policyType = policyType;
    }

    // Javadoc inherited.
    public boolean select(CacheEntry entry) {
        Policy policy = (Policy) entry.getValue();
        return (policy != null && policy.getPolicyType() == policyType);
    }
View Full Code Here

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

        IMDPolicyFetcher fetcher = new IMDPolicyFetcher(fetcherMock,
                activatorMock, projectProviderMock);

        Policy actualPolicy = fetcher.fetchPolicy(reference);
        assertSame(activatedPolicyMock, actualPolicy);
    }
View Full Code Here

        // Add the inline policy.
        fetcher.addInlinePolicyBuilder(builderMock);

        // Fetch the policy, this should return the activated version of the
        // inline policy that was added.
        Policy actualPolicy = fetcher.fetchPolicy(reference);
        assertSame(activatedPolicyMock, actualPolicy);
    }
View Full Code Here

        //   Test Expectations
        // =====================================================================

        ActivatedPolicyRetriever retriever =
                new CachingActivatedPolicyRetriever(policyCache, retrieverMock);
        Policy actualPolicy;

        // ---------------------------------------------------------------------
        //   First Request
        // ---------------------------------------------------------------------
View Full Code Here

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

        ActivatedPolicyRetriever retriever =
                new CachingActivatedPolicyRetriever(policyCache, retrieverMock);

        Policy actualPolicy;

        // ---------------------------------------------------------------------
        //   First Request
        // ---------------------------------------------------------------------
View Full Code Here


        RuntimePolicyReference runtime = new NormalizedPolicyReferenceImpl(
                projectMock, "/fred.foo", PolicyType.AUDIO);

        Policy policy = fetcher.fetchPolicy(runtime);
        assertSame("Policy", policyMock, policy);
    }
View Full Code Here

TOP

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

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.