<%-- - $Revision$ - $Date$ - - Copyright (C) 2004-2008 Jive Software. All rights reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> <%@ page import="com.sun.syndication.feed.synd.SyndEntry, com.sun.syndication.feed.synd.SyndFeed, com.sun.syndication.fetcher.FeedFetcher" %> <%@ page import="com.sun.syndication.fetcher.impl.FeedFetcherCache"%> <%@ page import="com.sun.syndication.fetcher.impl.HashMapFeedInfoCache"%> <%@ page import="org.apache.mina.transport.socket.nio.SocketAcceptor"%> <%@ page import="org.jivesoftware.admin.AdminConsole"%> <%@ page import="org.jivesoftware.openfire.*" %> <%@ page import="org.jivesoftware.openfire.container.AdminConsolePlugin" %> <%@ page import="org.jivesoftware.openfire.filetransfer.proxy.FileTransferProxy" %> <%@ page import="org.jivesoftware.openfire.http.HttpBindManager" %> <%@ page import="org.jivesoftware.openfire.mediaproxy.MediaProxyService" %> <%@ page import="org.jivesoftware.openfire.net.SSLConfig" %> <%@ page import="org.jivesoftware.openfire.session.LocalClientSession" %> <%@ page import="org.jivesoftware.openfire.session.LocalConnectionMultiplexerSession" %> <%@ page import="org.jivesoftware.openfire.spi.ConnectionManagerImpl" %> <%@ page import="org.jivesoftware.openfire.update.Update" %> <%@ page import="org.jivesoftware.openfire.update.UpdateManager" %> <%@ page import="org.jivesoftware.util.*" %> <%@ page import="java.net.InetSocketAddress" %> <%@ page import="java.net.SocketAddress" %> <%@ page import="java.net.URL" %> <%@ page import="java.text.DecimalFormat" %> <%@ page import="java.util.List" %> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <%-- Define page bean for header and sidebar --%> <% // Simple logout code if ("true".equals(request.getParameter("logout"))) { session.removeAttribute("jive.admin.authToken"); response.sendRedirect("index.jsp"); return; } %> <%-- Define Administration Bean --%> <% webManager.init(request, response, session, application, out); %> <%! long lastRRSFecth = 0; SyndFeed lastBlogFeed = null; SyndFeed lastReleaseFeed = null; String blogFeedRSS = "http://www.igniterealtime.org/community/blogs/ignite/feeds/posts"; String releaseFeedRSS = "http://www.igniterealtime.org/community/community/feeds/messages?community=2017"; %> <% // Get parameters // boolean serverOn = (webManager.getXMPPServer() != null); String interfaceName = JiveGlobals.getXMLProperty("network.interface"); ConnectionManagerImpl connectionManager = ((ConnectionManagerImpl) XMPPServer.getInstance().getConnectionManager()); SocketAcceptor socketAcceptor = connectionManager.getSocketAcceptor(); SocketAcceptor sslSocketAcceptor = connectionManager.getSSLSocketAcceptor(); SocketAcceptor multiplexerSocketAcceptor = connectionManager.getMultiplexerSocketAcceptor(); ServerPort serverPort = null; ServerPort componentPort = null; AdminConsolePlugin adminConsolePlugin = (AdminConsolePlugin) XMPPServer.getInstance().getPluginManager().getPlugin("admin"); FileTransferProxy fileTransferProxy = XMPPServer.getInstance().getFileTransferProxy(); HttpBindManager httpBindManager = HttpBindManager.getInstance(); MediaProxyService mediaProxyService = XMPPServer.getInstance().getMediaProxyService(); FlashCrossDomainHandler flashCrossDomainHandler = XMPPServer.getInstance().getFlashCrossDomainHandler(); // Search for s2s and external component ports info for (ServerPort port : XMPPServer.getInstance().getServerInfo().getServerPorts()) { if (port.getType() == ServerPort.Type.server) { serverPort = port; } else if (port.getType() == ServerPort.Type.component) { componentPort = port; } } boolean rssEnabled = JiveGlobals.getBooleanProperty("rss.enabled", true); %> <fmt:message key="index.title"/> <% UpdateManager updateManager = XMPPServer.getInstance().getUpdateManager(); Update serverUpdate = updateManager.getServerUpdate(); if (serverUpdate != null) { %>


