OSDN Git Service

Initial commit
[ultramonkey-l7/l7gui.git] / src / WebContent / replication_executive.jsp
1 <%@ page
2         import="org.ultramonkey.l7.model.*,org.ultramonkey.l7.controller.*,org.ultramonkey.l7.view.*"
3         language="java" contentType="text/html; charset=UTF-8"
4         pageEncoding="UTF-8"%>
5
6 <%
7          /*
8          * check session
9          */
10         L7guiServletBase base = new L7guiServletBase();
11         if (session.isNew() || base.checkSession(session) == false) {
12                 MessageView error = new MessageView(41338,
13                 LogCategorySet.GUI_USER_AUTHENTICATION,
14                 Message.INVALID_SESSSION);
15                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
16                 response.sendRedirect(RedirectPages.LOGIN);
17                 return;
18         }
19
20         /*
21          * get thread status
22          */
23
24         String threadStatus = (String) session
25                         .getAttribute(SessionKeys.THREAD_STATUS);
26                 if (threadStatus == null) {
27                 MessageView error = new MessageView(41339,
28                 LogCategorySet.GUI_REPLICATION,
29                 Message.UNEXPECTED_ERROR);
30                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
31                 response.sendRedirect(RedirectPages.LOGIN);
32                 return;
33         } else if (threadStatus.equals(SessionKeys.THREAD_RUNNING)) {
34                 //
35         } else if (threadStatus.equals(SessionKeys.THREAD_SUCCESS)) {
36                 response.sendRedirect(RedirectPages.REPLICATION_INFO);
37                 return;
38         } else if (threadStatus.equals(SessionKeys.THREAD_FAIL)) {
39                 response.sendRedirect(RedirectPages.REPLICATION_NG);
40                 return;
41         } else {
42                 MessageView error = new MessageView(41340,
43                 LogCategorySet.GUI_REPLICATION,
44                 Message.UNEXPECTED_ERROR);
45                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
46                 response.sendRedirect(RedirectPages.LOGIN);
47                 return;
48         }
49
50         /*
51          * get Replication Info
52          */
53         L7guiFramework framework = new L7guiFramework();
54         ClusterData repInfo = framework.getClusterData();
55         if (repInfo == null) {
56                 MessageView error = new MessageView(41341,
57                 LogCategorySet.GUI_REPLICATION,
58                 Message.UNEXPECTED_ERROR);
59                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
60                 response.sendRedirect(RedirectPages.LOGIN);
61                 return;
62         }
63
64         String repMaster = repInfo.self_ip;
65         String repSlave = repInfo.other_ip;
66          
67         if ((repMaster == null) || (repSlave == null)) {
68                 MessageView error = new MessageView(41342,
69                 LogCategorySet.GUI_REPLICATION,
70                 Message.UNEXPECTED_ERROR);
71                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
72                 response.sendRedirect(RedirectPages.LOGIN);
73                 return;
74         }
75 %>
76
77 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
78 <html>
79 <head>
80         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
81         <meta http-equiv="Pragma" content="no-cache">
82         <meta http-equiv="Cache-Control" content="no-cache">
83         <meta http-equiv="Expires" content="0">                 
84         <meta http-equiv="Content-Script-Type" content="text/javascript" />
85         <meta http-equiv="Content-Style-Type" content="text/css" />
86         <meta http-equiv="refresh" content="<%= RedirectPages.REFRESH_TIME %>" />
87         <noscript>
88         <meta http-equiv="refresh"
89                 content="<%= RedirectPages.NOSCRIPT_TIME %>; url=<%= RedirectPages.LOGIN %>" />
90         </noscript>
91         
92         <link rel="stylesheet" type="text/css" href="l7gui_basic_style.css" />
93         <link rel="shortcut icon" href="images/favicon.ico" />
94         <title>Replicating</title>
95 </head>
96
97 <body>
98 <h1 class="title">Replicating</h1>
99 <h2>Please wait.</h2>
100 <h3>(Master) <%=repMaster%></h3>
101
102 <img class="arrow1" src="images/arrowlogo1.gif" alt="arrowlogo1" />
103
104 <h3>(Slave) <%=repSlave%></h3>
105
106 </body>
107 </html>
108