OSDN Git Service

Initial commit
[ultramonkey-l7/l7gui.git] / src / WebContent / sync_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(41391,
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 sync info (VS IPaddress)
22          */
23         L7guiFramework framework = new L7guiFramework();
24         ClusterData cd = framework.getClusterData();
25
26         String self = "";
27         String other = "";
28
29         if (cd == null) {
30                 MessageView error = new MessageView(41392,
31                 LogCategorySet.GUI_IO_COMMAND,
32                 Message.CLUSTER_DATA_ERROR);
33                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
34                 response.sendRedirect(RedirectPages.LOGIN);
35                 return;
36         } else {
37                 self = cd.self_ip;
38                 other = cd.other_ip;
39         }
40
41         /*
42          * get thread status
43          */
44         String threadStatus = (String) session
45                         .getAttribute(SessionKeys.THREAD_STATUS);
46         if (threadStatus == null) {
47                 MessageView error = new MessageView(41393, LogCategorySet.GUI_SYNC,
48                 Message.UNEXPECTED_ERROR);
49                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
50                 response.sendRedirect(RedirectPages.LOGIN);
51                 return;
52         } else if (threadStatus == SessionKeys.THREAD_RUNNING) {
53                 // nothing to do
54         } else if (threadStatus == SessionKeys.THREAD_SUCCESS) {
55                 response.sendRedirect(RedirectPages.SYNC);
56                 return;
57         } else if (threadStatus == SessionKeys.THREAD_FAIL) {
58                 response.sendRedirect(RedirectPages.SYNC_NG);
59                 return;
60         } else {
61                 MessageView error = new MessageView(41394, LogCategorySet.GUI_SYNC,
62                 Message.UNEXPECTED_ERROR);
63                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
64                 response.sendRedirect(RedirectPages.LOGIN);
65                 return;
66         }
67 %>
68
69 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
70 <html>
71 <head>
72         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
73         <meta http-equiv="Pragma" content="no-cache">
74         <meta http-equiv="Cache-Control" content="no-cache">
75         <meta http-equiv="Expires" content="0"> 
76         <meta http-equiv="Content-Script-Type" content="text/javascript" />
77         <meta http-equiv="Content-Style-Type" content="text/css" />
78         <noscript>
79         <meta http-equiv="refresh"
80                 content="<%= RedirectPages.NOSCRIPT_TIME %>; url=<%= RedirectPages.LOGIN %>" />
81         </noscript>
82         <meta http-equiv="refresh" content="<%= RedirectPages.REFRESH_TIME %>" />
83         
84         <link rel="stylesheet" type="text/css" href="l7gui_basic_style.css" />
85         <link rel="shortcut icon" href="images/favicon.ico" />
86         <title>Running : Sync Resources</title>
87 </head>
88
89 <body>
90
91 <h1 class="title">Running : Sync Resources</h1>
92 <h2>Please wait.</h2>
93
94
95 <%
96      if ((self != null) && (other != null)){
97 %>
98                 <h2><%=self %> (<%=cd.self_status %>) <img class="arrow2" src="images/arrowlogo2.gif"
99                      alt="arrowlogo" /><%=other %> (<%=cd.other_status %>)</h2>
100
101 <%
102      }
103 %>
104
105
106 </body>
107 </html>
108