<%-- - $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="org.jivesoftware.util.*, org.jivesoftware.database.DbConnectionManager, java.sql.*" errorPage="error.jsp" %> <%@ page import="org.logicalcobwebs.proxool.ConnectionPoolDefinitionIF" %> <%@ page import="org.logicalcobwebs.proxool.ProxoolFacade" %> <%@ page import="org.logicalcobwebs.proxool.admin.SnapshotIF" %> <%@ page import="org.logicalcobwebs.proxool.ConnectionInfoIF" %> <%@ page import="java.text.SimpleDateFormat" %> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <fmt:message key="server.db.title"/> <% // Get metadata about the database Connection con = null; try { con = DbConnectionManager.getConnection(); DatabaseMetaData metaData = con.getMetaData(); %>

<% if (metaData.supportsTransactions()) { %> <% } %>
<%= metaData.getDatabaseProductName() %> <%= metaData.getDatabaseProductVersion() %>
<%= metaData.getDriverName() %>
<%= metaData.getDriverVersion() %>
<%= metaData.getURL() %>
<%= metaData.getUserName() %>
<%= (metaData.supportsTransactions()) ? "Yes" : "No" %>
<% if (con.getTransactionIsolation() == Connection.TRANSACTION_NONE) { %> TRANSACTION_NONE <% } else if (con.getTransactionIsolation() == Connection.TRANSACTION_READ_COMMITTED) { %> TRANSACTION_READ_COMMITTED <% } else if (con.getTransactionIsolation() == Connection.TRANSACTION_READ_UNCOMMITTED) { %> TRANSACTION_READ_UNCOMMITTED <% } else if (con.getTransactionIsolation() == Connection.TRANSACTION_REPEATABLE_READ) { %> TRANSACTION_REPEATABLE_READ <% } else if (con.getTransactionIsolation() == Connection.TRANSACTION_SERIALIZABLE) { %> TRANSACTION_SERIALIZABLE <% } %>

<%= (metaData.supportsMultipleTransactions()) ? "Yes" : "No" %>
<%= (metaData.isReadOnly()) ? "Yes" : "No" %>
<% } finally { try { if (con != null) { con.close(); } } catch (SQLException e) { Log.error(e); } } if (DbConnectionManager.getConnectionProvider().isPooled()) { try { // Get metadata about the connection pool ConnectionPoolDefinitionIF poolDef = ProxoolFacade.getConnectionPoolDefinition("openfire"); SnapshotIF poolStats = ProxoolFacade.getSnapshot("openfire", true); Integer active = 100 * poolStats.getActiveConnectionCount() / poolStats.getMaximumConnectionCount(); Integer inactive = 100 * (poolStats.getAvailableConnectionCount() - poolStats.getActiveConnectionCount()) / poolStats.getMaximumConnectionCount(); Integer notopened = 100 - active - inactive; SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss"); %>

<%= (poolDef.getHouseKeepingSleepTime() / 1000) %>
<%= (poolDef.getMaximumConnectionLifetime() / 1000) %>
<%= poolDef.getMinimumConnectionCount() %>
<%= poolDef.getMaximumConnectionCount() %>
<%= poolDef.getHouseKeepingTestSql() %>
<%= (poolDef.isTestBeforeUse() ? "Yes" : "No") %>
<%= (poolDef.isTestAfterUse() ? "Yes" : "No") %>
<%= poolStats.getActiveConnectionCount() %> (), <%= poolStats.getAvailableConnectionCount() %> (), <%= poolStats.getMaximumConnectionCount() %> ()
<% if (active > 0) { %><% } %> <% if (inactive > 0) { %><% } %>
   
<%= poolStats.getServedCount() %>
<%= poolStats.getRefusedCount() %>
<% for (ConnectionInfoIF info : poolStats.getConnectionInfos()) { %> <% } %>
<%= info.getId() %> <%= dateFormat.format(info.getBirthDate()) %> <%= info.getTimeLastStartActive() > 0 ? dateFormat.format(new Date(info.getTimeLastStartActive())) : "-" %> <%= info.getRequester() != null ? info.getRequester() : "-" %>
<% } catch (Exception e) { // Nothing Log.error("AdminConsole: Error while displaying connection pool information: ", e); } } %>

<fmt:message key=" />