All Downloads are FREE. Search and download functionalities are using the official Maven repository.

OSGI-INF.blueprint.blueprint.xml Maven / Gradle / Ivy

There is a newer version: 3.0.1
Show newest version
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0" >

    <!-- Configuration properties -->
    <cm:property-placeholder id="datasourceProperties" persistent-id="org.opennms.alec.datasource.opennms.kafka" update-strategy="reload">
        <cm:default-properties>
            <cm:property name="alarmTopic" value="alarms"/>
            <cm:property name="alarmFeedbackTopic" value="alarmFeedback"/>
            <cm:property name="nodeTopic" value="nodes"/>
            <cm:property name="eventSinkTopic" value="OpenNMS.Sink.Events"/>
            <cm:property name="inventoryTopic" value="alec-inventory"/>
            <cm:property name="edgesTopic" value="edges"/>
            <cm:property name="inventoryTtlMs" value="86400000"/> <!-- 24 hours -->
            <cm:property name="inventoryGcIntervalMs" value="300000"/> <!-- 5 minutes -->
            <cm:property name="scriptFile" value="" /> <!--  use empty string to use default script included in bundle" -->
            <cm:property name="scriptCacheMillis" value="30000"/>  <!-- 30 seconds -->
            <cm:property name="wrapSinkMessagesInProto" value="true"/>
        </cm:default-properties>
    </cm:property-placeholder>

    <bean id="scriptService" class="org.opennms.alec.datasource.opennms.OpennmsKafkaScriptedInventory">
        <argument value="${scriptFile}"/>
        <argument value="${scriptCacheMillis}"/>
        <argument ref="blueprintBundleContext"/>
    </bean>
    <service ref="scriptService" interface="org.opennms.alec.datasource.opennms.ScriptedInventoryService"/>

    <bean id="nodeToInventory" class="org.opennms.alec.datasource.opennms.NodeToInventory">
        <argument ref="scriptService"/>
    </bean>

    <bean id="alarmToInventory" class="org.opennms.alec.datasource.opennms.AlarmToInventory">
        <argument ref="scriptService"/>
    </bean>

    <bean id="edgeToInventory" class="org.opennms.alec.datasource.opennms.EdgeToInventory">
        <argument ref="scriptService"/>
    </bean>

    <reference id="configAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" />
    <reference id="sinkWrapper" interface="org.opennms.alec.integrations.opennms.sink.api.SinkWrapper" />

    <bean id="opennmsDatasource" class="org.opennms.alec.datasource.opennms.OpennmsDatasource" init-method="init" destroy-method="destroy">
        <argument ref="configAdmin"/>
        <argument ref="nodeToInventory"/>
        <argument ref="alarmToInventory"/>
        <argument ref="edgeToInventory"/>
        <argument ref="sinkWrapper"/>
        <property name="alarmTopic" value="${alarmTopic}"/>
        <property name="alarmFeedbackTopic" value="${alarmFeedbackTopic}"/>
        <property name="nodeTopic" value="${nodeTopic}"/>
        <property name="eventSinkTopic" value="${eventSinkTopic}"/>
        <property name="inventoryTopic" value="${inventoryTopic}"/>
        <property name="inventoryTtlMs" value="${inventoryTtlMs}"/>
        <property name="inventoryGcIntervalMs" value="${inventoryGcIntervalMs}"/>
        <property name="wrapSinkMessagesInProto" value="${wrapSinkMessagesInProto}"/>
    </bean>
    <service ref="opennmsDatasource" interface="org.opennms.alec.datasource.api.AlarmDatasource"/>
    <service ref="opennmsDatasource" interface="org.opennms.alec.datasource.api.AlarmFeedbackDatasource"/>
    <service ref="opennmsDatasource" interface="org.opennms.alec.datasource.api.InventoryDatasource"/>
    <service ref="opennmsDatasource" interface="org.opennms.alec.datasource.api.SituationDatasource"/>

</blueprint>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy