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

META-INF.spring.camel-context.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Unless explicitly acquired and licensed from Licensor under another license, the contents of
    this file are subject to the Reciprocal Public License ("RPL") Version 1.5, or subsequent
    versions as allowed by the RPL, and You may not copy or use this file in either source code
    or executable form, except in compliance with the terms and conditions of the RPL

    All software distributed under the RPL is provided strictly on an "AS IS" basis, WITHOUT
    WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND LICENSOR HEREBY DISCLAIMS ALL SUCH
    WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
    PARTICULAR PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT. See the RPL for specific language
    governing rights and limitations under the RPL.

    http://opensource.org/licenses/RPL-1.5

    Copyright 2012-2015 Open Justice Broker Consortium

-->
<!-- Configures the Camel Context -->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns:camel="http://camel.apache.org/schema/spring"
	xmlns:cxf="http://camel.apache.org/schema/cxf" 
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
       http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd">
       
	<camel:camelContext xmlns="http://camel.apache.org/schema/spring" id="disposition-connector">
	
		<endpoint id="fileDropTestInputEndpoint"
			uri="file:///${warrantModConnnector.fileInputDir}/input?idempotent=true&amp;moveFailed=${warrantModConnnector.fileInputDir}/error&amp;readLock=changed&amp;readLockCheckInterval=2500&amp;delete=true" />
				
		<camel:endpoint id="warrantModificationRequestIntermediaryEndpoint"
			uri="cxf:bean:warrantModRequestService?dataFormat=PAYLOAD&amp;loggingFeatureEnabled=${warrantModConnnector.cxfLogging}" />			
			
		<endpoint id="warrantModConnectorResultsHandlerEndpoint"
			uri="cxf:bean:warrantModResultsHandlerService?dataFormat=PAYLOAD&amp;loggingFeatureEnabled=${warrantModConnnector.cxfLogging}" />		
		
		<endpoint id="initiateWarrantModificationRequestTimerEndpoint"
			uri="quartz2://warrantModConnector/checkQualifiedWarrants?cron={{warrantModConnnector.checkForAcceptedWarrantsCronExpression}}" />
		
		<camel:route id="warrantModConnectorRequest_route">
		
			<from uri="fileDropTestInputEndpoint" />
		
			<log message="\n\n\n warrantModRequestTest_route... \n\n\n"/>
	
			<to uri="bean:warrantModMockInputProcessor?method=prepareMockInputMessage" />
	
			<camel:setHeader headerName="federatedQueryRequestGUID">
				<constant>12345</constant>				
			</camel:setHeader>
	
			<camel:setHeader headerName="operationName">
				<constant>SubmitWarrantModificationRequest</constant>
			</camel:setHeader>
			
			<camel:setHeader headerName="operationNamespace">
				<constant>http://ojbc.org/Services/WSDL/WarrantModificationRequestService/1.0</constant>
			</camel:setHeader>
								
			<to uri="warrantModificationRequestIntermediaryEndpoint" />
			
		</camel:route>		
		
		<camel:route id="checkDatabaseForAcceptedWarrantsRoute" autoStartup="{{warrantModConnnector.checkForAcceptedWarrants}}">
			<camel:from uri="initiateWarrantModificationRequestTimerEndpoint"/>
			<setBody>
       			<constant>SELECT WarrantID FROM Warrant WHERE StateWarrantRepositoryID is not null AND warrantModRequestSent = false</constant>
     		</setBody>
     		<to uri="jdbc:dataSource?outputType=StreamList"/>
     		<camel:split>
     			<camel:simple>${body}</camel:simple>
	     		<camel:log message="sql result: ${body}"></camel:log>
	     		<camel:to uri="bean:initiateWarrantModificationRequestProcessor?method=createWarrantModificationRequest"/>
	     		<camel:to uri="direct:sendWarrantModificationRequest"/>
     		</camel:split>
			<camel:log message="Trigger Fired"></camel:log>
		</camel:route>
		
		<camel:route id="sendWarrantModificationRoute">
			<camel:from uri="direct:sendWarrantModificationRequest"/>
			<camel:setHeader headerName="operationName">
				<constant>SubmitWarrantModificationRequest</constant>
			</camel:setHeader>
			
			<camel:setHeader headerName="operationNamespace">
				<constant>http://ojbc.org/Services/WSDL/WarrantModificationRequestService/1.0</constant>
			</camel:setHeader>
											
			<to uri="warrantModificationRequestIntermediaryEndpoint" />
			<camel:log message="Warrant sent for warrantID: ${header.warrantId}"></camel:log>
     		<camel:to uri="bean:warrantsRepositoryBaseDaoImpl?method=updateWarrantModificationRequestSentIndicator"/>
		</camel:route>		
		
		<!--  Warrants Mod Results Handler Route.  Called by Intermediary -->
		<camel:route id="warrantModConnectorResultsHandler_route">
		
			<camel:from uri="warrantModConnectorResultsHandlerEndpoint"/>
			<camel:to uri="bean:messageProcessor?method=processRequestPayload"/>
			<camel:log message="\nConnector receieved WarrantModResponse: \n ${body} \n" />
     		<camel:to uri="bean:warrantModificationResponseProcessor?method=process"/>
			
		</camel:route>						
		
	</camel:camelContext>
	
	<bean id="messageProcessor" class="org.ojbc.util.camel.processor.MessageProcessor" />
	
	<bean id="warrantModMockInputProcessor" 
		class="org.ojbc.connectors.warrantmod.WarrantModMockInputProcessor" />	
			
	<bean id="quartz2" class="org.apache.camel.component.quartz2.QuartzComponent">
	    <property name="startDelayedSeconds" value="2"/>
	</bean>	
</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy