
web.message_store.viewMessageStore.jsp Maven / Gradle / Ivy
<%--
~ Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) 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 contentType="text/html" pageEncoding="UTF-8" import="org.apache.axis2.context.ConfigurationContext" %>
<%@ page import="org.wso2.carbon.CarbonConstants" %>
<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %>
<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
<%@ page import="org.wso2.carbon.message.store.ui.MessageStoreAdminServiceClient" %>
<%@ page import="org.wso2.carbon.message.store.stub.MessageInfo" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
<%
String url = CarbonUIUtil.getServerURL(this.getServletConfig().getServletContext(),
session);
ConfigurationContext configContext =
(ConfigurationContext) config.getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
MessageStoreAdminServiceClient client = null;
String[] messageStoreNames = null;
String messageStoreName = null;
MessageInfo[] messageInfos = null;
int numberOfMessageStores = 0;
boolean displayMessageInDetail = true;
int numberOfPages = 1;
String pageNumber = request.getParameter("pageNumber");
if (pageNumber == null) {
pageNumber = "0";
}
int pageNumberInt = 0;
try {
pageNumberInt = Integer.parseInt(pageNumber);
} catch (NumberFormatException ignored) {
}
try {
client = new MessageStoreAdminServiceClient(cookie, url, configContext);
messageStoreNames = client.getMessageStoreNames();
String name = request.getParameter("messageStoreName");
if (messageStoreNames != null && name != null) {
for (String n : messageStoreNames) {
if (name.equals(n)) {
messageStoreName = n;
}
}
} else {
throw new Exception("Error while accessing Message Stores ");
}
// Hide messages in details div when JDBC Message Store is used
if(client.getClassName(messageStoreName).trim().equals("org.apache.synapse.message.store.impl.jdbc.JDBCMessageStore")){
displayMessageInDetail = false;
}
// Hide messages in details div when RabbitMQ is used
if(client.getClassName(messageStoreName).trim().equals("org.apache.synapse.message.store.impl.rabbitmq.RabbitMQStore")){
displayMessageInDetail = false;
}
messageInfos = client.getPaginatedMessages(messageStoreName, pageNumberInt);
numberOfPages = (int) Math.ceil((double)
client.getSize(messageStoreName) / MessageStoreAdminServiceClient.
MESSAGE_STORES_PER_PAGE);
} catch (Exception e) {
CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, request, e);
%>
<%
}
if (messageStoreName == null) {
CarbonUIMessage.sendCarbonUIMessage("Error while accessing the Message Store",
CarbonUIMessage.ERROR, request,
new Exception("Error while accessing the Message Store"));
}
%>
<%
if (messageStoreName != null) {
String myUrl = "messageStoreName=" + messageStoreName;
%>
<%if (!client.getClassName(messageStoreName).trim().equals("org.apache.synapse.message.store.impl.jms.JmsStore") && !client.getClassName(messageStoreName).trim().equals("org.apache.synapse.message.store.impl.rabbitmq.RabbitMQStore")) { %>
<%}%>
<%
String type = "Not defined";
int size = 0;
try {
size = client.getSize(messageStoreName);
type = client.getClassName(messageStoreName);
} catch (Exception e) {
}
%>
<%= messageStoreName%>
<%= type%>
<%if (!client.getClassName(messageStoreName).trim().equals("org.apache.synapse.message.store.impl.jms.JmsStore") && !client.getClassName(messageStoreName).trim().equals("org.apache.synapse.message.store.impl.rabbitmq.RabbitMQStore")) { %>
<%= size%>
<%}%>
>
<%
if (messageInfos == null || messageInfos.length == 0) {
%>
<%
}
%>
<%
try {
for (MessageInfo mi : messageInfos) {
%>
<%= mi.getMessageId()%>
<%if (!type.trim().equals("org.apache.synapse.message.store.impl.jms.JmsStore")) { %>
<%}%>
<%
}
} catch (Exception e) {
CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, request, e);
}
%>
<%if (!type.trim().equals("org.apache.synapse.message.store.impl.jms.JmsStore")) { %>
"
href="#" id="delete_all_link" class="<%=(messageInfos == null || messageInfos.length == 0)?"icon-link-disabled":"icon-link"%>"
style="background-image:url(../admin/images/delete.gif);">
<%}%>
<%}%>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy