KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > utils > SOAPMonitor


1 /*
2  * Copyright 2001,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache Liusercense, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.axis.utils;
17
18 import org.apache.axis.client.AdminClient;
19 import org.apache.axis.monitor.SOAPMonitorConstants;
20 import org.w3c.dom.Document JavaDoc;
21 import org.w3c.dom.Element JavaDoc;
22 import org.w3c.dom.NamedNodeMap JavaDoc;
23 import org.w3c.dom.Node JavaDoc;
24 import org.w3c.dom.NodeList JavaDoc;
25
26 import javax.swing.BoxLayout JavaDoc;
27 import javax.swing.ButtonGroup JavaDoc;
28 import javax.swing.DefaultListModel JavaDoc;
29 import javax.swing.JButton JavaDoc;
30 import javax.swing.JCheckBox JavaDoc;
31 import javax.swing.JDialog JavaDoc;
32 import javax.swing.JFrame JavaDoc;
33 import javax.swing.JLabel JavaDoc;
34 import javax.swing.JList JavaDoc;
35 import javax.swing.JOptionPane JavaDoc;
36 import javax.swing.JPanel JavaDoc;
37 import javax.swing.JPasswordField JavaDoc;
38 import javax.swing.JProgressBar JavaDoc;
39 import javax.swing.JRadioButton JavaDoc;
40 import javax.swing.JScrollPane JavaDoc;
41 import javax.swing.JSplitPane JavaDoc;
42 import javax.swing.JTabbedPane JavaDoc;
43 import javax.swing.JTable JavaDoc;
44 import javax.swing.JTextArea JavaDoc;
45 import javax.swing.JTextField JavaDoc;
46 import javax.swing.ListSelectionModel JavaDoc;
47 import javax.swing.SwingConstants JavaDoc;
48 import javax.swing.SwingUtilities JavaDoc;
49 import javax.swing.UIManager JavaDoc;
50 import javax.swing.WindowConstants JavaDoc;
51 import javax.swing.border.BevelBorder JavaDoc;
52 import javax.swing.border.EmptyBorder JavaDoc;
53 import javax.swing.border.EtchedBorder JavaDoc;
54 import javax.swing.event.DocumentEvent JavaDoc;
55 import javax.swing.event.DocumentListener JavaDoc;
56 import javax.swing.event.ListSelectionEvent JavaDoc;
57 import javax.swing.event.ListSelectionListener JavaDoc;
58 import javax.swing.table.AbstractTableModel JavaDoc;
59 import javax.swing.event.ChangeListener JavaDoc;
60 import javax.xml.parsers.ParserConfigurationException JavaDoc;
61 import java.awt.BorderLayout JavaDoc;
62 import java.awt.Color JavaDoc;
63 import java.awt.Dimension JavaDoc;
64 import java.awt.FlowLayout JavaDoc;
65 import java.awt.Font JavaDoc;
66 import java.awt.GridBagConstraints JavaDoc;
67 import java.awt.GridBagLayout JavaDoc;
68 import java.awt.GridLayout JavaDoc;
69 import java.awt.Insets JavaDoc;
70 import java.awt.event.ActionEvent JavaDoc;
71 import java.awt.event.ActionListener JavaDoc;
72 import java.awt.event.WindowAdapter JavaDoc;
73 import java.awt.event.WindowEvent JavaDoc;
74 import java.io.ByteArrayInputStream JavaDoc;
75 import java.io.IOException JavaDoc;
76 import java.io.ObjectInputStream JavaDoc;
77 import java.io.ObjectOutputStream JavaDoc;
78 import java.lang.reflect.InvocationTargetException JavaDoc;
79 import java.net.Socket JavaDoc;
80 import java.net.URL JavaDoc;
81 import java.net.MalformedURLException JavaDoc;
82 import java.text.DateFormat JavaDoc;
83 import java.util.Collection JavaDoc;
84 import java.util.Date JavaDoc;
85 import java.util.Enumeration JavaDoc;
86 import java.util.HashMap JavaDoc;
87 import java.util.Iterator JavaDoc;
88 import java.util.Vector JavaDoc;
89
90 /**
91  * This is a SOAP Monitor Application class. This class provides
92  * the user interface for deploying the SOAP monitor service and
93  * displaying data from the service.
94  *
95  * @author Toshiyuki Kimura (toshi@apache.org)
96  * @author Brian Price (pricebe@us.ibm.com)
97  */