" %>" /> " %>" /> " %>" /> " %>" />

<% } %>

<% if (rssEnabled) { %> <% } %>
<% if (serverOn) { %> <% } %>
<% long now = System.currentTimeMillis(); long lastStarted = webManager.getXMPPServer().getServerInfo().getLastStarted().getTime(); long uptime = now - lastStarted; String uptimeDisplay = StringUtils.getElapsedTime(uptime); %> <% if (uptimeDisplay != null) { %> <%= uptimeDisplay %> -- started <% } %> <%= JiveGlobals.formatDateTime(webManager.getXMPPServer().getServerInfo().getLastStarted()) %>
<%= AdminConsole.getAppName() %> <%= AdminConsole.getVersionString() %>
<%= JiveGlobals.getHomeDirectory() %>
<% try { %> <% if (!CertificateManager.isRSACertificate(SSLConfig.getKeyStore(), XMPPServer.getInstance().getServerInfo().getXMPPDomain())) {%> <fmt:message key=" title="">  <% } %> <% } catch (Exception e) { %> <fmt:message key=" title="">  <% } %> ${webManager.serverInfo.XMPPDomain}
 
<% String vmName = System.getProperty("java.vm.name"); if (vmName == null) { vmName = ""; } else { vmName = " -- " + vmName; } %> <%= System.getProperty("java.version") %> <%= System.getProperty("java.vendor") %><%= vmName %>
<%= application.getServerInfo() %>
${webManager.serverInfo.hostname}
<%= System.getProperty("os.name") %> / <%= System.getProperty("os.arch") %>
<%= JiveGlobals.getLocale() %> / <%= JiveGlobals.getTimeZone().getDisplayName(JiveGlobals.getLocale()) %> (<%= (JiveGlobals.getTimeZone().getRawOffset()/1000/60/60) %> GMT)
<% // The java runtime Runtime runtime = Runtime.getRuntime(); double freeMemory = (double)runtime.freeMemory()/(1024*1024); double maxMemory = (double)runtime.maxMemory()/(1024*1024); double totalMemory = (double)runtime.totalMemory()/(1024*1024); double usedMemory = totalMemory - freeMemory; double percentFree = ((maxMemory - usedMemory)/maxMemory)*100.0; double percentUsed = 100 - percentFree; int percent = 100-(int)Math.round(percentFree); DecimalFormat mbFormat = new DecimalFormat("#0.00"); DecimalFormat percentFormat = new DecimalFormat("#0.0"); %>
<% if (percent == 0) { %> <% } else { %> <% if (percent >= 90) { %> <% } else { %> <% } %> <% } %>
<%= mbFormat.format(usedMemory) %> MB of <%= mbFormat.format(maxMemory) %> MB (<%= percentFormat.format(percentUsed) %>%) used

<% long nowTime = System.currentTimeMillis(); if (lastBlogFeed == null || lastReleaseFeed == null || nowTime - lastRRSFecth > 21600000) { FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance(); FeedFetcher feedFetcher = new HttpClientWithTimeoutFeedFetcher(feedInfoCache); try { lastBlogFeed = feedFetcher.retrieveFeed(new URL(blogFeedRSS)); lastReleaseFeed = feedFetcher.retrieveFeed(new URL(releaseFeedRSS)); lastRRSFecth = nowTime; } catch (Exception ioe) { // ignore } } %>
<% if (lastBlogFeed != null && !lastBlogFeed.getEntries().isEmpty()) { List entries = lastBlogFeed.getEntries(); for (int i = 0; i < entries.size() && i < 3; i++) { SyndEntry entry = (SyndEntry) entries.get(i); %>
<%= entry.getTitle()%>, <%= JiveGlobals.formatDate(entry.getPublishedDate())%>
<% } } else { %> <% } %>
<% if (lastReleaseFeed != null && !lastReleaseFeed.getEntries().isEmpty()) { List entries = lastReleaseFeed.getEntries(); for (int i = 0; i < entries.size() && i < 3; i++) { SyndEntry entry = (SyndEntry) entries.get(i); %>
<%= entry.getTitle()%>, <%= JiveGlobals.formatDate(entry.getPublishedDate())%>
<% } } else { %> <% } %>

<% if (socketAcceptor != null) { for (SocketAddress socketAddress : socketAcceptor.getManagedServiceAddresses()) { InetSocketAddress address = (InetSocketAddress) socketAddress; %> <% try { %> <% if (!CertificateManager.isRSACertificate(SSLConfig.getKeyStore(), XMPPServer.getInstance().getServerInfo().getXMPPDomain()) || LocalClientSession.getTLSPolicy() == org.jivesoftware.openfire.Connection.TLSPolicy.disabled) { %> <% } else { %> <% } %> <% } catch (Exception e) { %> <% } %> <% } } %> <% if (sslSocketAcceptor != null) { for (SocketAddress socketAddress : sslSocketAcceptor.getManagedServiceAddresses()) { InetSocketAddress address = (InetSocketAddress) socketAddress; %> <% } } %> <% if (serverPort != null) { %> <% if (JiveGlobals.getBooleanProperty("xmpp.server.tls.enabled", true)) { %> <% } else { %> <% } %> <% } %> <% if (multiplexerSocketAcceptor != null) { for (SocketAddress socketAddress : multiplexerSocketAcceptor.getManagedServiceAddresses()) { InetSocketAddress address = (InetSocketAddress) socketAddress; %> <% if (LocalConnectionMultiplexerSession.getTLSPolicy() == org.jivesoftware.openfire.Connection.TLSPolicy.disabled) { %> <% } else { %> <% } %> <% } } %> <% if (componentPort != null) { %> <% } %> <% if (adminConsolePlugin.getAdminSecurePort() > 0) { %> <% } %> <% if (fileTransferProxy.isProxyEnabled()) { %> <% } %> <% if (httpBindManager.isHttpBindEnabled()) { %> <% if (httpBindManager.getHttpBindUnsecurePort() > 0) { %> <% } %> <% if (httpBindManager.isHttpsBindActive()) { %> <% } %> <% } %> <% if (mediaProxyService.isEnabled()) { %> <% } %>
 
<%= "0.0.0.0".equals(address.getHostName()) ? LocaleUtils.getLocalizedString("ports.all_ports") : address.getHostName() %> <%= address.getPort() %>
<%= "0.0.0.0".equals(address.getHostName()) ? LocaleUtils.getLocalizedString("ports.all_ports") : address.getHostName() %> <%= address.getPort() %>
<%= interfaceName == null ? LocaleUtils.getLocalizedString("ports.all_ports") : serverPort.getIPAddress() %> <%= serverPort.getPort() %>
<%= "0.0.0.0".equals(address.getHostName()) ? LocaleUtils.getLocalizedString("ports.all_ports") : address.getHostName() %> <%= address.getPort() %>
<%= interfaceName == null ? LocaleUtils.getLocalizedString("ports.all_ports") : componentPort.getIPAddress() %> <%= componentPort.getPort() %>
<%= adminConsolePlugin.getBindInterface() == null ? LocaleUtils.getLocalizedString("ports.all_ports") : adminConsolePlugin.getBindInterface() %> <%= adminConsolePlugin.getAdminUnsecurePort() %>
<%= adminConsolePlugin.getBindInterface() == null ? LocaleUtils.getLocalizedString("ports.all_ports") : adminConsolePlugin.getBindInterface() %> <%= adminConsolePlugin.getAdminSecurePort() %>
<%= interfaceName == null ? LocaleUtils.getLocalizedString("ports.all_ports") : interfaceName %> <%= fileTransferProxy.getProxyPort() %>
<%= interfaceName == null ? LocaleUtils.getLocalizedString("ports.all_ports") : interfaceName %> <%= httpBindManager.getHttpBindUnsecurePort() %>
<%= interfaceName == null ? LocaleUtils.getLocalizedString("ports.all_ports") : interfaceName %> <%= httpBindManager.getHttpBindSecurePort() %>
<%= interfaceName == null ? LocaleUtils.getLocalizedString("ports.all_ports") : interfaceName %> <%= mediaProxyService.getMinPort() %> - <%= mediaProxyService.getMaxPort() %>
<%= interfaceName == null ? LocaleUtils.getLocalizedString("ports.all_ports") : interfaceName %> <%= flashCrossDomainHandler.getPort() %>

">