Class ScriptedCollectionSetBuilder
- java.lang.Object
-
- org.opennms.netmgt.telemetry.protocols.collection.ScriptedCollectionSetBuilder
-
public class ScriptedCollectionSetBuilder extends Object
Uses an external script, executed via JSR-223, to generate aCollectionSet
from some given object using theCollectionSetBuilder
.- Author:
- jwhite
-
-
Constructor Summary
Constructors Constructor Description ScriptedCollectionSetBuilder(File script)
ScriptedCollectionSetBuilder(File script, ScriptEngineManager manager)
ScriptedCollectionSetBuilder(File script, org.osgi.framework.BundleContext bundleContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CollectionSet
build(CollectionAgent agent, Object message, Long timestamp)
Builds a collection set from the given message.
-
-
-
Constructor Detail
-
ScriptedCollectionSetBuilder
public ScriptedCollectionSetBuilder(File script) throws IOException, ScriptException
- Throws:
IOException
ScriptException
-
ScriptedCollectionSetBuilder
public ScriptedCollectionSetBuilder(File script, org.osgi.framework.BundleContext bundleContext) throws IOException, ScriptException
- Throws:
IOException
ScriptException
-
ScriptedCollectionSetBuilder
public ScriptedCollectionSetBuilder(File script, ScriptEngineManager manager) throws IOException, ScriptException
- Throws:
IOException
ScriptException
-
-
Method Detail
-
build
public CollectionSet build(CollectionAgent agent, Object message, Long timestamp) throws ScriptException
Builds a collection set from the given message. WARNING: This method is not necessarily thread safe. This depends on the script, and the script engine that is being used.- Parameters:
agent
- the agent associated with the collection setmessage
- the messaged passed to script containing the metrics- Returns:
- a collection set
- Throws:
ScriptException
-
-