1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.student.common.ws.handler; |
17 |
|
|
18 |
|
import java.io.PrintStream; |
19 |
|
import java.util.Set; |
20 |
|
|
21 |
|
import javax.xml.namespace.QName; |
22 |
|
import javax.xml.ws.handler.MessageContext; |
23 |
|
import javax.xml.ws.handler.soap.SOAPHandler; |
24 |
|
import javax.xml.ws.handler.soap.SOAPMessageContext; |
25 |
|
|
26 |
|
import org.apache.log4j.Logger; |
27 |
|
|
|
|
| 0% |
Uncovered Elements: 28 (28) |
Complexity: 10 |
Complexity Density: 0.56 |
|
28 |
|
public class DebugHandler implements SOAPHandler<SOAPMessageContext> { |
29 |
|
|
30 |
|
final Logger logger = Logger.getLogger(DebugHandler.class); |
31 |
|
|
32 |
|
private PrintStream err; |
33 |
|
private PrintStream out; |
34 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
35 |
0
|
public DebugHandler() {... |
36 |
0
|
this(System.out, System.err); |
37 |
|
} |
38 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
39 |
0
|
public DebugHandler(PrintStream ps) {... |
40 |
0
|
this(ps, ps); |
41 |
|
} |
42 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
43 |
0
|
public DebugHandler(PrintStream out, PrintStream err) {... |
44 |
0
|
this.out = out; |
45 |
0
|
this.err = err; |
46 |
|
} |
47 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
48 |
0
|
@Override... |
49 |
|
public Set<QName> getHeaders() { |
50 |
|
|
51 |
0
|
return null; |
52 |
|
} |
53 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
54 |
0
|
@Override... |
55 |
|
public void close(MessageContext context) { |
56 |
|
|
57 |
|
} |
58 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
59 |
0
|
@Override... |
60 |
|
public boolean handleFault(SOAPMessageContext context) { |
61 |
0
|
return this.printMessage(context, this.err); |
62 |
|
} |
63 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
64 |
0
|
@Override... |
65 |
|
public boolean handleMessage(SOAPMessageContext context) { |
66 |
0
|
return this.printMessage(context, this.out); |
67 |
|
} |
68 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 3 |
Complexity Density: 0.27 |
|
69 |
0
|
private boolean printMessage(SOAPMessageContext context, PrintStream ps) {... |
70 |
0
|
String message = "DebugHandler "; |
71 |
|
|
72 |
0
|
Boolean out = (Boolean)context.get(SOAPMessageContext.MESSAGE_OUTBOUND_PROPERTY); |
73 |
0
|
if(out.booleanValue()) |
74 |
0
|
message += "Out: "; |
75 |
|
else |
76 |
0
|
message += "In: "; |
77 |
|
|
78 |
0
|
ps.print(message); |
79 |
|
|
80 |
0
|
try { |
81 |
0
|
context.getMessage().writeTo(ps); |
82 |
0
|
ps.println(); |
83 |
|
} |
84 |
|
catch(Exception ex) { |
85 |
0
|
logger.error(this.err, ex); |
86 |
|
} |
87 |
|
|
88 |
0
|
return true; |
89 |
|
} |
90 |
|
|
91 |
|
} |