Skip to content

Commit

Permalink
Update data sources
Browse files Browse the repository at this point in the history
Updates to data sources for admin, api, and enterprise
  • Loading branch information
Jared Koester committed Jan 12, 2022
1 parent ab1b093 commit e051452
Show file tree
Hide file tree
Showing 3 changed files with 213 additions and 63 deletions.
150 changes: 150 additions & 0 deletions onebusaway-admin-webapp/src/main/resources/data-sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,35 @@
value="true" />
</bean>

<!-- Database Connection Configuration for Agency Metadata -->
<bean id="agencyMetadataDataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="java:comp/env/jdbc/agencyMetadataDB"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
<property name="resourceRef"
value="true" />
</bean>
<!-- Database Connection Configuration for Bundle Build Response -->
<bean id="bundleBuildResponseDataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="java:comp/env/jdbc/appDB"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
<property name="resourceRef"
value="true" />
</bean>

<alias name="dataSource" alias="mutableDataSource" />
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"
primary="true">
Expand Down Expand Up @@ -72,6 +101,35 @@
<property name="session" ref="mailSession"/>
</bean>

<!-- Database Connection Configuration for retrieving archived data -->
<bean id="gtfsRealtimeArchiveDataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="java:comp/env/jdbc/archiveDB"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
<property name="resourceRef"
value="true" />
</bean>

<!-- Database Connection Configuration for retrieving assigned vehicle data -->
<bean id="assignedVehicleDataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="java:comp/env/jdbc/appDB"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
<property name="resourceRef"
value="true" />
</bean>

<!-- Other Stuff: -->

Expand Down Expand Up @@ -122,7 +180,99 @@
</property>
</bean>

<bean id="agencyMetadataSessionFactory"
class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="agencyMetadataDataSource" />
<property name="annotatedClasses">
<list>
<value>org.onebusaway.agency_metadata.model.AgencyMetadata</value>
<value>org.onebusaway.agency_metadata.service.AgencyMetadataDaoImpl</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.connection.pool_size">1</prop>
<!--<prop key="hibernate.current_session_context_class">thread</prop>-->
<prop key="hibernate.cache.provider_class">org.hibernate.cache.internal.NoCachingRegionFactory</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.jdbc.batch_size">1000</prop>
</props>
</property>
</bean>
<bean id="bundleBuildResponseSessionFactory"
class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="bundleBuildResponseDataSource" />
<property name="annotatedClasses">
<list>
<value>org.onebusaway.admin.model.BundleBuildResponse</value>
<value>org.onebusaway.admin.service.bundle.impl.BundleBuildResponseDaoImpl</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.connection.pool_size">1</prop>
<!--<prop key="hibernate.current_session_context_class">thread</prop>-->
<prop key="hibernate.cache.provider_class">org.hibernate.cache.internal.NoCachingRegionFactory</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.jdbc.batch_size">1000</prop>
</props>
</property>
</bean>

<bean id="gtfsRealtimeArchiveSessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="gtfsRealtimeArchiveDataSource" />
<property name="annotatedClasses">
<list>
<value>org.onebusaway.admin.service.bundle.task.model.GtfsBundleInfo</value>
<value>org.onebusaway.admin.service.bundle.impl.GtfsArchiveDaoImpl</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.connection.pool_size">1</prop>
<!--<prop key="hibernate.current_session_context_class">thread</prop>-->
<prop key="hibernate.cache.provider_class">org.hibernate.cache.internal.NoCachingRegionFactory</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">none</prop>
<prop key="hibernate.jdbc.batch_size">1000</prop>
<prop key="hibernate.order_inserts">false</prop>
<prop key="hibernate.order_updates">false</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/onebusaway/gtfs/model/GtfsArchiveMapping.hibernate.xml</value>
</list>
</property>
</bean>

<bean id="assignmentSessionFactory"
class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="assignedVehicleDataSource" />
<property name="annotatedClasses">
<list>
<value>org.onebusaway.admin.model.assignments.Assignment</value>
<value>org.onebusaway.admin.model.assignments.AssignmentConfig</value>
<value>org.onebusaway.admin.service.assignments.impl.AssignmentDaoImpl</value>
<value>org.onebusaway.admin.service.assignments.impl.AssignmentConfigDaoImpl</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.connection.pool_size">1</prop>
<!--<prop key="hibernate.current_session_context_class">thread</prop>-->
<prop key="hibernate.cache.provider_class">org.hibernate.cache.internal.NoCachingRegionFactory</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.jdbc.batch_size">1000</prop>
</props>
</property>
</bean>

