summaryrefslogtreecommitdiffstats
path: root/src/org.gluster.storage.management.gateway/src/spring/gluster-server-base.xml
blob: 43a0aadb635a758dd210b14a799a6bba7649bcc4 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!--
    Copyright (c) 2006-2011 Gluster, Inc. <http://www.gluster.com>
    This file is part of Gluster Management Gateway.
   
    Gluster Management Gateway is free software; you can redistribute
    it and/or modify it under the terms of the GNU General Public
    License as published by the Free Software Foundation; either
    version 3 of the License, or (at your option) any later version.
   
    Gluster Management Gateway is distributed in the hope that it
    will be useful, but WITHOUT ANY WARRANTY; without even the
    implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    PURPOSE.  See the GNU General Public License for more details.
   
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see
    <http://www.gnu.org/licenses/>.
 -->

<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" xmlns:task="http://www.springframework.org/schema/task"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="
   http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
   http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
   http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd 
   http://www.springframework.org/schema/tx  http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
	<context:component-scan base-package="org.gluster.storage.management.gateway" />
	<task:scheduler id="taskScheduler" />
	<task:executor id="taskExecutor" pool-size="1" />
	<task:annotation-driven executor="taskExecutor" scheduler="taskScheduler" />

	<!-- Syncs discovered servers and cluster-server mapping. -->
	<task:scheduled-tasks>
		<task:scheduled ref="serverSyncTask" method="perform" fixed-delay="60000" />
	</task:scheduled-tasks>

	<!-- This task keeps checking status of disk migration tasks (wherever auto-commit is set to true)
	so that auto-commit can be performed as soon as the migration is complete -->
	<!-- task:scheduled-tasks>
		<task:scheduled ref="brickMigrationStatusTask" method="checkMigrationStatus" fixed-delay="60000" />
	</task:scheduled-tasks-->

	<!-- Discovery mechanism. Valid values: multicast, none -->
	<bean id="discoveryMechanism" class="java.lang.String">
		<constructor-arg value="multicast" />
	</bean>

	<!-- SSH timeouts - all in milliseconds. zero means no timeout. -->
	<!-- Connect the underlying TCP socket to the server with the given timeout value (SSH) -->
	<bean id="sshConnectTimeout" class="java.lang.Integer">
		<constructor-arg value="10000" />
	</bean>
	<!-- Timeout for complete connection establishment (SSH) -->
	<bean id="sshKexTimeout" class="java.lang.Integer">
		<constructor-arg value="60000" />
	</bean>
	<!-- Command execution timeout (SSH) -->
	<bean id="sshExecTimeout" class="java.lang.Integer">
		<constructor-arg value="120000" />
	</bean>
	
	<!-- Gluster Management Gateway Version -->
	<bean id="appVersion" class="java.lang.String">
		<constructor-arg value="@VERSION@" />
	</bean>

	<!-- Gluster Management Gateway Data Version -->
	<bean id="dataVersion" class="java.lang.String">
		<constructor-arg value="1.0.0" />
	</bean>

	<!-- Derby embedded data source -->
	<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" lazy-init="false">
		<property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver" />
		<property name="url" value="jdbc:derby:/opt/glustermg/data;create=true" />
		<property name="username" value="gluster" />
		<property name="password" value="syst3m" />
	</bean>

	<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="jpaVendorAdapter">
			<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
				<property name="showSql" value="true" />
				<property name="generateDdl" value="false" />
				<property name="databasePlatform" value="org.hibernate.dialect.DerbyDialect" />
			</bean>
		</property>
	</bean>

	<bean
        class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

	<bean id="clusterDao" class="org.gluster.storage.management.gateway.data.PersistenceDao">
		<constructor-arg type="java.lang.Class">
			<value>org.gluster.storage.management.gateway.data.ClusterInfo</value>
		</constructor-arg>
	</bean>

	<bean id="serverDao" class="org.gluster.storage.management.gateway.data.PersistenceDao">
		<constructor-arg type="java.lang.Class">
			<value>org.gluster.storage.management.gateway.data.ServerInfo</value>
		</constructor-arg>
	</bean>
	
	<!-- bean id="dataSourceFactory" class="org.gluster.storage.management.gateway.data.GlusterDataSource" />
		<bean id="dataSource" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
		<property name="targetObject">
		<ref local="dataSourceFactory" />
		</property>
		<property name="targetMethod">
		<value>getDataSource</value>
		</property>
		</bean -->

	<!-- bean id="dataSource" class="org.gluster.storage.management.gateway.data.GlusterDataSource"
		lazy-init="false" autowire="byType" / -->

	<bean class="org.gluster.storage.management.gateway.tasks.InitServerTask" init-method="initServer" depends-on="dataSource">
		<property name="dataSource" ref="dataSource" />
	</bean>
</beans>