} catch (Exception ex) {
logger.error("event=get_topic_attributes topic_arn=" + topicArn + " user_id=" + userId, ex);
throw new ServletException(ex);
}
CMBPolicy policy = null;
try {
if (attributes.get("Policy") != null && !attributes.get("Policy").equals("") && !attributes.get("Policy").equals("null")) {
policy = new CMBPolicy(attributes.get("Policy"));
}
} catch (Exception ex) {
throw new ServletException(ex);
}
out.println("<html>");
header(request, out, "Permissions for Topic "+ Util.getNameFromTopicArn(topicArn));
out.println("<body>");
out.println("<h2>Permissions for Topic "+ Util.getNameFromTopicArn(topicArn) + "</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>"+Util.getNameFromTopicArn(topicArn)+"</td></tr>");
out.println("<tr><td><b>Topic Arn:</b></td><td>"+topicArn+"</td></tr></table><br>");
}
if (policy != null && !policy.getStatements().isEmpty()) {
List<CMBStatement> stmts = policy.getStatements();
if (stmts != null && stmts.size() > 0) {
out.println("<span class='content'><table border='1' width='70%'><tr><th>Effect</th><th>Users</th><th>Actions</th><th>Label</th><th> </th></tr>");
}