Examples of Assertion


Examples of org.apache.neethi.Assertion

            if (!a.isAsserted(this) && !a.isOptional()) {
                errors.add(a.getName());
                pass = false;
            }
        } else if (assertion instanceof Assertion) {
            Assertion ass = (Assertion)assertion;
            Collection<AssertionInfo> ail = getAssertionInfo(ass.getName());
            boolean found = false;
            for (AssertionInfo ai : ail) {
                if (ai.getAssertion().equal(ass)) {
                    found = true;
                    if (!ai.isAsserted() && !ass.isOptional()) {
                        errors.add(ass.getName());
                        pass = false;                   
                    }
                }
            }
            if (!found) {
                errors.add(ass.getName());
                return false;
            }
        }
        if (assertion instanceof PolicyContainingAssertion) {
            Policy p = ((PolicyContainingAssertion)assertion).getPolicy();
View Full Code Here

Examples of org.apache.neethi.Assertion

                                              boolean remove) {
        Iterator<? extends PolicyComponent> iterator = alt.iterator();
        while (iterator.hasNext()) {
            PolicyComponent a = iterator.next();
            if (a instanceof Assertion) {
                Assertion compatible = intersect(assertion, (Assertion)a);
                if (null != compatible) {
                    if (remove) {
                        iterator.remove();
                    }
                    return compatible;
View Full Code Here

Examples of org.apache.neethi.Assertion

       
        Iterator<? extends PolicyComponent> iterator = alt1.iterator();
        while (iterator.hasNext()) {
            PolicyComponent a1 = iterator.next();
            if (a1 instanceof Assertion) {
                Assertion assertion = findCompatibleAssertion((Assertion)a1, alt2, remove);
                if (assertion != null) {
                    if (remove) {
                        iterator.remove();
                    }
                    all.addPolicyComponent(assertion);
                } else if (!strict && ((Assertion)a1).isIgnorable()) {
                    all.addPolicyComponent(a1);
                } else if (strict || !((Assertion)a1).isIgnorable()) {
                    return null;
                }
            }
        }
        iterator = alt2.iterator();
        while (iterator.hasNext()) {
            PolicyComponent a2 = iterator.next();
            if (a2 instanceof Assertion) {
                Assertion assertion = findCompatibleAssertion((Assertion)a2, alt1, remove);
                if (assertion != null) {
                    all.addPolicyComponent(assertion);
                } else if (!strict && ((Assertion)a2).isIgnorable()) {
                    all.addPolicyComponent(a2);
                } else if (strict || !((Assertion)a2).isIgnorable()) {
View Full Code Here

Examples of org.apache.neethi.Assertion

        Iterator<List<Assertion>> alternatives = normalisedNested.getAlternatives();
        while (alternatives.hasNext()) {
            All all = new All();
            List<Assertion> alternative = alternatives.next();
            Policy n = new Policy(nested.getPolicyRegistry(), nested.getNamespace());
            Assertion a = clone(false, n);
            ExactlyOne nea = new ExactlyOne();
            n.addPolicyComponent(nea);
            All na = new All();
            nea.addPolicyComponent(na);
            na.addPolicyComponents(alternative);
View Full Code Here

Examples of org.apache.neethi.Assertion

                    "Policy doesn't contain any policy alternatives");
        }

        List assertionList = (List) iterator.next();

        Assertion assertion;
        String namespaceURI;

        List moduleList;

        List namespaceList = new ArrayList();
        List modulesToEngage = new ArrayList();

        for (Iterator assertions = assertionList.iterator(); assertions
                .hasNext();) {
            assertion = (Assertion) assertions.next();
            namespaceURI = assertion.getName().getNamespaceURI();

            moduleList = configuration
                    .getModulesForPolicyNamesapce(namespaceURI);

            if (moduleList == null) {
                log.debug("can't find any module to process "
                        + assertion.getName() + " type assertions");
                continue;
            }

            if (!canSupportAssertion(assertion, moduleList)) {
                throw new AxisFault("atleast one module can't support "
                        + assertion.getName());
            }

            if (!namespaceList.contains(namespaceURI)) {
                namespaceList.add(namespaceURI);
                modulesToEngage.addAll(moduleList);
View Full Code Here

Examples of org.apache.neethi.Assertion

                        "Policy doesn't contain any policy alternatives");
            }

            List assertionList = (List) iterator.next();

            Assertion assertion;
            String namespaceURI;

            List moduleList;

            List namespaceList = new ArrayList();
            List modulesToEngage = new ArrayList();

            for (Iterator assertions = assertionList.iterator(); assertions
                    .hasNext();) {
                assertion = (Assertion) assertions.next();
                namespaceURI = assertion.getName().getNamespaceURI();

                moduleList = configuration
                        .getModulesForPolicyNamesapce(namespaceURI);

                if (moduleList == null) {
                    log.debug("can't find any module to process "
                            + assertion.getName() + " type assertions");
                    continue;
                }

                if (!canSupportAssertion(assertion, moduleList)) {
                    throw new AxisFault("atleast one module can't support "
                            + assertion.getName());
                }

                if (!namespaceList.contains(namespaceURI)) {
                    namespaceList.add(namespaceURI);
                    modulesToEngage.addAll(moduleList);
View Full Code Here

Examples of org.apache.neethi.Assertion

    Collection<Assertion> getAssertions(PolicyComponent pc, boolean includeOptional) {
   
        Collection<Assertion> assertions = new ArrayList<Assertion>();
   
        if (Constants.TYPE_ASSERTION == pc.getType()) {
            Assertion a = (Assertion)pc;
            if (includeOptional || !a.isOptional()) {
                assertions.add(a);
            }
        } else {  
            addAssertions(pc, includeOptional, assertions);
        }
View Full Code Here

Examples of org.apache.neethi.Assertion

    void addAssertions(PolicyComponent pc, boolean includeOptional,
                       Collection<Assertion> assertions) {
  
        if (Constants.TYPE_ASSERTION == pc.getType()) {
            Assertion a = (Assertion)pc;
            if (includeOptional || !a.isOptional()) {
                assertions.add((Assertion)pc);           
            }
            return;
        }
   
View Full Code Here

Examples of org.apache.neethi.Assertion

        PolicyInterceptorProviderRegistry pipr =
            bus.getExtension(PolicyInterceptorProviderRegistry.class);
        final boolean doLog = LOG.isLoggable(Level.FINE);
        for (PolicyComponent pc : alternative) {
            if (pc instanceof Assertion) {
                Assertion a = (Assertion)pc;
                if (!(a.isOptional()
                    || !pipr.get(a.getName()).isEmpty()
                    || (null != assertor && assertor.canAssert(a.getName())))) {
               
                    if (doLog) {
                        LOG.fine("Alternative " + a.getName() + " is not supported");
                    }
                    return false;
                }
            } else {
                return false;
View Full Code Here

Examples of org.apache.neethi.Assertion

                Policy p = new Policy();
                ExactlyOne ea = new ExactlyOne();
                p.addPolicyComponent(ea);
                All all = new All();
                Assertion ass = NegotiationUtils.getAddressingPolicy(aim, false);
                all.addPolicyComponent(ass);
                ea.addPolicyComponent(all);
               
                //setup endpoint and forward to it.
                unmapSecurityProps(message);
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.