01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.ws.addressing.policy;
19:
20: import java.util.ArrayList;
21: import java.util.Collection;
22:
23: import javax.xml.namespace.QName;
24:
25: import org.apache.cxf.interceptor.AbstractAttributedInterceptorProvider;
26: import org.apache.cxf.ws.addressing.MAPAggregator;
27: import org.apache.cxf.ws.addressing.soap.MAPCodec;
28: import org.apache.cxf.ws.policy.PolicyInterceptorProvider;
29:
30: /**
31: * Instead of parametrising an instance of org.apache.cxf.policy.PolicyInterceptorProviderImpl
32: * we use this class to reduce the impact of changes to the addressing metadata namespace
33: * (only need to update Metadataconstants, otherwise cfg file fragement also).
34: */
35: public class AddressingPolicyInterceptorProvider extends
36: AbstractAttributedInterceptorProvider implements
37: PolicyInterceptorProvider {
38:
39: private static final Collection<QName> ASSERTION_TYPES;
40: private static final MAPAggregator MAP_AGGREGATOR = new MAPAggregator();
41: private static final MAPCodec MAP_CODEC = new MAPCodec();
42:
43: static {
44: Collection<QName> types = new ArrayList<QName>();
45: types.add(MetadataConstants.ADDRESSING_ASSERTION_QNAME);
46: types.add(MetadataConstants.ANON_RESPONSES_ASSERTION_QNAME);
47: types.add(MetadataConstants.NON_ANON_RESPONSES_ASSERTION_QNAME);
48: types.add(MetadataConstants.USING_ADDRESSING_2004_QNAME);
49: types.add(MetadataConstants.USING_ADDRESSING_2005_QNAME);
50: types.add(MetadataConstants.USING_ADDRESSING_2006_QNAME);
51: ASSERTION_TYPES = types;
52: }
53:
54: public AddressingPolicyInterceptorProvider() {
55: super ();
56: getInInterceptors().add(MAP_AGGREGATOR);
57: getInInterceptors().add(MAP_CODEC);
58:
59: getOutInterceptors().add(MAP_AGGREGATOR);
60: getOutInterceptors().add(MAP_CODEC);
61:
62: getInFaultInterceptors().add(MAP_AGGREGATOR);
63: getInFaultInterceptors().add(MAP_CODEC);
64:
65: getOutFaultInterceptors().add(MAP_AGGREGATOR);
66: getOutFaultInterceptors().add(MAP_CODEC);
67: }
68:
69: public Collection<QName> getAssertionTypes() {
70: return ASSERTION_TYPES;
71: }
72: }
|