98 public class SOAPMonitor extends JFrame JavaDoc implements ActionListener JavaDoc, ChangeListener JavaDoc {
99
100     /**
101      * Private data
102      */

103     private JPanel JavaDoc main_panel = null;
104
105     /**
106      * Field tabbed_pane
107      */

108     private JTabbedPane JavaDoc tabbed_pane = null;
109
110     /**
111      * Field top_pane
112      */

113     private JTabbedPane JavaDoc top_pane = null;
114
115     /**
116      * Field port
117      */

118     private int port = 5001;
119
120     /**
121      * Field axisHost
122      */

123     private String JavaDoc axisHost = "localhost";
124
125     /**
126      * Field axisPort
127      */

128     private int axisPort = 8080;
129
130     /**
131      * Field axisURL
132      */

133     private String JavaDoc axisURL = null;
134
135     /**
136      * Field pages
137      */

138     private Vector JavaDoc pages = null;
139
140     /**
141      * Field titleStr
142      */

143     private final String JavaDoc titleStr = "SOAP Monitor Administration";
144
145     /**
146      * Field set_panel
147      */

148     private JPanel JavaDoc set_panel = null;
149
150     /**
151      * Field titleLabel
152      */

153     private JLabel JavaDoc titleLabel = null;
154
155     /**
156      * Field add_btn
157      */

158     private JButton JavaDoc add_btn = null;
159
160     /**
161      * Field del_btn
162      */

163     private JButton JavaDoc del_btn = null;
164
165     /**
166      * Field save_btn
167      */

168     private JButton JavaDoc save_btn = null;
169
170     /**
171      * Field login_btn
172      */

173     private JButton JavaDoc login_btn = null;
174
175     /**
176      * Field model1
177      */

178     private DefaultListModel JavaDoc model1 = null;
179
180     /**
181      * Field model2
182      */

183     private DefaultListModel JavaDoc model2 = null;
184
185     /**
186      * Field list1
187      */

188     private JList JavaDoc list1 = null;
189
190     /**
191      * Field list2
192      */

193     private JList JavaDoc list2 = null;
194
195     /**
196      * Field serviceMap
197      */

198     private HashMap JavaDoc serviceMap = null;
199
200     /**
201      * Field originalDoc
202      */

203     private Document JavaDoc originalDoc = null;
204
205     /**
206      * Field axisUser
207      */

208     private static String JavaDoc axisUser = null;
209
210     /**
211      * Field axisPass
212      */

213     private static String JavaDoc axisPass = null;
214
215     /**
216      * Field adminClient
217      */

218     private AdminClient adminClient = new AdminClient();
219
220     /**
221      * Main method for this class
222      *
223      * @param args
224      * @throws Exception
225      */

226     public static void main(String JavaDoc args[]) throws Exception JavaDoc {
227         SOAPMonitor soapMonitor = null;
228         Options opts = new Options(args);
229         if (opts.isFlagSet('?') > 0) {
230             System.out.println(
231                     "Usage: SOAPMonitor [-l<url>] [-u<user>] [-w<password>] [-?]");
232             System.exit(0);
233         }
234
235         // Create an instance
236
soapMonitor = new SOAPMonitor();
237
238         // GET Axis URL.
239
// The default is "http://localhost:8080/axis/servlet/AxisServlet"
240
soapMonitor.axisURL = opts.getURL();
241         URL JavaDoc url = new URL JavaDoc(soapMonitor.axisURL);
242         soapMonitor.axisHost = url.getHost();
243
244         // GET User name & Password
245
axisUser = opts.getUser();
246         axisPass = opts.getPassword();
247
248         // Login and start application
249
soapMonitor.doLogin();
250     }
251
252     /**
253      * Constructor
254      */

255     public SOAPMonitor() {
256         setTitle("SOAP Monitor Application");
257         Dimension JavaDoc d = getToolkit().getScreenSize();
258         setSize(640, 480);
259         setLocation((d.width - getWidth()) / 2, (d.height - getHeight()) / 2);
260         setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
261         addWindowListener(new MyWindowAdapter());
262
263         // Try to use the system look and feel
264
try {
265             UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
266         } catch (Exception JavaDoc e) {
267         }
268
269         // Create main panel to hold notebook
270
main_panel = new JPanel JavaDoc();
271         main_panel.setBackground(Color.white);
272         main_panel.setLayout(new BorderLayout JavaDoc());
273         top_pane = new JTabbedPane JavaDoc();
274         set_panel = new JPanel JavaDoc();
275
276         // label for NORTH panel to display the pain title
277
titleLabel = new JLabel JavaDoc(titleStr);
278         titleLabel.setFont(new Font JavaDoc("Serif", Font.BOLD, 18));
279
280         // list control for WEST panel to list NOT monitored services
281
model1 = new DefaultListModel JavaDoc();
282         list1 = new JList JavaDoc(model1);
283         list1.setFixedCellWidth(250);
284         JScrollPane JavaDoc scroll1 = new JScrollPane JavaDoc(list1);
285
286         // list control for EAST panel to list monitored services
287
model2 = new DefaultListModel JavaDoc();
288         list2 = new JList JavaDoc(model2);
289         list2.setFixedCellWidth(250);
290         JScrollPane JavaDoc scroll2 = new JScrollPane JavaDoc(list2);
291
292         // buttons for CENTER panel to chage the monitoring state
293
add_btn = new JButton JavaDoc("Turn On [ >> ]");
294         del_btn = new JButton JavaDoc("[ << ] Turn Off");
295         JPanel JavaDoc center_panel = new JPanel JavaDoc();
296         GridBagLayout JavaDoc layout = new GridBagLayout JavaDoc();
297         center_panel.setLayout(layout);
298         GridBagConstraints JavaDoc c = new GridBagConstraints JavaDoc();
299         c.gridx = 0;
300         c.gridy = 0;
301         c.insets = new Insets JavaDoc(10, 10, 10, 10);
302         layout.setConstraints(add_btn, c);
303         center_panel.add(add_btn);
304         c.gridx = 0;
305         c.gridy = 1;
306         c.insets = new Insets JavaDoc(10, 10, 10, 10);
307         layout.setConstraints(del_btn, c);
308         center_panel.add(del_btn);
309
310         // buttons for SOUTH panel
311
save_btn = new JButton JavaDoc("Save changes");
312         login_btn = new JButton JavaDoc("Change server");
313         JPanel JavaDoc south_panel = new JPanel JavaDoc();
314         layout = new GridBagLayout JavaDoc();
315         c.gridx = 0;
316         c.gridy = 0;
317         c.insets = new Insets JavaDoc(10, 10, 10, 10);
318         layout.setConstraints(save_btn, c);
319         south_panel.add(save_btn);
320         c.gridx = 1;
321         c.gridy = 0;
322         c.insets = new Insets JavaDoc(10, 10, 10, 10);
323         layout.setConstraints(login_btn, c);
324         south_panel.add(login_btn);
325
326         // set all controls to the border layout
327
set_panel.setLayout(new BorderLayout JavaDoc(5, 5));
328         set_panel.add(titleLabel, BorderLayout.NORTH);
329         set_panel.add(south_panel, BorderLayout.SOUTH);
330         set_panel.add(scroll1, BorderLayout.WEST);
331         set_panel.add(scroll2, BorderLayout.EAST);
332         set_panel.add(center_panel, BorderLayout.CENTER);
333
334         // register the Action Listener
335
add_btn.addActionListener(this);
336         del_btn.addActionListener(this);
337         save_btn.addActionListener(this);
338         login_btn.addActionListener(this);
339
340         // set default button state as 'false'
341
add_btn.setEnabled(false);
342         del_btn.setEnabled(false);
343         save_btn.setEnabled(false);
344         login_btn.setEnabled(false);
345         top_pane.add("Setting", set_panel);
346         top_pane.add("Monitoring", main_panel);
347         getContentPane().add(top_pane);
348
349         // Create the notebook
350
tabbed_pane = new JTabbedPane JavaDoc(JTabbedPane.TOP);
351         main_panel.add(tabbed_pane, BorderLayout.CENTER);
352         top_pane.addChangeListener(this);
353         top_pane.setEnabled(false);
354         setVisible(true);
355     }
356
357     /**
358      * Do login process
359      *
360      * @return
361      */

362     private boolean doLogin() {
363         Dimension JavaDoc d = null;
364
365         // Login
366
LoginDlg login = new LoginDlg();
367         login.show();
368         if (!login.isLogin()) {
369             login_btn.setEnabled(true);
370             return false;
371         }
372         login.dispose();
373         save_btn.setEnabled(false);
374         login_btn.setEnabled(false);
375
376         // Get the axisHost & axisPort to be used
377
String JavaDoc url_str = login.getURL();
378         try {
379             URL JavaDoc url = new URL JavaDoc(url_str);
380             axisHost = url.getHost();
381             axisPort = url.getPort();
382             if (axisPort == -1) {
383                 axisPort = 8080;
384             }
385             String JavaDoc axisPath = url.getPath();
386             axisURL = "http://" + axisHost + ":" + axisPort + axisPath;
387         } catch (MalformedURLException JavaDoc e) {
388             JOptionPane JavaDoc pane = new JOptionPane JavaDoc();
389             String JavaDoc msg = e.toString();
390             pane.setMessageType(JOptionPane.WARNING_MESSAGE);
391             pane.setMessage(msg);
392             pane.setOptions(new String JavaDoc[]{"OK"});
393             JDialog JavaDoc dlg = pane.createDialog(null, "Login status");
394             dlg.setVisible(true);
395             login_btn.setEnabled(true);
396             return false;
397         }
398         titleLabel.setText(titleStr + " for [" + axisHost + ":" + axisPort
399                 + "]");
400         final JProgressBar JavaDoc progressBar = new JProgressBar JavaDoc(0, 100);
401         BarThread stepper = new BarThread(progressBar);
402         stepper.start();
403         JFrame JavaDoc progress = new JFrame JavaDoc();
404         d = new Dimension JavaDoc(250, 50);
405         progress.setSize(d);
406         d = getToolkit().getScreenSize();
407         progress.getContentPane().add(progressBar);
408         progress.setTitle("Now loading data ...");
409         progress.setLocation((d.width - progress.getWidth()) / 2,
410                 (d.height - progress.getHeight()) / 2);
411         progress.show();
412
413         // Add notebook page for default host connection
414
pages = new Vector JavaDoc();
415         addPage(new SOAPMonitorPage(axisHost));
416         serviceMap = new HashMap JavaDoc();
417         originalDoc = getServerWSDD();
418         model1.clear();
419         model2.clear();
420         if (originalDoc != null) {
421             String JavaDoc ret = null;
422             NodeList JavaDoc nl = originalDoc.getElementsByTagName("service");
423             for (int i = 0; i < nl.getLength(); i++) {
424                 Node JavaDoc node = nl.item(i);
425                 NamedNodeMap JavaDoc map = node.getAttributes();
426                 ret = map.getNamedItem("name").getNodeValue();
427                 serviceMap.put(ret, node);
428                 if (!isMonitored(node)) {
429                     model1.addElement((String JavaDoc) ret);
430                 } else {
431                     model2.addElement((String JavaDoc) ret);
432                 }
433             }
434             if (model1.size() > 0) {
435                 add_btn.setEnabled(true);
436             }
437             if (model2.size() > 0) {
438                 del_btn.setEnabled(true);
439             }
440             progress.dispose();
441             save_btn.setEnabled(true);
442             login_btn.setEnabled(true);
443             top_pane.setEnabled(true);
444             return true;
445         } else {
446             progress.dispose();
447             login_btn.setEnabled(true);
448             return false;
449         }
450     }
451
452     /**
453      * This class is a thred for a JProgressBar.
454      */

455     class BarThread extends Thread JavaDoc {
456
457         /**
458          * Field wait
459          */

460         private int wait = 100;
461
462         /**
463          * Field progressBar
464          */

465         JProgressBar JavaDoc progressBar = null;
466
467         /**
468          * Constructor BarThread
469          *
470          * @param bar
471          */

472         public BarThread(JProgressBar JavaDoc bar) {
473             progressBar = bar;
474         }
475
476         /**
477          * Method run
478          */

479         public void run() {
480             int min = progressBar.getMinimum();
481             int max = progressBar.getMaximum();
482             Runnable JavaDoc runner = new Runnable JavaDoc() {
483                 public void run() {
484                     int val = progressBar.getValue();
485                     progressBar.setValue(val + 1);
486                 }
487             };
488             for (int i = min; i < max; i++) {
489                 try {
490                     SwingUtilities.invokeAndWait(runner);
491                     Thread.sleep(wait);
492                 } catch (InterruptedException JavaDoc ignoredException) {
493                 } catch (InvocationTargetException JavaDoc ignoredException) {
494                 }
495             }
496         }
497     }
498
499     /**
500      * Get the server-config.wsdd as a document to retrieve deployed services
501      *
502      * @return
503      */

504     private Document JavaDoc getServerWSDD() {
505         Document JavaDoc doc = null;
506         try {
507             String JavaDoc[] param = new String JavaDoc[]{"-u" + axisUser, "-w" + axisPass,
508                                           "-l " + axisURL, "list"};
509             String JavaDoc ret = adminClient.process(param);
510             doc = XMLUtils.newDocument(
511                     new ByteArrayInputStream JavaDoc(ret.getBytes()));
512         } catch (Exception JavaDoc e) {
513             JOptionPane JavaDoc pane = new JOptionPane JavaDoc();
514             String JavaDoc msg = e.toString();
515             pane.setMessageType(JOptionPane.WARNING_MESSAGE);
516             pane.setMessage(msg);
517             pane.setOptions(new String JavaDoc[]{"OK"});
518             JDialog JavaDoc dlg = pane.createDialog(null, "Login status");
519             dlg.setVisible(true);
520         }
521         return doc;
522     }
523
524     /**
525      * Deploy the specified wsdd to change the monitoring state
526      *
527      * @param wsdd
528      * @return
529      */

530     private boolean doDeploy(Document JavaDoc wsdd) {
531         String JavaDoc deploy = null;
532         Options opt = null;
533         deploy = XMLUtils.DocumentToString(wsdd);
534         try {
535             String JavaDoc[] param = new String JavaDoc[]{"-u" + axisUser, "-w" + axisPass,
536                                           "-l " + axisURL, ""};
537             opt = new Options(param);
538             adminClient.process(opt,
539                     new ByteArrayInputStream JavaDoc(deploy.getBytes()));
540         } catch (Exception JavaDoc e) {
541             return false;
542         }
543         return true;
544     }
545
546     /**
547      * Get a new document which has the specified node as the document root
548      *
549      * @param target
550      * @return
551      */

552     private Document JavaDoc getNewDocumentAsNode(Node JavaDoc target) {
553         Document JavaDoc doc = null;
554         Node JavaDoc node = null;
555         try {
556             doc = XMLUtils.newDocument();
557         } catch (ParserConfigurationException JavaDoc e) {
558             e.printStackTrace();
559         }
560         node = doc.importNode(target, true);
561         doc.appendChild(node);
562         return doc;
563     }
564
565     /**
566      * Add needed nodes for monitoring to the specified node
567      * <p/>
568      * TODO: support JAX-RPC type definition (i.e. <handlerInfoChain/>)
569      *
570      * @param target
571      * @return
572      */

573     private Node JavaDoc addMonitor(Node JavaDoc target) {
574         Document JavaDoc doc = null;
575         Node JavaDoc node = null;
576         Node JavaDoc newNode = null;
577         String JavaDoc ret = null;
578         NodeList JavaDoc nl = null;
579         final String JavaDoc reqFlow = "requestFlow";
580         final String JavaDoc resFlow = "responseFlow";
581         final String JavaDoc monitor = "soapmonitor";
582         final String JavaDoc handler = "handler";
583         final String JavaDoc type = "type";
584         doc = getNewDocumentAsNode(target);
585
586         // Add "responseFlow node
587
nl = doc.getElementsByTagName(resFlow);
588         if (nl.getLength() == 0) {
589             node = doc.getDocumentElement().getFirstChild();
590             newNode = doc.createElement(resFlow);
591             doc.getDocumentElement().insertBefore(newNode, node);
592         }
593
594         // Add "requestFlow" node
595
nl = doc.getElementsByTagName(reqFlow);
596         if (nl.getLength() == 0) {
597             node = doc.getDocumentElement().getFirstChild();
598             newNode = doc.createElement(reqFlow);
599             doc.getDocumentElement().insertBefore(newNode, node);
600         }
601
602         // Add "handler" node and "soapmonitor" attribute for "requestFlow"
603
nl = doc.getElementsByTagName(reqFlow);
604         node = nl.item(0).getFirstChild();
605         newNode = doc.createElement(handler);
606         ((Element JavaDoc) newNode).setAttribute(type, monitor);
607         nl.item(0).insertBefore(newNode, node);
608
609         // Add "handler" node and "soapmonitor" attribute for "responseFlow"
610
nl = doc.getElementsByTagName(resFlow);
611         node = nl.item(0).getFirstChild();
612         newNode = doc.createElement(handler);
613         ((Element JavaDoc) newNode).setAttribute(type, monitor);
614         nl.item(0).insertBefore(newNode, node);
615         
616         return (Node JavaDoc) doc.getDocumentElement();
617     }
618
619     /**
620      * Remove a few nodes for stoping monitor from the specified node
621      * <p/>
622      * TODO: support JAX-RPC type definition (i.e. <handlerInfoChain/>)
623      *
624      * @param target
625      * @return
626      */

627     private Node JavaDoc delMonitor(Node JavaDoc target) {
628         Document JavaDoc doc = null;
629         Node JavaDoc node = null;
630         Node JavaDoc newNode = null;
631         String JavaDoc ret = null;
632         NodeList JavaDoc nl = null;
633         final String JavaDoc reqFlow = "requestFlow";
634         final String JavaDoc resFlow = "responseFlow";
635         final String JavaDoc monitor = "soapmonitor";
636         final String JavaDoc handler = "handler";
637         final String JavaDoc type = "type";
638         doc = getNewDocumentAsNode(target);
639         nl = doc.getElementsByTagName(handler);
640         int size;
641         size = nl.getLength();
642         Node JavaDoc[] removeNode = new Node JavaDoc[size];
643         if (size > 0) {
644             newNode = nl.item(0).getParentNode();
645         }
646         for (int i = 0; i < size; i++) {
647             node = nl.item(i);
648             NamedNodeMap JavaDoc map = node.getAttributes();
649             ret = map.getNamedItem(type).getNodeValue();
650             if (ret.equals(monitor)) {
651                 removeNode[i] = node;
652             }
653         }
654         for (int i = 0; i < size; i++) {
655             Node JavaDoc child = removeNode[i];
656             if (child != null) {
657                 child.getParentNode().removeChild(child);
658             }
659         }
660
661         return (Node JavaDoc) doc.getDocumentElement();
662     }
663
664     /**
665      * Get a boolean value whether the specified node is monitoring or not
666      *
667      * @param target
668      * @return
669      */

670     private boolean isMonitored(Node JavaDoc target) {
671         Document JavaDoc doc = null;
672         Node JavaDoc node = null;
673         String JavaDoc ret = null;
674         NodeList JavaDoc nl = null;
675         final String JavaDoc monitor = "soapmonitor";
676         final String JavaDoc handler = "handler";
677         final String JavaDoc type = "type";
678         doc = getNewDocumentAsNode(target);
679         nl = doc.getElementsByTagName(handler);
680         for (int i = 0; i < nl.getLength(); i++) {
681             node = nl.item(i);
682             NamedNodeMap JavaDoc map = node.getAttributes();
683             ret = map.getNamedItem(type).getNodeValue();
684             if (ret.equals(monitor)) {
685                 return true;
686             } else {
687                 return false;
688             }
689         }
690         return false;
691     }
692
693     /**
694      * Add a few nodes for authentification
695      * <p/>
696      * TODO: support JAX-RPC type definition (i.e. <handlerInfoChain/>)
697      *
698      * @param target
699      * @return
700      */

701     private Node JavaDoc addAuthenticate(Node JavaDoc target) {
702         Document JavaDoc doc = null;
703         Node JavaDoc node = null;
704         Node JavaDoc newNode = null;
705         String JavaDoc ret = null;
706         NodeList JavaDoc nl = null;
707         final String JavaDoc reqFlow = "requestFlow";
708         final String JavaDoc handler = "handler";
709         final String JavaDoc type = "type";
710         final String JavaDoc authentication =
711                 "java:org.apache.axis.handlers.SimpleAuthenticationHandler";
712         final String JavaDoc authorization =
713                 "java:org.apache.axis.handlers.SimpleAuthorizationHandler";
714         final String