use of com.predic8.membrane.core.rules.ProxyRule in project service-proxy by membrane.
the class DynamicAdminPageInterceptor method handlePruleShowRequest.
@Mapping("/admin/proxy/show/?(\\?.*)?")
public Response handlePruleShowRequest(final Map<String, String> params, String relativeRootPath) throws Exception {
StringWriter writer = new StringWriter();
final ProxyRule rule = (ProxyRule) RuleUtil.findRuleByIdentifier(router, params.get("name"));
return respond(new AdminPageBuilder(writer, router, relativeRootPath, params, readOnly) {
@Override
protected int getSelectedTab() {
return TAB_ID_PROXIES;
}
@Override
protected String getTitle() {
return super.getTitle() + " " + rule.toString() + " Proxy";
}
@Override
protected void createTabContent() throws Exception {
h1().text(rule.toString() + " Proxy").end();
if (rule.getKey().getPort() != -1) {
table();
createTr("Listen Port", "" + rule.getKey().getPort());
end();
}
h2().text("Status Codes").end();
createStatusCodesTable(rule.getStatisticsByStatusCodes());
h2().text("Interceptors").end();
createInterceptorTable(rule.getInterceptors());
}
}.createPage());
}
Aggregations