<!-- quartz scheduling for PingJob -->
<bean name="pingJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
Expand Down
60 changes: 30 additions & 30 deletions onebusaway-api-webapp/src/main/resources/data-sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,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="
xmlns:context="http://www.springframework.org/schema/context"
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">

Expand All @@ -29,33 +29,33 @@
</bean>

<bean id="apiKeyValidationService" class="org.onebusaway.users.impl.validation.KeyValidationServiceImpl"/>
<!-- Database Configuration -->

<!-- Database Configuration -->
<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="java:comp/env/jdbc/appDB"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
<property name="resourceRef"
value="true" />
</bean>
<bean id="agencyMetadataDataSource"
<property name="jndiName"
value="java:comp/env/jdbc/appDB"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
<property name="resourceRef"
value="true" />
</bean>
<bean id="agencyMetadataDataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="java:comp/env/jdbc/appDB"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
<property name="resourceRef"
value="true" />
<property name="jndiName"
value="java:comp/env/jdbc/appDB"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
<property name="resourceRef"
value="true" />
</bean>
<bean id="agencyMetadataSessionFactory"
class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
Expand All @@ -78,12 +78,12 @@
</props>
</property>
</bean>
<bean class="org.onebusaway.container.spring.PropertyOverrideConfigurer">

<bean class="org.onebusaway.container.spring.PropertyOverrideConfigurer">
<property name="properties">
<props>
<prop key="cacheManager.cacheManagerName">org.onebusaway.api_webapp.cacheManager</prop>
</props>
</property>
</bean>
</beans>
</bean>
</beans>
66 changes: 33 additions & 33 deletions onebusaway-enterprise-webapp/src/main/resources/data-sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,52 +16,52 @@
limitations under the License.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
<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:aop="http://www.springframework.org/schema/aop"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">


<!-- Transit Data Service -->

<bean id="transitDataService" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
<property name="serviceUrl" value="http://localhost:8080/onebusaway-transit-data-federation-webapp/remoting/transit-data-service" />
<property name="serviceInterface" value="org.onebusaway.transit_data.services.TransitDataService" />
</bean>

<bean id="configurationServiceClient" class="org.onebusaway.util.impl.configuration.ConfigurationServiceClientFileImpl" >
<constructor-arg type="java.lang.String" value="/var/lib/obanyc/config.json"/>
</bean>
<!-- Transit Data Service -->

<bean id="transitDataService" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
<property name="serviceUrl" value="http://localhost:8080/onebusaway-transit-data-federation-webapp/remoting/transit-data-service" />
<property name="serviceInterface" value="org.onebusaway.transit_data.services.TransitDataService" />
</bean>

<!-- Database Configuration -->
<bean id="configurationServiceClient" class="org.onebusaway.util.impl.configuration.ConfigurationServiceClientFileImpl" >
<constructor-arg type="java.lang.String" value="/var/lib/obanyc/config.json"/>
</bean>

<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="java:comp/env/jdbc/appDB"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
<property name="resourceRef"
value="true" />
</bean>
<!-- Database Configuration -->

<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="java:comp/env/jdbc/appDB"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
<property name="resourceRef"
value="true" />
</bean>

<alias name="dataSource" alias="mutableDataSource" />
<alias name="dataSource" alias="mutableDataSource" />



<!-- Other Stuff: -->
<bean id="serviceAreaServiceImpl" class="org.onebusaway.presentation.impl.ServiceAreaServiceImpl" />
<bean id="externalGeocoderImpl"
class="org.onebusaway.geocoder.enterprise.impl.EnterpriseGoogleGeocoderImpl" depends-on="serviceAreaServiceImpl">
class="org.onebusaway.geocoder.enterprise.impl.EnterpriseGoogleGeocoderImpl" depends-on="serviceAreaServiceImpl">
</bean>

<bean class="org.onebusaway.container.spring.PropertyOverrideConfigurer">
Expand All @@ -73,7 +73,7 @@
</bean>

<bean id="siriCacheService"
class="org.onebusaway.presentation.services.cachecontrol.SiriCacheServiceImpl">
class="org.onebusaway.presentation.services.cachecontrol.SiriCacheServiceImpl">
<property name="disabled" value="${siri.cache.disabled}" />
</bean>
<!--
Expand All @@ -92,4 +92,4 @@
</bean>
-->
<import resource="classpath:branded-sources.xml" />
</beans>
</beans>

0 comments on commit e051452

Please sign in to comment.