01: package org.objectweb.jonas.webapp.jonasadmin.jonasmqconnect;
02:
03: import java.io.IOException;
04: import java.util.ArrayList;
05:
06: import javax.servlet.ServletException;
07: import javax.servlet.http.HttpServletRequest;
08: import javax.servlet.http.HttpServletResponse;
09:
10: import org.apache.struts.action.ActionForm;
11: import org.apache.struts.action.ActionForward;
12: import org.apache.struts.action.ActionMapping;
13: import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction;
14: import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou;
15: import org.objectweb.jonas.webapp.jonasadmin.jonasmqconnect.util.MqObjectNames;
16: import org.objectweb.jonas.webapp.jonasadmin.jonasmqconnect.util.Property;
17:
18: public class JonasMqConnectPlatformAction extends JonasBaseAction {
19:
20: public ActionForward executeAction(ActionMapping mapping,
21: ActionForm form, HttpServletRequest request,
22: HttpServletResponse response) throws IOException,
23: ServletException {
24:
25: JonasMqConnectPlatformForm fBean = (JonasMqConnectPlatformForm) form;
26: WhereAreYou oWhere = (WhereAreYou) request.getSession()
27: .getAttribute(WhereAreYou.SESSION_NAME);
28: String domainName = oWhere.getCurrentDomainName();
29: String serverName = oWhere.getCurrentJonasServerName();
30: ArrayList names = MqObjectNames.getConnectorsONList(domainName,
31: serverName);
32: ArrayList list = new ArrayList();
33: for (int i = 0; i < names.size(); i++) {
34: list.add(new Property("connector", (String) names.get(i),
35: "Jonas MQ Connector"));
36:
37: }
38: m_Session.setAttribute("mqconnectors", list);
39:
40: /*
41: * Select the right tree node
42: */
43: String nodeName = "domain" + WhereAreYou.NODE_SEPARATOR
44: + oWhere.getCurrentJonasServerName()
45: + WhereAreYou.NODE_SEPARATOR + "jonasmqconnect";
46:
47: m_WhereAreYou.selectNameNode(nodeName, true);
48:
49: return mapping.findForward("JonasMqConnectPlatform");
50: }
51: }
|