This project has retired. For details please refer to its
Attic page.
WssMUTube xref
1/*2 * Licensed to the Apache Software Foundation (ASF) under one3 * or more contributor license agreements. See the NOTICE file4 * distributed with this work for additional information5 * regarding copyright ownership. The ASF licenses this file6 * to you under the Apache License, Version 2.0 (the7 * "License"); you may not use this file except in compliance8 * with the License. You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing,13 * software distributed under the License is distributed on an14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15 * KIND, either express or implied. See the License for the16 * specific language governing permissions and limitations17 * under the License.18 */19package org.apache.chemistry.opencmis.commons.impl.tube.client;
2021import javax.xml.namespace.QName;
2223import org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException;
24import org.apache.chemistry.opencmis.commons.impl.tube.AbstractWssTube;
2526import com.sun.xml.ws.api.SOAPVersion;
27import com.sun.xml.ws.api.WSBinding;
28import com.sun.xml.ws.api.message.Header;
29import com.sun.xml.ws.api.message.HeaderList;
30import com.sun.xml.ws.api.message.Packet;
31import com.sun.xml.ws.api.pipe.NextAction;
32import com.sun.xml.ws.api.pipe.Tube;
33import com.sun.xml.ws.api.pipe.TubeCloner;
3435publicclassWssMUTubeextendsAbstractWssTube {
3637privatefinal SOAPVersion soapVersion;
3839publicWssMUTube(WSBinding binding, Tube next) {
40super(next);
41 soapVersion = binding.getSOAPVersion();
42 }
4344protectedWssMUTube(WssMUTube that, TubeCloner cloner) {
45super(that, cloner);
46 soapVersion = that.soapVersion;
47 }
4849publicWssMUTube copy(TubeCloner cloner) {
50returnnewWssMUTube(this, cloner);
51 }
5253 @Override
54public NextAction processResponse(Packet response) {
55if (response.getMessage() == null) {
56returnsuper.processResponse(response);
57 }
5859 HeaderList headers = response.getMessage().getHeaders();
6061for (int i = 0; i < headers.size(); i++) {
62if (!headers.isUnderstood(i)) {
63 Header header = headers.get(i);
64if (!header.isIgnorable(soapVersion, soapVersion.implicitRoleSet)) {
65 QName qName = new QName(header.getNamespaceURI(), header.getLocalPart());
66if (WSSE.equals(qName)) {
67 checkSecurityHeader(header);
68 } else {
69thrownew CmisConnectionException("MustUnderstand header is not understood: " + qName);
70 }
71 }
72 }
73 }
7475returnsuper.processResponse(response);
76 }
7778privatevoid checkSecurityHeader(Header header) {
79// TODO80 }
81 }