From commits-return-32805-apmail-cxf-commits-archive=cxf.apache.org@cxf.apache.org Fri Jun 27 01:54:41 2014 Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CB06711BB5 for ; Fri, 27 Jun 2014 01:54:41 +0000 (UTC) Received: (qmail 8738 invoked by uid 500); 27 Jun 2014 01:54:41 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 8677 invoked by uid 500); 27 Jun 2014 01:54:41 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 8664 invoked by uid 99); 27 Jun 2014 01:54:41 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jun 2014 01:54:41 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 64341918C11; Fri, 27 Jun 2014 01:54:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dsosnoski@apache.org To: commits@cxf.apache.org Message-Id: <8321d5b41e4542978633f6719e454a63@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: Add WS-MakeConnection 1.1 basic policy handling; fix WS-I RSP policy handling. Date: Fri, 27 Jun 2014 01:54:41 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/master a1157adaf -> e0a449ec7 Add WS-MakeConnection 1.1 basic policy handling; fix WS-I RSP policy handling. Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e0a449ec Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e0a449ec Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e0a449ec Branch: refs/heads/master Commit: e0a449ec78e933b8edbb5cc78d028a2cc6111cb2 Parents: a1157ad Author: dsosnoski Authored: Fri Jun 27 12:52:07 2014 +1200 Committer: dsosnoski Committed: Fri Jun 27 12:55:54 2014 +1200 ---------------------------------------------------------------------- rt/ws/rm/pom.xml | 8 +++ rt/ws/rm/src/main/build-resources/catalog.cat | 1 + .../cxf/ws/rm/policy/MC11AssertionBuilder.java | 64 ++++++++++++++++++++ .../cxf/ws/rm/policy/MC11PolicyLoader.java | 64 ++++++++++++++++++++ .../rm/policy/RMPolicyInterceptorProvider.java | 9 ++- .../cxf/ws/rm/policy/RSPPolicyLoader.java | 63 +++++++++++++++++++ .../resources/META-INF/cxf/bus-extensions.txt | 3 +- .../main/resources/schemas/wsdl/wsmc-1.1.xjb | 36 +++++++++++ .../main/resources/schemas/wsdl/wsmc-1.1.xsd | 37 +++++++++++ 9 files changed, 281 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/e0a449ec/rt/ws/rm/pom.xml ---------------------------------------------------------------------- diff --git a/rt/ws/rm/pom.xml b/rt/ws/rm/pom.xml index ca33bf8..70d122d 100644 --- a/rt/ws/rm/pom.xml +++ b/rt/ws/rm/pom.xml @@ -171,6 +171,14 @@ + ${basedir}/src/main/resources/schemas/wsdl/wsmc-1.1.xsd + ${basedir}/src/main/resources/schemas/wsdl/wsmc-1.1.xjb + ${basedir}/src/main/build-resources/catalog.cat + + ${basedir}/target/generated/src/main/java/org/apache/cxf/ws/addressing + + + ${basedir}/src/main/resources/schemas/configuration/wsrm-manager-types.xsd ${basedir}/src/main/resources/schemas/configuration/wsrm-policy.xjb ${basedir}/src/main/build-resources/catalog.cat http://git-wip-us.apache.org/repos/asf/cxf/blob/e0a449ec/rt/ws/rm/src/main/build-resources/catalog.cat ---------------------------------------------------------------------- diff --git a/rt/ws/rm/src/main/build-resources/catalog.cat b/rt/ws/rm/src/main/build-resources/catalog.cat index 19d8362..9ac8f34 100644 --- a/rt/ws/rm/src/main/build-resources/catalog.cat +++ b/rt/ws/rm/src/main/build-resources/catalog.cat @@ -23,6 +23,7 @@ SYSTEM "http://schemas.xmlsoap.org/ws/2004/08/addressing" "../../../../../../cor SYSTEM "http://www.w3.org/2006/03/addressing/ws-addr.xsd" "../../../../../../core/src/main/resources/schemas/wsdl/ws-addr.xsd" SYSTEM "http://docs.oasis-open.org/ws-rx/wsrm/200702" "../resources/schemas/wsdl/wsrm-1.1.xsd" +SYSTEM "http://docs.oasis-open.org/ws-rx/wsmc/200702" "../resources/schemas/wsdl/wsmc-1.1.xsd" SYSTEM "http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd" "../resources/schemas/configuration/wsrm-policy.xsd" SYSTEM "http://docs.oasis-open.org/ws-rx/wsrmp/200702" "../resources/schemas/configuration/wsrmp-1.1-schema-200702.xsd" http://git-wip-us.apache.org/repos/asf/cxf/blob/e0a449ec/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/MC11AssertionBuilder.java ---------------------------------------------------------------------- diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/MC11AssertionBuilder.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/MC11AssertionBuilder.java new file mode 100644 index 0000000..37a5982 --- /dev/null +++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/MC11AssertionBuilder.java @@ -0,0 +1,64 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.ws.rm.policy; + +import javax.xml.namespace.QName; + +import org.w3c.dom.Element; + +import org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertion; +import org.apache.neethi.Assertion; +import org.apache.neethi.AssertionBuilderFactory; +import org.apache.neethi.builders.AssertionBuilder; +import org.apache.neethi.builders.xml.XMLPrimitiveAssertionBuilder; + +/** + * Builds a WS-MakeConnection MCSupported assertion. + */ +public class MC11AssertionBuilder implements AssertionBuilder { + + public static final String MCSUPPORTED_NAME = "MCSupported"; + public static final String WSMC_NAMESPACE = "http://docs.oasis-open.org/ws-rx/wsmc/200702"; + public static final QName MCSUPPORTED_QNAME = new QName(WSMC_NAMESPACE, MCSUPPORTED_NAME); + + public static final QName[] KNOWN_ELEMENTS = { + MCSUPPORTED_QNAME + }; + + /** + * @see org.apache.neethi.builders.AssertionBuilder#getKnownElements() + */ + public QName[] getKnownElements() { + return KNOWN_ELEMENTS; + } + + /** + * @see org.apache.neethi.builders.AssertionBuilder#build(org.w3c.dom.Element, + * org.apache.neethi.AssertionBuilderFactory) + */ + public Assertion build(Element elem, AssertionBuilderFactory factory) throws IllegalArgumentException { + Assertion assertion = null; + if (WSMC_NAMESPACE.equals(elem.getNamespaceURI()) && MCSUPPORTED_NAME.equals(elem.getLocalName())) { + boolean optional = XMLPrimitiveAssertionBuilder.isOptional(elem); + assertion = new PrimitiveAssertion(MCSUPPORTED_QNAME, optional); + } + return assertion; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf/blob/e0a449ec/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/MC11PolicyLoader.java ---------------------------------------------------------------------- diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/MC11PolicyLoader.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/MC11PolicyLoader.java new file mode 100644 index 0000000..b134ce1 --- /dev/null +++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/MC11PolicyLoader.java @@ -0,0 +1,64 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.ws.rm.policy; + +import org.apache.cxf.Bus; +import org.apache.cxf.common.injection.NoJSR250Annotations; +import org.apache.cxf.ws.policy.AssertionBuilderLoader; +import org.apache.cxf.ws.policy.AssertionBuilderRegistry; +import org.apache.cxf.ws.policy.PolicyInterceptorProviderLoader; +import org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry; + +/** + * Policy loader for WS-MakeConnection MCSupported assertion. This provides the hooks for Neethi to handle the + * assertion. + */ +@NoJSR250Annotations +public final class MC11PolicyLoader implements PolicyInterceptorProviderLoader, AssertionBuilderLoader { + Bus bus; + + public MC11PolicyLoader(Bus b) { + bus = b; + registerBuilders(); + try { + registerProviders(); + } catch (Throwable t) { + // We'll ignore this as the policy framework will then not find the providers and error out at + // that point. If nothing uses WS-MakeConnection no warnings/errors will display + } + } + + public void registerBuilders() { + AssertionBuilderRegistry reg = bus.getExtension(AssertionBuilderRegistry.class); + if (reg == null) { + return; + } + reg.registerBuilder(new MC11AssertionBuilder()); + } + + public void registerProviders() { + //interceptor provider for the policy + PolicyInterceptorProviderRegistry reg = bus.getExtension(PolicyInterceptorProviderRegistry.class); + if (reg == null) { + return; + } + reg.register(new RMPolicyInterceptorProvider(bus)); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf/blob/e0a449ec/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyInterceptorProvider.java ---------------------------------------------------------------------- diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyInterceptorProvider.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyInterceptorProvider.java index 76bfae4..45e0a0a 100644 --- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyInterceptorProvider.java +++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyInterceptorProvider.java @@ -25,6 +25,8 @@ import javax.xml.namespace.QName; import org.apache.cxf.Bus; import org.apache.cxf.ws.policy.AbstractPolicyInterceptorProvider; +import org.apache.cxf.ws.rm.RM10Constants; +import org.apache.cxf.ws.rm.RM11Constants; import org.apache.cxf.ws.rm.RMCaptureOutInterceptor; import org.apache.cxf.ws.rm.RMDeliveryInterceptor; import org.apache.cxf.ws.rm.RMInInterceptor; @@ -45,9 +47,10 @@ public class RMPolicyInterceptorProvider extends AbstractPolicyInterceptorProvid static { Collection types = new ArrayList(); - types.add(new QName("http://schemas.xmlsoap.org/ws/2005/02/rm/policy", "RMAssertion")); - types.add(new QName("http://docs.oasis-open.org/ws-rx/wsrmp/200702", "RMAssertion")); - types.add(new QName("http://ws-i.org/profiles/rsp/1.0/", "Conformant")); + types.add(RM10Constants.WSRMP_RMASSERTION_QNAME); + types.add(RM11Constants.WSRMP_RMASSERTION_QNAME); + types.add(MC11AssertionBuilder.MCSUPPORTED_QNAME); + types.add(RSPAssertionBuilder.CONFORMANT_QNAME); ASSERTION_TYPES = types; } http://git-wip-us.apache.org/repos/asf/cxf/blob/e0a449ec/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RSPPolicyLoader.java ---------------------------------------------------------------------- diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RSPPolicyLoader.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RSPPolicyLoader.java new file mode 100644 index 0000000..c9d4578 --- /dev/null +++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RSPPolicyLoader.java @@ -0,0 +1,63 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.ws.rm.policy; + +import org.apache.cxf.Bus; +import org.apache.cxf.common.injection.NoJSR250Annotations; +import org.apache.cxf.ws.policy.AssertionBuilderLoader; +import org.apache.cxf.ws.policy.AssertionBuilderRegistry; +import org.apache.cxf.ws.policy.PolicyInterceptorProviderLoader; +import org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry; + +/** + * Policy loader for WS-I RSP assertion. This provides the hooks for Neethi to handle the assertion. + */ +@NoJSR250Annotations +public final class RSPPolicyLoader implements PolicyInterceptorProviderLoader, AssertionBuilderLoader { + Bus bus; + + public RSPPolicyLoader(Bus b) { + bus = b; + registerBuilders(); + try { + registerProviders(); + } catch (Throwable t) { + // We'll ignore this as the policy framework will then not find the providers and error out at + // that point. If nothing uses WS-I RSP no warnings/errors will display + } + } + + public void registerBuilders() { + AssertionBuilderRegistry reg = bus.getExtension(AssertionBuilderRegistry.class); + if (reg == null) { + return; + } + reg.registerBuilder(new RSPAssertionBuilder()); + } + + public void registerProviders() { + //interceptor provider for the policy + PolicyInterceptorProviderRegistry reg = bus.getExtension(PolicyInterceptorProviderRegistry.class); + if (reg == null) { + return; + } + reg.register(new RMPolicyInterceptorProvider(bus)); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf/blob/e0a449ec/rt/ws/rm/src/main/resources/META-INF/cxf/bus-extensions.txt ---------------------------------------------------------------------- diff --git a/rt/ws/rm/src/main/resources/META-INF/cxf/bus-extensions.txt b/rt/ws/rm/src/main/resources/META-INF/cxf/bus-extensions.txt index b2a2198..44e050f 100644 --- a/rt/ws/rm/src/main/resources/META-INF/cxf/bus-extensions.txt +++ b/rt/ws/rm/src/main/resources/META-INF/cxf/bus-extensions.txt @@ -3,4 +3,5 @@ org.apache.cxf.ws.rm.policy.RMPolicyInterceptorProvider::true:true org.apache.cxf.ws.rm.policy.RM10AssertionBuilder::true:true org.apache.cxf.ws.rm.policy.RM12AssertionBuilder::true:true org.apache.cxf.ws.rm.policy.WSRMP12PolicyLoader::true:true - +org.apache.cxf.ws.rm.policy.MC11PolicyLoader::true:true +org.apache.cxf.ws.rm.policy.RSPPolicyLoader::true:true http://git-wip-us.apache.org/repos/asf/cxf/blob/e0a449ec/rt/ws/rm/src/main/resources/schemas/wsdl/wsmc-1.1.xjb ---------------------------------------------------------------------- diff --git a/rt/ws/rm/src/main/resources/schemas/wsdl/wsmc-1.1.xjb b/rt/ws/rm/src/main/resources/schemas/wsdl/wsmc-1.1.xjb new file mode 100644 index 0000000..9dbbea4 --- /dev/null +++ b/rt/ws/rm/src/main/resources/schemas/wsdl/wsmc-1.1.xjb @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/cxf/blob/e0a449ec/rt/ws/rm/src/main/resources/schemas/wsdl/wsmc-1.1.xsd ---------------------------------------------------------------------- diff --git a/rt/ws/rm/src/main/resources/schemas/wsdl/wsmc-1.1.xsd b/rt/ws/rm/src/main/resources/schemas/wsdl/wsmc-1.1.xsd new file mode 100644 index 0000000..92a830c --- /dev/null +++ b/rt/ws/rm/src/main/resources/schemas/wsdl/wsmc-1.1.xsd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +