summaryrefslogtreecommitdiffstats
path: root/src/main/resources/validation-cmd-beans.xml
blob: 8c317d46d629b5d23e2176e86d926cec6fc1c833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

  <context:component-scan base-package="org.onap.aai.nodes,org.onap.aai.setup">
    <!-- Exclude EdgesConfiguration since edge rules are not required -->
    <context:exclude-filter type="assignable" expression="org.onap.aai.config.EdgesConfiguration" />
  </context:component-scan>

  <bean id="configTranslator" class="org.onap.aai.setup.AAIConfigTranslator" />

  <bean id="nodeIngestor" class="org.onap.aai.nodes.NodeIngestor">
    <constructor-arg ref="configTranslator" />
  </bean>

  <context:property-placeholder location="file:${CONFIG_HOME}/rule-indexing.properties"
    ignore-unresolvable="true" ignore-resource-not-found="true" />

  <context:property-placeholder
    location="
        classpath:event-reader.properties,
        file:${CONFIG_HOME}/aai-environment.properties,
        file:${CONFIG_HOME}/validation-service.properties,
        file:${CONFIG_HOME}/validation-service-auth.properties,
        file:${CONFIG_HOME}/schemaIngest.properties"
    ignore-unresolvable="true" />

  <bean id="eventReaderConfig" class="org.onap.aai.validation.config.EventReaderConfig">
    <property name="eventDomainPath" value="${event.domain.path}" />
    <property name="eventActionPath" value="${event.action.path}" />
    <property name="eventTypePath" value="${event.type.path}" />
    <property name="entityTypePath" value="${event.entity.type.path}" />
    <property name="topEntityTypePath" value="${event.entity.type.top.path}" />
    <property name="entityLinkPath" value="${event.entity.link.path}" />
    <property name="entityLinkDelimiter" value="${event.entity.link.delimiter}" />
    <property name="entityPath" value="${event.entity.path}" />
    <property name="nestedEntityPath" value="${event.entity.nested.path}" />
    <property name="entityIdPath" value="${entity.id.path}" />
    <property name="entityResourceVersionPath" value="${entity.resource.version.path}" />
  </bean>

  <bean id="jsonReader" class="org.onap.aai.validation.reader.JsonReader" />

  <bean id="schemaVersionBean" class="org.onap.aai.setup.SchemaVersion">
    <constructor-arg value="${schema.version.api.default}" />
  </bean>

  <bean id="ruleIndexingConfig" class="org.onap.aai.validation.config.RuleIndexingConfig">
    <property name="indexedEvents" value="#{'${rule.indexing.events}'.split(',')}" />
    <property name="excludedOxmValidationEvents" value="#{'${rule.indexing.exclude.oxm.validation}'.split(',')}" />
    <property name="indexAttributes" value="#{'${rule.indexing.key.attributes}'.split(',')}" />
    <property name="defaultIndexKey" value="${rule.indexing.default.key}" />
  </bean>

  <bean id="eventReader" class="org.onap.aai.validation.reader.EventReader">
    <constructor-arg ref="eventReaderConfig" />
    <constructor-arg ref="jsonReader" />
    <constructor-arg ref="oxmReader" />
  </bean>

  <bean id="oxmReader" class="org.onap.aai.validation.reader.OxmReader" init-method="init">
    <constructor-arg ref="nodeIngestor" />
    <constructor-arg ref="schemaVersionBean" />
  </bean>

  <bean id="rulesConfigurationPath" class="java.nio.file.Paths" factory-method="get">
    <constructor-arg value="${APP_HOME}/bundleconfig/etc/rules/" />
    <constructor-arg>
      <array />
    </constructor-arg>
  </bean>

  <bean id="ruleDrivenValidator" class="org.onap.aai.validation.ruledriven.RuleDrivenValidator">
    <constructor-arg ref="rulesConfigurationPath" />
    <constructor-arg ref="oxmReader" />
    <constructor-arg ref="eventReader" />
    <constructor-arg ref="ruleIndexingConfig" />
  </bean>

</beans>