01: /*
02: * SecurityElement.java
03: *
04: * Created on August 1, 2006, 2:43 PM
05: *
06: * To change this template, choose Tools | Template Manager
07: * and open the template in the editor.
08: */
09:
10: package com.sun.xml.ws.security.opt.api;
11:
12: import javax.xml.stream.XMLStreamException;
13: import javax.xml.stream.XMLStreamReader;
14:
15: /**
16: *
17: * @author K.Venugopal@sun.com
18: */
19: public interface SecurityElement {
20: /**
21: *
22: * @return id
23: */
24: String getId();
25:
26: /**
27: *
28: * @param id
29: */
30: void setId(final String id);
31:
32: /**
33: *
34: * @return namespace uri of the security header element.
35: */
36: String getNamespaceURI();
37:
38: /**
39: * Gets the local name of this header element.
40: *
41: * @return
42: * this string must be interned.
43: */
44: String getLocalPart();
45:
46: /**
47: * Reads the header as a {@link XMLStreamReader}.
48: *
49: * <p>
50: * The returned parser points at the start element of this header.
51: * (IOW, {@link XMLStreamReader#getEventType()} would return
52: * {@link XMLStreamReader#START_ELEMENT}.
53: *
54: * <h3>Performance Expectation</h3>
55: * <p>
56: * For some {@link Header} implementations, this operation
57: * is a non-trivial operation. Therefore, use of this method
58: * is discouraged unless the caller is interested in reading
59: * the whole header.
60: *
61: * <p>
62: * Similarly, if the caller wants to use this method only to do
63: * the API conversion (such as simply firing SAX events from
64: * {@link XMLStreamReader}), then the JAX-WS team requests
65: * that you talk to us.
66: *
67: * <p>
68: * {@link Message}s that come from tranport usually provides
69: * a reasonably efficient implementation of this method.
70: *
71: * @return must not null.
72: * @throws javax.xml.stream.XMLStreamException
73: */
74: XMLStreamReader readHeader() throws XMLStreamException;
75:
76: }
|