public class BackendManager extends Object implements AgentDetailsHolder
JmxRequest| Constructor and Description |
|---|
BackendManager(Configuration pConfig,
LogHandler pLogHandler)
Construct a new backend manager with the given configuration and which allows
every operation (no restrictor)
|
BackendManager(Configuration pConfig,
LogHandler pLogHandler,
Restrictor pRestrictor)
Construct a new backend manager with the given configuration.
|
BackendManager(Configuration pConfig,
LogHandler pLogHandler,
Restrictor pRestrictor,
boolean pLazy)
Construct a new backend manager with the given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
convertExceptionToJson(Throwable pExp,
JmxRequest pJmxReq)
Convert a Throwable to a JSON object so that it can be included in an error response
|
void |
debug(String msg)
Log at debug level
|
void |
destroy()
Remove MBeans
|
void |
error(String message,
Throwable t)
Log at error level.
|
AgentDetails |
getAgentDetails()
Get the details for the agent which can be updated or used
|
org.json.simple.JSONObject |
handleRequest(JmxRequest pJmxReq)
Handle a single JMXRequest.
|
void |
info(String msg)
Log at info level
|
boolean |
isDebug()
Whether debug is switched on
|
boolean |
isOriginAllowed(String pOrigin,
boolean pStrictChecking)
Check whether CORS access is allowed for the given origin.
|
boolean |
isRemoteAccessAllowed(String pRemoteHost,
String pRemoteAddr)
Check whether remote access from the given client is allowed.
|
public BackendManager(Configuration pConfig, LogHandler pLogHandler)
pConfig - configuration used for tuning this handler's behaviourpLogHandler - loggerpublic BackendManager(Configuration pConfig, LogHandler pLogHandler, Restrictor pRestrictor)
pConfig - configuration used for tuning this handler's behaviourpLogHandler - loggerpRestrictor - a restrictor for limiting access. Can be null in which case every operation is allowedpublic BackendManager(Configuration pConfig, LogHandler pLogHandler, Restrictor pRestrictor, boolean pLazy)
pConfig - configuration map used for tuning this handler's behaviourpLogHandler - loggerpRestrictor - a restrictor for limiting access. Can be null in which case every operation is allowedpLazy - whether the initialisation should be done lazypublic org.json.simple.JSONObject handleRequest(JmxRequest pJmxReq) throws InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException
pJmxReq - request to performInstanceNotFoundExceptionAttributeNotFoundExceptionReflectionExceptionMBeanExceptionIOExceptionpublic Object convertExceptionToJson(Throwable pExp, JmxRequest pJmxReq)
pExp - throwable to convertpJmxReq - the request from where to take the serialization optionspublic void destroy()
public boolean isRemoteAccessAllowed(String pRemoteHost, String pRemoteAddr)
pRemoteHost - remote host to check against. Can be null if no reverse lookup is configured.pRemoteAddr - alternative IP addresspublic boolean isOriginAllowed(String pOrigin, boolean pStrictChecking)
pOrigin - origin URL which needs to be checkedpStrictChecking - whether to a strict check (i.e. server side check)public void info(String msg)
msg - to logpublic void debug(String msg)
msg - message to logpublic void error(String message, Throwable t)
message - message to logt - ecxeption occuredpublic boolean isDebug()
public AgentDetails getAgentDetails()
getAgentDetails in interface AgentDetailsHolderCopyright © 2017. All rights reserved.