aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/webapp/WEB-INF/beans-services.xml
blob: c41bc034735ca37187a76f304ff0dc8bb65c16aa (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
<?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:jaxrs="http://cxf.apache.org/jaxrs"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:websocket="http://www.springframework.org/schema/websocket"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/websocket
       http://www.springframework.org/schema/websocket/spring-websocket.xsd">


    <!-- CXF -->
    <context:component-scan base-package="org.openecomp.sdcrests"/>

    <!-- Needed for JSR-303 validations. May be removed when moving to JAX-RS 2.0 -->
    <bean class="org.springframework.validation.beanvalidation.MethodValidationPostProcessor"/>

    <bean id="jacksonObjectMapper" class="org.codehaus.jackson.map.ObjectMapper">
        <property name="serializationInclusion" value="NON_NULL"/>
    </bean>

    <bean id="jsonProvider" class="org.codehaus.jackson.jaxrs.JacksonJsonProvider">
        <property name="mapper" ref="jacksonObjectMapper"/>
    </bean>

    <!-- WEB-SOCKETS -->
    <websocket:handlers allowed-origins="*">
        <websocket:mapping path="/notificationHandler" handler="notificationHandler"/>
        <websocket:handshake-handler ref="handshakeHandler"/>
    </websocket:handlers>

    <bean id="newNotificationsReader" class="org.openecomp.sdc.notification.workers.impl.NewNotificationsReaderRestImpl"/>

    <bean id="notificationWorker" class="org.openecomp.sdc.notification.workers.NotificationWorker">
        <constructor-arg ref="newNotificationsReader"/>
    </bean>

    <bean id="notificationHandler" class="org.openecomp.sdc.notification.websocket.NotificationWebsocketHandler">
        <constructor-arg ref="notificationWorker"/>
    </bean>

    <bean class="org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean">
        <property name="maxTextMessageBufferSize" value="8192"/>
        <property name="maxBinaryMessageBufferSize" value="8192"/>
    </bean>

    <bean id="handshakeHandler" class="org.springframework.web.socket.server.support.DefaultHandshakeHandler">
        <constructor-arg ref="upgradeStrategy"/>
    </bean>

    <bean id="upgradeStrategy" class="org.springframework.web.socket.server.jetty.JettyRequestUpgradeStrategy">
        <constructor-arg ref="serverFactory"/>
    </bean>

    <bean id="serverFactory" class="org.eclipse.jetty.websocket.server.WebSocketServerFactory">
        <constructor-arg>
            <bean class="org.eclipse.jetty.websocket.api.WebSocketPolicy">
                <constructor-arg value="SERVER"/>
                <property name="inputBufferSize" value="8092"/>
                <property name="idleTimeout" value="600000"/>
            </bean>
        </constructor-arg>
    </bean>

</beans>