Class AbstractRemoteServiceCollector
- java.lang.Object
-
- org.opennms.netmgt.collection.api.AbstractServiceCollector
-
- org.opennms.netmgt.collection.api.AbstractRemoteServiceCollector
-
- All Implemented Interfaces:
ServiceCollector
- Direct Known Subclasses:
HttpCollector
,JdbcCollector
,JMXCollector
,NSClientCollector
,PrometheusCollector
,VmwareCimCollector
,VmwareCollector
,WmiCollector
,WsManCollector
,XmlCollector
public abstract class AbstractRemoteServiceCollector extends AbstractServiceCollector
Generic code for aServiceCollector
which is expected to run on both OpenNMS and Minion. This class takes care of performing the necessary marshaling and unmarshaling of parameters with the help of a type map provided by the implementation.- Author:
- jwhite
-
-
Constructor Summary
Constructors Constructor Description AbstractRemoteServiceCollector()
AbstractRemoteServiceCollector(Map<String,Class<?>> parameterTypeMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEffectiveLocation(String location)
Allows the collector to override the location at which it should be run.Map<String,String>
marshalParameters(Map<String,Object> parameters)
Marshal the parameter values to strings, which is necessary for passing the parameters over the wire for the RPC call.Map<String,Object>
unmarshalParameters(Map<String,String> parameters)
Unmarshal the parameter values from strings.-
Methods inherited from class org.opennms.netmgt.collection.api.AbstractServiceCollector
getRuntimeAttributes, initialize, validateAgent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.collection.api.ServiceCollector
collect, getRrdRepository
-
-
-
-
Method Detail
-
getEffectiveLocation
public String getEffectiveLocation(String location)
Description copied from interface:ServiceCollector
Allows the collector to override the location at which it should be run. This call will always be performed in OpenNMS.- Specified by:
getEffectiveLocation
in interfaceServiceCollector
- Overrides:
getEffectiveLocation
in classAbstractServiceCollector
- Parameters:
location
- location associated with the service to be monitored- Returns:
- a possibly updated location
-
marshalParameters
public Map<String,String> marshalParameters(Map<String,Object> parameters)
Description copied from interface:ServiceCollector
Marshal the parameter values to strings, which is necessary for passing the parameters over the wire for the RPC call. We delegate this task to theServiceCollector
instead of handling it elsewhere since the API, and RPC module do not have access to the model objects used by the collector. This will only be called in OpenNMS when the collector is to be executed remotely.- Specified by:
marshalParameters
in interfaceServiceCollector
- Overrides:
marshalParameters
in classAbstractServiceCollector
- Returns:
-
unmarshalParameters
public Map<String,Object> unmarshalParameters(Map<String,String> parameters)
Description copied from interface:ServiceCollector
Unmarshal the parameter values from strings. This call will always be performed in Minion.- Specified by:
unmarshalParameters
in interfaceServiceCollector
- Overrides:
unmarshalParameters
in classAbstractServiceCollector
- Returns:
-
-