1/*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.xml.internal.ws.api.handler;
27
28import com.sun.istack.internal.Nullable;
29import com.sun.xml.internal.ws.api.WSBinding;
30import com.sun.xml.internal.ws.api.message.Message;
31import com.sun.xml.internal.ws.api.model.SEIModel;
32import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
33
34import javax.xml.ws.handler.MessageContext;
35import java.util.Set;
36
37/**
38 * The <code>MessageHandlerContext</code> interface extends
39 * <code>MessageContext</code> to provide easy access to the contained message.
40 *
41 * This context provides access to RI's <code>Message</code> model for efficient access
42 * to various things like accessing headers etc. It also provides access to
43 * binding information as <code>WSBinding</code>.
44 *
45 * @author Rama Pulavarthi
46 * @since JAX-WS 2.1.3
47 */
48public interface MessageHandlerContext extends MessageContext {
49    /**
50     * Gets the message from this message context
51     *
52     * @return The contained message; returns <code>null</code> if no
53     *         message is present in this message context
54     */
55    public Message getMessage();
56
57
58    /**
59     * Sets the message in this message context
60     */
61    public void setMessage(Message message);
62
63    /**
64     * @see javax.xml.ws.handler.soap.SOAPMessageContext#getRoles()
65     */
66     public Set<String> getRoles();
67
68
69    /**
70     * Provides access to <code>WSBinding</code> which can be used in various ways.
71     * for example: <code>WSBinding#getSOAPVersion</code> to get SOAP version of the binding.
72     *              <code>WSBinding#isFeatureEnabled(AddressingFeature)</code> to check if addressing is enabled
73     */
74    public WSBinding getWSBinding();
75
76    /**
77     * Provides access to <code>SEIModel</code>.
78     */
79    public @Nullable SEIModel getSEIModel();
80
81    /**
82     * Gets the {@link WSDLPort} that represents the port.
83     * @return
84     *      returns the WSDLModel of the port that the client/endpoint binds to.
85     *      null when the Service is not configured with WSDL information.
86     */
87    public @Nullable WSDLPort getPort();
88
89}
90