001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017 package org.apache.servicemix.soap.ws.security;
018
019 import java.net.URI;
020 import java.util.Arrays;
021 import java.util.Collection;
022 import java.util.Collections;
023
024 import javax.xml.namespace.QName;
025
026 import org.apache.servicemix.soap.api.Message;
027 import org.apache.servicemix.soap.bindings.soap.SoapInterceptor;
028 import org.apache.servicemix.soap.core.AbstractInterceptor;
029 //import org.apache.ws.security.WSConstants;
030
031 public class WsSecurityInInterceptor extends AbstractInterceptor implements SoapInterceptor {
032
033 public static QName[] HEADERS = {
034 /*
035 new QName(WSConstants.WSSE_NS, WSConstants.WSSE_LN),
036 new QName(WSConstants.WSSE11_NS, WSConstants.WSSE_LN),
037 */
038 };
039
040 private final WsSecurityPolicy policy;
041
042 public WsSecurityInInterceptor(WsSecurityPolicy policy) {
043 this.policy = policy;
044 }
045
046 public void handleMessage(Message message) {
047 boolean required = policy.isRequired();
048 // TODO
049 }
050
051 public Collection<QName> getUnderstoodHeaders() {
052 return Arrays.asList(HEADERS);
053 }
054
055 public Collection<URI> getRoles() {
056 return Collections.emptyList();
057 }
058
059 }