public interface StatusReporter
final StatusItem messagesTowardsHost = params.getStatusReporter().createStatusItem(chainId+"."+pluginName+".messagesTowardsHost", "initial value");
...
messagesTowardsHost.setStatus("new item"); // if string or other data type
// or:
messagesTowardsHost.increment(messageBatch.size()); // if integer
This interface's methods can be called safely from any thread.
Ensure that no methods are called on this object after the plug-in has been shutdown.Modifier and Type | Interface and Description |
---|---|
static interface |
StatusReporter.StatusItem
An interface that can be used to efficiently update the value associated with a single status key.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
STATUS_FAILED
A constant that should be used as the status value when a component is not currently operational due to an
error condition.
|
static java.lang.String |
STATUS_ONLINE
A constant that should be used as the status value when a component is online, operational, connected,
and ready to handles messages.
|
static java.lang.String |
STATUS_STARTING
A constant that should be used as the status value when a component is still starting, i.e.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAll()
Remove all status values set by this reporter.
|
StatusReporter.StatusItem |
createStatusItem(java.lang.String key,
long initialValue)
Creates a StatusItem interface that can be used to report status for a given key.
|
StatusReporter.StatusItem |
createStatusItem(java.lang.String key,
java.lang.String initialValue)
Creates a StatusItem interface that can be used to report status for a given key.
|
void |
setStatus(java.util.Map<java.lang.String,java.lang.String> map)
Set multiple related string status values at the same time (atomically).
|
static final java.lang.String STATUS_ONLINE
static final java.lang.String STATUS_STARTING
static final java.lang.String STATUS_FAILED
StatusReporter.StatusItem createStatusItem(java.lang.String key, java.lang.String initialValue)
key
- a unique key that will identify this status item to the host.
Typically this will include the chainId and plugin name, for example chainId+"."+pluginName+".messagesSentTowardsHost".initialValue
- the initial value for this item. Must not be null.StatusReporter.StatusItem createStatusItem(java.lang.String key, long initialValue)
StatusReporter.StatusItem.setStatus(String)
.
The status item will be automatically removed when the plug-in is shutdown.key
- a unique key that will identify this status item to the host.
Typically this will include the chainId and plugin name, for example chainId+"."+pluginName+".messagesSentTowardsHost".initialValue
- the initial value for this item.void setStatus(java.util.Map<java.lang.String,java.lang.String> map)
StatusReporter.StatusItem.setStatus(String)
should
be used instead unless there is a need to change multiple values atomically.
Any status keys set using this method will be automatically removed when the plug-in instance is shutdown.statusmap
- A map containing String keys and String values.
Null values can be used inside the map to indicate that an existing item should be cleared.
The map itself must be non-null and all keys and values must be strings.void clearAll()
This is called automatically after shutdown; there is usually no need to call it explicitly from a plug-in.
Submit a bug or feature
Copyright (c) 2013-2017 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.