public class HealthCenterFactory
extends java.lang.Object
Constructor and Description |
---|
HealthCenterFactory() |
Modifier and Type | Method and Description |
---|---|
static HealthCenter |
connect(ConnectionProperties props)
Connects to and monitors a running application that was started with the
Health Center agent attached.
|
static HealthCenter |
connect(ConnectionProperties props,
boolean autoScan)
Connects to and monitors a running application that was started with the
Health Center agent attached.
|
static HealthCenter |
connect(ConnectionProperties props,
java.lang.String agentName)
Connects to and monitors a running application that was started with the
named Health Center agent attached.
|
static HealthCenter |
connect(java.io.File filename)
Loads a previously created Health Center
.hcd file. |
static java.lang.String[] |
scanForAgents(ConnectionProperties props,
int numberOfAgents)
This method returns the names of the available agents that are running on
a specific connection and is mainly used when searching for multiple agents that
are all connected to a single MQTT broker.
|
static int[] |
scanForPort(ConnectionProperties props,
int numberOfScans,
boolean stopWhenFound)
This method scans a group of ports for available agents that are running.
|
static void |
setMemoryRestictionEnabled(boolean enableMemoryRestriction)
Sets whether to set memory restriction on or off.
|
static void |
setMemoryRestrictionSize(long userMemoryRestrictionSize)
Sets the maximum amount of memory to be used by the Health Center process
when connecting a
.hcd file. |
public static HealthCenter connect(java.io.File filename) throws HealthCenterException, java.io.FileNotFoundException
.hcd
file. This
will not return until the file has been completely loaded. This ensures
that all the data has been loaded and processedfilename
- - the file to load.HealthCenterException
java.io.FileNotFoundException
public static HealthCenter connect(ConnectionProperties props) throws HealthCenterException, HealthCenterJMXException, HealthCenterSSLException
props
- a ConnectionProperties object, which contains details of what
to connect to.HealthCenterException
HealthCenterJMXException
HealthCenterSSLException
public static HealthCenter connect(ConnectionProperties props, boolean autoScan) throws HealthCenterException, HealthCenterJMXException, HealthCenterSSLException
props
- a ConnectionProperties object, which contains details of what
to connect to.autoScan
- set to true
if you want to connect to the first
available agent.HealthCenterException
HealthCenterJMXException
HealthCenterSSLException
public static HealthCenter connect(ConnectionProperties props, java.lang.String agentName) throws HealthCenterException, HealthCenterJMXException, HealthCenterSSLException
props
- a ConnectionProperties object, which contains details of what
to connect to.agentName
- the name of the agent to connect toHealthCenterException
HealthCenterJMXException
HealthCenterSSLException
public static int[] scanForPort(ConnectionProperties props, int numberOfScans, boolean stopWhenFound) throws HealthCenterException
props
- this object contains information such as the host to search
and the starting port.numberOfScans
- the number of ports to scan. The more scans that are made, the
longer this process takes.stopWhenFound
- setting this to true
stops the scan after the
first agent is found.HealthCenterException
public static java.lang.String[] scanForAgents(ConnectionProperties props, int numberOfAgents) throws HealthCenterException
props
- this object contains the hostname and port to search onnumberOfAgents
- the maximum number of agent names to return but you will get
less if fewer agents are available. The larger the number, the
longer this process takes. To bring back all agent names,
enter 0.HealthCenterException
public static void setMemoryRestrictionSize(long userMemoryRestrictionSize)
.hcd
file. This method must be called
before connecting to the file to ensure the memory restriction is set as
requested. If not called before connecting or if the value is not larger
than the default of 200mb then the default is used instead.userMemoryRestrictionSize
- - the value of the memory to use, in bytes.public static void setMemoryRestictionEnabled(boolean enableMemoryRestriction)
enableMemoryRestriction
- true
or false