logger.error("event=listAllSubscriptionsByTopic topic_arn=" + topicArn, ex);
throw new ServletException(ex);
}
ICNSTopicPersistence topicHandler = PersistenceFactory.getTopicPersistence();
CNSTopic topic = null;
try {
topic = topicHandler.getTopic(topicArn);
} catch (Exception ex) {
logger.error("event=getTopic topic_arn=" + topicArn, ex);
throw new ServletException(ex);
}
out.println("<html>");
out.println("<script type='text/javascript' language='javascript'>");
out.println("function changeEndpointHint(protocol){ ");
out.println(" if (protocol == 'HTTP' || protocol == 'HTTPS') { ");
out.println(" document.getElementById('endPoint').placeholder = 'e.g. http://company.com'; }");
out.println(" else if (protocol == 'EMAIL' || protocol == 'EMAIL_JSON') { ");
out.println(" document.getElementById('endPoint').placeholder = 'e.g. user@domain.com'; }");
out.println(" else if (protocol == 'CQS' || protocol == 'SQS') { ");
out.println(" document.getElementById('endPoint').placeholder = 'e.g. arn:aws:cqs:ccp:555555555555:my-queue'; } ");
out.println(" else if (protocol == 'redis') { document.getElementById('endPoint').placeholder = 'e.g. redis://server:port/channelname'; }");
out.println("}");
out.println("</script>");
header(request, out, "Subscriptions for Topic "+ ((topic != null) ? topic.getName():""));
out.println("<body>");
out.println("<h2>Subscriptions for Topic "+ ((topic != null) ? topic.getName():"") + "</h2>");
if (user != null) {
out.println("<table><tr><td><b>User Name:</b></td><td>"+ user.getUserName()+"</td></tr>");
out.println("<tr><td><b>User ID:</b></td><td>"+ user.getUserId()+"</td></tr>");
out.println("<tr><td><b>Access Key:</b></td><td>"+user.getAccessKey()+"</td></tr>");
out.println("<tr><td><b>Access Secret:</b></td><td>"+user.getAccessSecret()+"</td></tr>");
out.println("<tr><td><b>Topic Name:</b></td><td>"+ topic.getName()+"</td></tr>");
out.println("<tr><td><b>Topic Display Name:</b></td><td>" + topic.getDisplayName()+ "</td></tr>");
out.println("<tr><td><b>Topic Arn:</b></td><td>" + topic.getArn()+ "</td></tr>");
out.println("<tr><td><b>Num Subscriptions:</b></td><td>" + subscriptions.size()+ "</td></tr></table>");
}
out.println("<p><table><tr><td><b>Protocol</b></td><td><b>End Point</b></td><td> </td></tr>");
out.println("<form action=\"/webui/cnsuser/subscription/?userId="+userId+"&topicArn="+topicArn+"\" method=POST>");