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.binding.soap.interceptor;
19:
20: import java.net.URI;
21: import java.util.Collections;
22: import java.util.Set;
23:
24: import javax.xml.namespace.QName;
25: import javax.xml.stream.XMLStreamException;
26: import javax.xml.stream.XMLStreamWriter;
27:
28: import org.apache.cxf.binding.soap.SoapMessage;
29: import org.apache.cxf.phase.AbstractPhaseInterceptor;
30: import org.apache.cxf.staxutils.StaxUtils;
31:
32: public abstract class AbstractSoapInterceptor extends
33: AbstractPhaseInterceptor<SoapMessage> implements
34: SoapInterceptor {
35:
36: /**
37: * @deprecated
38: */
39: public AbstractSoapInterceptor() {
40: super (null);
41: }
42:
43: public AbstractSoapInterceptor(String p) {
44: super (p);
45: }
46:
47: public AbstractSoapInterceptor(String i, String p) {
48: super (i, p);
49: }
50:
51: protected boolean isRequestor(org.apache.cxf.message.Message message) {
52: return Boolean.TRUE
53: .equals(message
54: .containsKey(org.apache.cxf.message.Message.REQUESTOR_ROLE));
55: }
56:
57: public Set<URI> getRoles() {
58: return Collections.emptySet();
59: }
60:
61: public Set<QName> getUnderstoodHeaders() {
62: return Collections.emptySet();
63: }
64:
65: protected String getFaultCodePrefix(XMLStreamWriter writer,
66: QName faultCode) throws XMLStreamException {
67: String codeNs = faultCode.getNamespaceURI();
68: String prefix = null;
69: if (codeNs.length() > 0) {
70: prefix = StaxUtils.getUniquePrefix(writer, codeNs, true);
71: }
72: return prefix;
73: }
74: }
|