Class ScriptedCollectionSetBuilder
- java.lang.Object
-
- org.opennms.netmgt.telemetry.protocols.collection.ScriptedCollectionSetBuilder
-
public class ScriptedCollectionSetBuilder extends java.lang.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(java.io.File script)
ScriptedCollectionSetBuilder(java.io.File script, javax.script.ScriptEngineManager manager)
ScriptedCollectionSetBuilder(java.io.File script, org.osgi.framework.BundleContext bundleContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CollectionSet
build(CollectionAgent agent, java.lang.Object message, java.lang.Long timestamp)
Builds a collection set from the given message.
-
-
-
Constructor Detail
-
ScriptedCollectionSetBuilder
public ScriptedCollectionSetBuilder(java.io.File script) throws java.io.IOException, javax.script.ScriptException
- Throws:
java.io.IOException
javax.script.ScriptException
-
ScriptedCollectionSetBuilder
public ScriptedCollectionSetBuilder(java.io.File script, org.osgi.framework.BundleContext bundleContext) throws java.io.IOException, javax.script.ScriptException
- Throws:
java.io.IOException
javax.script.ScriptException
-
ScriptedCollectionSetBuilder
public ScriptedCollectionSetBuilder(java.io.File script, javax.script.ScriptEngineManager manager) throws java.io.IOException, javax.script.ScriptException
- Throws:
java.io.IOException
javax.script.ScriptException
-
-
Method Detail
-
build
public CollectionSet build(CollectionAgent agent, java.lang.Object message, java.lang.Long timestamp) throws javax.script.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:
javax.script.ScriptException
-
-