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

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

There is a newer version: 1.0.2
Show 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:lexs="http://usdoj.gov/leisp/lexs/3.1" 
    xmlns:irsp="http://ojbc.org/IEPD/Extensions/IncidentReportStructuredPayload/1.0"
    xmlns:b="http://docs.oasis-open.org/wsn/b-2" 
    xmlns:lexsdigest="http://usdoj.gov/leisp/lexs/digest/3.1"
    xmlns:ar="http://ojbc.org/IEPD/Exchange/ArrestReport/1.0"
    xmlns:lexspd="http://usdoj.gov/leisp/lexs/publishdiscover/3.1"
    xmlns:pidres-doc="http://ojbc.org/IEPD/Exchange/PersonIdentificationResults/1.0"
    xmlns:ident-ext="http://ojbc.org/IEPD/Extensions/IdentificationExtension/1.0"
    xmlns:nc="http://release.niem.gov/niem/niem-core/3.0/"
    xmlns:j="http://release.niem.gov/niem/domains/jxdm/5.0/"
    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
    ">
    <!-- needed cxf imports -->
    <import resource="classpath:META-INF/cxf/cxf.xml" />	
    
    <!-- Error handlers in case of submission errors -->
    <import resource="error-handlers.xml" />
    
    <camel:camelContext xmlns="http://camel.apache.org/schema/spring" id="identification-reporting-service-intermediary">
        
        <!-- some CXF endpoints are inline to support testing -->	
        <camel:endpoint id="identificationReportingServiceEndpoint"
            uri="cxf:bean:IdentificationReportingService?dataFormat=PAYLOAD&amp;loggingFeatureEnabled=${identificationReportingService.cxflogging}" />
        
        <camel:endpoint id="identificationRecordingServiceEndpoint"
            uri="cxf:bean:IdentificationRecordingService?dataFormat=PAYLOAD&amp;loggingFeatureEnabled=${identificationReportingService.cxflogging}" />
        
        <camel:endpoint id="identificationReportingResponseServiceEndpoint"
            uri="cxf:bean:identificationReportingResponseService?dataFormat=PAYLOAD&amp;loggingFeatureEnabled=${identificationReportingService.cxflogging}" />
        
        <camel:endpoint id="identificationReportingResponseRecipientEndpoint"
            uri="cxf:bean:identificationReportingResponseRecipient?dataFormat=PAYLOAD&amp;loggingFeatureEnabled=${identificationReportingService.cxflogging}" />
        
        <camel:endpoint id="arrestReportingServiceEndpoint" 
			uri="cxf:bean:arrestReportingService?dataFormat=PAYLOAD&amp;loggingFeatureEnabled=${identificationReportingService.cxflogging}" />
		
        
        <!-- Identification Reporting Service Handler -->
        <camel:route id="IdentificationReportingServiceHandlerRoute">
            <camel:from uri="identificationReportingServiceEndpoint" />
            
            <camel:to uri="bean:messageProcessor?method=processRequestPayload"/>
            
            <convertBodyTo type="java.lang.String" />
            
            <camel:choice>
                <camel:when>
                    <camel:simple>${in.header.operationName} == 'ReportPersonStateIdentificationResults'</camel:simple>
                    <camel:wireTap uri="direct:processStateIdentificationResults"></camel:wireTap>
                </camel:when>
            </camel:choice>
            <camel:to uri="bean:identificationReportProcessor?method=setOperationNameAndNamespace"/>
            
            <camel:filter>
                <camel:simple>${in.header.callIdentificationRecordingService} == 'true'</camel:simple>
                <camel:removeHeaders pattern="*" excludePattern="operationName|operationNamespace|CamelDestinationOverrideUrl"></camel:removeHeaders>
                <camel:to uri="direct:callIdentificationRecordingService" />
            </camel:filter>
            
        </camel:route>
        
        <camel:route errorHandlerRef="identifcationReportErrorHandler" id="stateIdentificationReportServiceRoute">
            <camel:from uri="direct:processStateIdentificationResults" />
            
            <camel:choice>
                <camel:when>
                    <camel:xpath>normalize-space(/pidres-doc:PersonStateIdentificationResults/ident-ext:CriminalIdentificationReasonCode) ='CAR' 
                    	and normalize-space(/pidres-doc:PersonStateIdentificationResults/j:Subject/nc:RoleOfPerson/j:PersonAugmentation/j:PersonStateFingerprintIdentification[ident-ext:FingerprintIdentificationIssuedForCriminalPurposeIndicator='true']/nc:IdentificationID) != ''</camel:xpath>
                    <camel:log message="CAR state identification results, need to transform it and sent to Arresting Report Service."/>
                    <camel:to uri="xslt:xsl/arrestReportTransform.xsl?saxon=true"/>
                    
                    <camel:log message="About to call Arrest Report Service: ${body}" loggingLevel="INFO"/>
		            <camel:to uri="bean:messageProcessor?method=prepareNewExchangeResponseMessage"/>			
                    <camel:setHeader headerName="operationName"><constant>ReportArrest</constant></camel:setHeader>	
					<camel:setHeader headerName="operationNamespace"><constant>http://ojbc.org/Services/WSDL/ArrestReportingService/1.0</constant></camel:setHeader>			
					<camel:to uri="arrestReportingServiceEndpoint" />
		            <camel:log message="Called Arrest Reporting service" />
                </camel:when>
            </camel:choice>
            
        </camel:route>
        
        <camel:route errorHandlerRef="identifcationReportErrorHandler" id="CallIdentificationRecordingServiceRoute">
            <camel:from uri="direct:callIdentificationRecordingService" />
            
            <camel:log message="Inside route to call Identification Recording service"/>
            
            <camel:to
                uri="identificationRecordingServiceEndpoint" />
            <log message="Called Identification Recording service" />
        </camel:route>
        
        <!-- Identification Reporting Service Handler -->
        <camel:route id="identificationReportingResponseHandlerRoute">
        
            <camel:from uri="identificationReportingResponseServiceEndpoint" />        
        
			<camel:to uri="bean:messageProcessor?method=processRequestPayload"/>			        
            
            <camel:to uri="bean:messageProcessor?method=prepareNewExchangeResponseMessage"/>			
            
            <camel:setHeader headerName="operationName">
                <camel:simple>{{identificationReportingService.responseRecipientOperationName}}</camel:simple>
            </camel:setHeader>
            <camel:setHeader headerName="operationNamespace">
                <camel:simple>{{identificationReportingService.responseRecipientServiceNamespace}}</camel:simple>
            </camel:setHeader>
            
            <camel:log message="About to send identification recording response message to {{identificationReportingService.responseRecipientServiceEndpoint}}" />			
            
            <camel:to uri="identificationReportingResponseRecipientEndpoint" />
            
        </camel:route>
        
    </camel:camelContext>
    
    <bean id="identificationReportProcessor" class="org.ojbc.intermediaries.identificationreporting.IdentificationReportProcessor"/>
    
    <bean id="messageProcessor" class="org.ojbc.util.camel.processor.MessageProcessor" />
    
    <!-- See this thread: http://stackoverflow.com/questions/11195506/increase-executor-queue-size-in-cxf-onewayprocessorinterceptor -->
    <bean id="cxf.default.workqueue" class="org.apache.cxf.workqueue.AutomaticWorkQueueImpl">
        <property name="name" value="default" />
        <property name="queueSize" value="2048" />
    </bean>	
</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy