Package org.apache.neethi

Examples of org.apache.neethi.ExactlyOne


        if (assertions.size() <= 1) {
            return;
        }
       
        Policy p = new Policy();
        ExactlyOne alternatives = new ExactlyOne();
        p.addPolicyComponent(alternatives);
        for (Object a : assertions) {
            alternatives.addPolicyComponents(((ExactlyOne)a).getPolicyComponents());
        }
        setPolicy(p);       
    }
View Full Code Here


        if (tokentype == null) {
            tokentype = namespace + "/RSTR/Status";
        }

        Policy validatePolicy = new Policy();
        ExactlyOne one = new ExactlyOne();
        validatePolicy.addPolicyComponent(one);
        All all = new All();
        one.addPolicyComponent(all);
        all.addAssertion(getAddressingAssertion());

        client.getRequestContext().clear();
        client.getRequestContext().putAll(ctx);
        client.getRequestContext().put(SecurityConstants.TOKEN, tok);
View Full Code Here

        if (boi == null) {
            attachTokenDirectly = false;
            boi = findOperation("/RST/Issue");
           
            Policy cancelPolicy = new Policy();
            ExactlyOne one = new ExactlyOne();
            cancelPolicy.addPolicyComponent(one);
            All all = new All();
            one.addPolicyComponent(all);
            all.addAssertion(getAddressingAssertion());
           
            PolicyBuilder pbuilder = bus.getExtension(PolicyBuilder.class);
            SymmetricBinding binding = new SymmetricBinding(pbuilder);
            all.addAssertion(binding);
View Full Code Here

    }
   
   
    public Policy getPolicy() {
        Policy p = new Policy();
        ExactlyOne ea = new ExactlyOne();
        p.addPolicyComponent(ea);
        All all = new All();

        for (Token token : getTokens()) {
            all.addPolicyComponent(token);
        }
       
        if (signedParts != null) {
            all.addPolicyComponent(signedParts);
        } else if (signedElements != null) {
            all.addPolicyComponent(signedElements);
        } else if (encryptedParts != null) {
            all.addPolicyComponent(encryptedParts);
        } else if (encryptedElements != null) {
            all.addPolicyComponent(encryptedElements);
        }       
       
        ea.addPolicyComponent(all);
        Policy pc = p.normalize(builder.getPolicyRegistry(), true);
        if (pc != null) {
            return pc;
        } else {
            return new Policy();
View Full Code Here

    public PolicyComponent normalize() {
        return this;
    }
    public Policy getPolicy() {
        Policy p = new Policy();
        ExactlyOne ea = new ExactlyOne();
        p.addPolicyComponent(ea);
        All all = new All();
       
        /*
        asymmetricBinding.setAlgorithmSuite(algorithmSuite);
        asymmetricBinding.setProtectionOrder(getProtectionOrder());
        asymmetricBinding.setSignatureProtection(isSignatureProtection());
        asymmetricBinding.setSignedEndorsingSupportingTokens(getSignedEndorsingSupportingTokens());
        asymmetricBinding.setTokenProtection(isTokenProtection());
        */
        if (getInitiatorToken() != null) {
            all.addPolicyComponent(getInitiatorToken());
        }
        if (getInitiatorSignatureToken() != null) {
            all.addPolicyComponent(getInitiatorSignatureToken());
        }
        if (getInitiatorEncryptionToken() != null) {
            all.addPolicyComponent(getInitiatorEncryptionToken());
        }
        if (getRecipientToken() != null) {
            all.addPolicyComponent(getRecipientToken());
        }
        if (getRecipientSignatureToken() != null) {
            all.addPolicyComponent(getRecipientSignatureToken());
        }
        if (getRecipientEncryptionToken() != null) {
            all.addPolicyComponent(getRecipientEncryptionToken());
        }
        /*
        if (isEntireHeadersAndBodySignatures()) {
            all.addPolicyComponent(new PrimitiveAssertion(SP12Constants.ONLY_SIGN_ENTIRE_HEADERS_AND_BODY));
        }
        */
        if (isIncludeTimestamp()) {
            all.addPolicyComponent(SP12Constants.INCLUDE_TIMESTAMP_ASSERTION);
        }
        if (getLayout() != null) {
            all.addPolicyComponent(getLayout());
        }
        ea.addPolicyComponent(all);
        Policy pc = p.normalize(builder.getPolicyRegistry(), true);
        if (pc != null) {
            return pc;
        } else {
            return new Policy();
View Full Code Here

        return all;
    }

    public Policy getPolicy() {
        Policy p = new Policy();
        ExactlyOne ea = new ExactlyOne();
        p.addPolicyComponent(ea);
        All all = new All();
       
        if (this.getProtectionToken() != null) {
            all.addPolicyComponent(this.getProtectionToken());
        }
        if (this.getSignatureToken() != null) {
            all.addPolicyComponent(this.getSignatureToken());
        }
        if (this.getEncryptionToken() != null) {
            all.addPolicyComponent(this.getEncryptionToken());
        }
        if (isIncludeTimestamp()) {
            all.addPolicyComponent(SP12Constants.INCLUDE_TIMESTAMP_ASSERTION);
        }
        if (getLayout() != null) {
            all.addPolicyComponent(getLayout());
        }

       
        ea.addPolicyComponent(all);
        Policy pc = p.normalize(builder.getPolicyRegistry(), true);
        if (pc != null) {
            return pc;
        } else {
            return new Policy();
View Full Code Here

    }
   
    public Policy getPolicy() {
        if (token != null) {
            Policy p = new Policy();
            ExactlyOne ea = new ExactlyOne();
            p.addPolicyComponent(ea);
            All all = new All();
            all.addPolicyComponent(token);
            ea.addPolicyComponent(all);
            Policy pc = p.normalize(builder.getPolicyRegistry(), true);
            if (pc != null) {
                return pc;
            } else {
                return new Policy();
View Full Code Here

    public PolicyComponent normalize() {
        return this;
    }
    public Policy getPolicy() {
        Policy p = new Policy();
        ExactlyOne ea = new ExactlyOne();
        p.addPolicyComponent(ea);
        All all = new All();
        if (transportToken != null) {
            all.addPolicyComponent(transportToken);
        }
        if (isIncludeTimestamp()) {
            all.addPolicyComponent(SP12Constants.INCLUDE_TIMESTAMP_ASSERTION);
        }
        if (getLayout() != null) {
            all.addPolicyComponent(getLayout());
        }
        ea.addPolicyComponent(all);
        Policy pc = p.normalize(builder.getPolicyRegistry(), true);
        if (pc != null) {
            return pc;
        } else {
            return new Policy();
View Full Code Here

                && s.contains("/RST/Issue")
                && (s.startsWith(STSUtils.WST_NS_05_02)
                    || s.startsWith(STSUtils.WST_NS_05_12))) {

                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);
                String ns = STSUtils.WST_NS_05_12;
                if (s.startsWith(STSUtils.WST_NS_05_02)) {
View Full Code Here

        client.setTrust(NegotiationUtils.getTrust10(aim));
        client.setTrust(NegotiationUtils.getTrust13(aim));
        Policy pol = itok.getBootstrapPolicy();
        Policy p = new Policy();
        ExactlyOne ea = new ExactlyOne();
        p.addPolicyComponent(ea);
        All all = new All();
        all.addPolicyComponent(NegotiationUtils.getAddressingPolicy(aim, false));
        ea.addPolicyComponent(all);
       
        if (endorse) {
            SupportingToken st = new SupportingToken(SupportTokenType.SUPPORTING_TOKEN_ENDORSING,
                                                     SP12Constants.INSTANCE,
                                                     message.getExchange()
View Full Code Here

TOP

Related Classes of org.apache.neethi.ExactlyOne

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.