public class AdaptorController extends Object
Constructor and Description |
---|
AdaptorController() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
addAdaptor(javax.servlet.ServletContext context,
String viewType,
String postBody)
Adds an adaptor to the agent and returns the adaptor info.
|
protected static void |
appendElement(StringBuilder out,
String name,
Object value,
Object... attributeNvps)
XML helper to append an Element and it's child text value.
|
protected static void |
appendEndTag(StringBuilder out,
String name)
XML helper to append a Element end tag.
|
protected static void |
appendNvp(StringBuilder out,
int indent,
String name,
Object value)
Helper for appending name/value pairs to the ServletOutputStream in the
format [name]: [value] with indent number of spaces prepended.
|
protected static void |
appendNvp(StringBuilder out,
int indent,
String name,
Object value,
boolean stringLiteral)
Helper for appending name/value pairs to the ServletOutputStream in the
format [name]: [value] with indent number of spaces prepended.
|
protected static void |
appendNvp(StringBuilder out,
String name,
Object value)
Helper for appending name/value pairs to the ServletOutputStream in the
format [name]: [value]
|
protected static void |
appendStartTag(StringBuilder out,
String name,
Object... attributeNvps)
XML helper to append a Element start tag.
|
protected String |
buildAdaptorText(ChukwaAgent agent,
String adaptorId)
Renders info for one or all adaptors in plain text (YAML).
|
protected String |
buildAdaptorXML(ChukwaAgent agent,
String adaptorId)
Renders info for one or all adaptors in XML.
|
javax.ws.rs.core.Response |
getAdaptor(javax.servlet.ServletContext context,
String viewType,
String adaptorId)
Get a single adaptor
|
javax.ws.rs.core.Response |
getAdaptors(javax.servlet.ServletContext context,
String viewType)
Get all adaptors
|
protected static void |
indent(StringBuilder out,
int indent)
Helper to insert a number of spaces into the output stream.
|
javax.ws.rs.core.Response |
removeAdaptor(javax.servlet.ServletContext context,
String adaptorId)
Remove an adaptor from the agent
|
public javax.ws.rs.core.Response addAdaptor(@Context javax.servlet.ServletContext context, String viewType, String postBody)
context
- servletContextviewType
- type of view to return (text|xml)postBody
- JSON post bodypublic javax.ws.rs.core.Response removeAdaptor(@Context javax.servlet.ServletContext context, String adaptorId)
context
- ServletContextadaptorId
- id of adaptor to remove.public javax.ws.rs.core.Response getAdaptors(@Context javax.servlet.ServletContext context, String viewType)
context
- ServletContextviewType
- type of view to return (text|xml)public javax.ws.rs.core.Response getAdaptor(@Context javax.servlet.ServletContext context, String viewType, String adaptorId)
context
- ServletContextviewType
- type of view to return (text|xml)adaptorId
- id of the adaptor to returnprotected String buildAdaptorXML(ChukwaAgent agent, String adaptorId)
protected String buildAdaptorText(ChukwaAgent agent, String adaptorId)
protected static void appendNvp(StringBuilder out, String name, Object value)
protected static void appendNvp(StringBuilder out, int indent, String name, Object value)
protected static void appendNvp(StringBuilder out, int indent, String name, Object value, boolean stringLiteral)
protected static void indent(StringBuilder out, int indent)
protected static void appendStartTag(StringBuilder out, String name, Object... attributeNvps)
protected static void appendEndTag(StringBuilder out, String name)
protected static void appendElement(StringBuilder out, String name, Object value, Object... attributeNvps)
Copyright © 2013 Apache Software Foundation. All Rights Reserved.