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

META-INF.spring.subscription-management-routes.xml Maven / Gradle / Ivy

<?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-2017 Open Justice Broker Consortium

-->
<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:tx="http://www.springframework.org/schema/tx"
	xmlns:chc-report-doc="http://ojbc.org/IEPD/Exchange/CriminalHistoryConsolidationReport/1.0"
	xmlns:che-report-doc="http://ojbc.org/IEPD/Exchange/CriminalHistoryExpungementReport/1.0"
	xmlns:chiu-report-doc="http://ojbc.org/IEPD/Exchange/CriminalHistoryIdentifierUpdateReport/1.0"
	xmlns:chc-report-ext="http://ojbc.org/IEPD/Extensions/CriminalHistoryConsolidationReport/Extension/1.0"
	xmlns:che-report-ext="http://ojbc.org/IEPD/Extensions/CriminalHistoryExpungementReport/Extension/1.0"
	xmlns:chiu-report-ext="http://ojbc.org/IEPD/Extensions/CriminalHistoryIdentifierUpdateReport/Extension/1.0"
	xmlns:chr-report-doc="http://ojbc.org/IEPD/Exchange/CriminalHistoryRestorationReport/1.0"
	xmlns:chr-report-ext="http://ojbc.org/IEPD/Extensions/CriminalHistoryRestorationReport/Extension/1.0"
	xmlns:chid-report-doc="http://ojbc.org/IEPD/Exchange/CriminalHistoryIdentifierDeletionReport/1.0"
	xmlns:chid-report-ext="http://ojbc.org/IEPD/Extensions/CriminalHistoryIdentifierDeletionReport/Extension/1.0"
	xmlns:chdu-report-doc="http://ojbc.org/IEPD/Exchange/CriminalHistoryDemographicsUpdateReport/1.0"
	xmlns:chr-doc="http://ojbc.org/IEPD/Exchange/CriminalHistoryReport/1.0"
	xmlns:chr-ext="http://ojbc.org/IEPD/Extensions/CriminalHistoryReportExtension/1.0"
	xmlns:j="http://release.niem.gov/niem/domains/jxdm/5.0/" 
	xmlns:j51="http://release.niem.gov/niem/domains/jxdm/5.1/"
	xmlns:nc="http://release.niem.gov/niem/niem-core/3.0/"
	xmlns:util="http://www.springframework.org/schema/util"
	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://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
	   http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd	   
	   http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">

	<routeContext id="subscription-management-routes" xmlns="http://camel.apache.org/schema/spring">	
			
		<!-- Criminal History Update Reporting flow -->
		<route id="criminalHistoryUpdateReportingServiceRoute">
			<from uri="criminalHistoryUpdateReportingServiceEndpoint" />
			<onException>
				<exception>java.lang.Exception</exception>
				<handled><constant>true</constant></handled>
				<camel:log message="An exception was thrown: ${exception.cause.message}"
					loggingLevel="WARN" />
				<setHeader headerName="CamelFileName">
					<simple>FailedCriminalHistoryUpdate_${date:now:yyyyMMdd}_${date:now:HHmmssSS}.xml</simple>
				</setHeader>	
				<to uri="criminalHistoryConsolidationFailedFileEndpoint"/>
			</onException>
			<camel:to uri="bean:messageProcessor?method=processRequestPayload"/>
			
			<camel:filter>
				<camel:xpath>/chdu-report-doc:CriminalHistoryDemographicsUpdateReport</camel:xpath>
				
				<camel:to uri="direct:processCriminalHistoryDemographicsUpdateReport"/>			

			</camel:filter>			
			
			<camel:filter>
				<camel:xpath>/chc-report-doc:CriminalHistoryConsolidationReport</camel:xpath>

				<camel:setHeader headerName="currentSid">
					<camel:xpath resultType="java.lang.String">/chc-report-doc:CriminalHistoryConsolidationReport/nc:Person/chc-report-ext:PreConsolidationIdentifiers/j:PersonStateFingerprintIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="newSid">
					<camel:xpath resultType="java.lang.String">/chc-report-doc:CriminalHistoryConsolidationReport/nc:Person/chc-report-ext:PostConsolidationIdentifiers/j:PersonStateFingerprintIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="currentUcn">
					<camel:xpath resultType="java.lang.String">/chc-report-doc:CriminalHistoryConsolidationReport/nc:Person/chc-report-ext:PreConsolidationIdentifiers/j:PersonFBIIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="newUcn">
					<camel:xpath resultType="java.lang.String">/chc-report-doc:CriminalHistoryConsolidationReport/nc:Person/chc-report-ext:PostConsolidationIdentifiers/j:PersonFBIIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="consolidationType">
					<constant>criminalHistoryConsolidationReport</constant>
				</camel:setHeader>
				<camel:setHeader headerName="consolidationJurisdiction">
					<camel:xpath resultType="java.lang.String">/chc-report-doc:CriminalHistoryConsolidationReport/chc-report-ext:CriminalHistoryReportJurisdictionCode</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="transactionNumber">
					<camel:xpath resultType="java.lang.String">/chc-report-doc:CriminalHistoryConsolidationReport/chc-report-ext:FingerprintIdentificationTransactionIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				
				<camel:filter>
					<camel:xpath>/chc-report-doc:CriminalHistoryConsolidationReport/nc:Person/chc-report-ext:PreConsolidationIdentifiers/j:PersonStateFingerprintIdentification/chc-report-ext:FingerprintIdentificationIssuedForCriminalPurposeIndicator='true'</camel:xpath>
					<camel:setHeader headerName="fingerprintPurpose">
						<constant>criminal</constant>
					</camel:setHeader>				
				</camel:filter>

				<camel:filter>
					<camel:xpath>/chc-report-doc:CriminalHistoryConsolidationReport/nc:Person/chc-report-ext:PreConsolidationIdentifiers/j:PersonStateFingerprintIdentification/chc-report-ext:FingerprintIdentificationIssuedForCivilPurposeIndicator='true'</camel:xpath>
					<camel:setHeader headerName="fingerprintPurpose">
						<constant>civil</constant>
					</camel:setHeader>				
				</camel:filter>
				
			</camel:filter>

			<camel:filter>
				<camel:xpath>/che-report-doc:CriminalHistoryExpungementReport</camel:xpath>

				<camel:setHeader headerName="currentSid">
					<camel:xpath resultType="java.lang.String">/che-report-doc:CriminalHistoryExpungementReport/nc:Person/che-report-ext:ExpungementIdentifiers/j:PersonStateFingerprintIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="currentUcn">
					<camel:xpath resultType="java.lang.String">/che-report-doc:CriminalHistoryExpungementReport/nc:Person/che-report-ext:ExpungementIdentifiers/j:PersonFBIIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="consolidationType">
					<constant>criminalHistoryExpungementReport</constant>
				</camel:setHeader>
				<camel:setHeader headerName="consolidationJurisdiction">
					<camel:xpath resultType="java.lang.String">/che-report-doc:CriminalHistoryExpungementReport/che-report-ext:CriminalHistoryReportJurisdictionCode</camel:xpath>
				</camel:setHeader>
				
				<camel:filter>
					<camel:xpath>/che-report-doc:CriminalHistoryExpungementReport/nc:Person/che-report-ext:ExpungementIdentifiers/j:PersonStateFingerprintIdentification/che-report-ext:FingerprintIdentificationIssuedForCriminalPurposeIndicator='true'</camel:xpath>
					<camel:setHeader headerName="fingerprintPurpose">
						<constant>criminal</constant>
					</camel:setHeader>				
				</camel:filter>

				<camel:filter>
					<camel:xpath>/chc-report-doc:CriminalHistoryConsolidationReport/nc:Person/chc-report-ext:PreConsolidationIdentifiers/j:PersonStateFingerprintIdentification/che-report-ext:FingerprintIdentificationIssuedForCivilPurposeIndicator='true'</camel:xpath>
					<camel:setHeader headerName="fingerprintPurpose">
						<constant>civil</constant>
					</camel:setHeader>				
				</camel:filter>				
			</camel:filter>
			
			<camel:filter>
				<camel:xpath>/chid-report-doc:CriminalHistoryIdentifierDeletionReport</camel:xpath>

				<camel:log message="Identifier deletion requested.  Treated as expungement report." />

				<camel:setHeader headerName="currentSid">
					<camel:xpath resultType="java.lang.String">/chid-report-doc:CriminalHistoryIdentifierDeletionReport/nc:Person/chid-report-ext:IdentifierDeletionIdentifiers/j:PersonStateFingerprintIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="currentUcn">
					<camel:xpath resultType="java.lang.String">/chid-report-doc:CriminalHistoryIdentifierDeletionReport/nc:Person/chid-report-ext:IdentifierDeletionIdentifiers/j:PersonFBIIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="consolidationType">
					<constant>criminalHistoryExpungementReport</constant>
				</camel:setHeader>
				<camel:setHeader headerName="consolidationJurisdiction">
					<camel:xpath resultType="java.lang.String">/chid-report-doc:CriminalHistoryIdentifierDeletionReport/chid-report-ext:CriminalHistoryReportJurisdictionCode</camel:xpath>
				</camel:setHeader>
			</camel:filter>			
			
			<camel:filter>
				<camel:xpath>/chiu-report-doc:CriminalHistoryIdentifierUpdateReport</camel:xpath>

				<camel:setHeader headerName="currentSid">
					<camel:xpath resultType="java.lang.String">/chiu-report-doc:CriminalHistoryIdentifierUpdateReport/nc:Person/chiu-report-ext:PreIdentifierUpdateIdentifiers/j:PersonStateFingerprintIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="newSid">
					<camel:xpath resultType="java.lang.String">/chiu-report-doc:CriminalHistoryIdentifierUpdateReport/nc:Person/chiu-report-ext:PostIdentifierUpdateIdentifiers/j:PersonStateFingerprintIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="currentUcn">
					<camel:xpath resultType="java.lang.String">/chiu-report-doc:CriminalHistoryIdentifierUpdateReport/nc:Person/chiu-report-ext:PreIdentifierUpdateIdentifiers/j:PersonFBIIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="newUcn">
					<camel:xpath resultType="java.lang.String">/chiu-report-doc:CriminalHistoryIdentifierUpdateReport/nc:Person/chiu-report-ext:PostIdentifierUpdateIdentifiers/j:PersonFBIIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="consolidationType">
					<constant>criminalHistoryIdentifierUpdateReport</constant>
				</camel:setHeader>		
				<camel:setHeader headerName="consolidationJurisdiction">
					<camel:xpath resultType="java.lang.String">/chiu-report-doc:CriminalHistoryIdentifierUpdateReport/chiu-report-ext:CriminalHistoryReportJurisdictionCode</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="transactionNumber">
					<camel:xpath resultType="java.lang.String">/chiu-report-doc:CriminalHistoryIdentifierUpdateReport/chiu-report-ext:FingerprintIdentificationTransactionIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				
				<camel:filter>
					<camel:xpath>/chiu-report-doc:CriminalHistoryIdentifierUpdateReport/nc:Person/chiu-report-ext:PreIdentifierUpdateIdentifiers/j:PersonStateFingerprintIdentification/chiu-report-ext:FingerprintIdentificationIssuedForCriminalPurposeIndicator='true'</camel:xpath>
					<camel:setHeader headerName="fingerprintPurpose">
						<constant>criminal</constant>
					</camel:setHeader>				
				</camel:filter>

				<camel:filter>
					<camel:xpath>/chiu-report-doc:CriminalHistoryIdentifierUpdateReport/nc:Person/chiu-report-ext:PreIdentifierUpdateIdentifiers/j:PersonStateFingerprintIdentification/chiu-report-ext:FingerprintIdentificationIssuedForCivilPurposeIndicator='true'</camel:xpath>
					<camel:setHeader headerName="fingerprintPurpose">
						<constant>civil</constant>
					</camel:setHeader>				
				</camel:filter>					
			</camel:filter>
			
			<camel:filter>
				<camel:xpath>/chr-report-doc:CriminalHistoryRestorationReport</camel:xpath>

				<camel:setHeader headerName="currentUcn">
					<camel:xpath resultType="java.lang.String">/chr-report-doc:CriminalHistoryRestorationReport/nc:Person/chr-report-ext:RestorationIdentifiers/j:PersonFBIIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				
				<camel:setHeader headerName="transactionNumber">
					<camel:xpath resultType="java.lang.String">/chr-report-doc:CriminalHistoryRestorationReport/chr-report-ext:FingerprintIdentificationTransactionIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				<camel:setHeader headerName="consolidationType">
					<constant>criminalHistoryRestorationReport</constant>
				</camel:setHeader>		
				
				<camel:setHeader headerName="consolidationJurisdiction">
					<camel:xpath resultType="java.lang.String">/chr-report-doc:CriminalHistoryRestorationReport/chr-report-ext:CriminalHistoryReportJurisdictionCode</camel:xpath>
				</camel:setHeader>

			</camel:filter>			
			
			<camel:filter>
				<camel:xpath>/chr-doc:CriminalHistoryReport</camel:xpath>
			
				<camel:setHeader headerName="currentUcn">
					<camel:xpath resultType="java.lang.String">/chr-doc:CriminalHistoryReport/nc:Person/j51:PersonAugmentation/j51:PersonFBIIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				
				<camel:setHeader headerName="transactionNumber">
					<camel:xpath resultType="java.lang.String">/chr-doc:CriminalHistoryReport/chr-ext:TransactionDescriptiveRecord/chr-ext:RapBackSubscription/chr-ext:FingerprintIdentificationTransactionIdentification/nc:IdentificationID</camel:xpath>
				</camel:setHeader>
				
				<log message="Saving Subsequent Results for Criminal History Update"/>
					
				<camel:to uri="bean:subscriptionNotificationReportingProcessor?method=processFbiNotificationReport"/>	
			
				<camel:stop/>
			</camel:filter>
			
			<camel:log message="Current SID: ${in.headers.currentSid}, New SID:  ${in.headers.newSid}"/>
			<camel:log message="Current UCN ${in.headers.currentUcn}, New UCN:  ${in.headers.newUcn}"/>
			<camel:log message="Transaction Number ${in.headers.transactionNumber}"/>
			<camel:log message="Consolidation Type ${in.headers.consolidationType}, Consolidation Jurisdiction:  ${in.headers.consolidationJurisdiction}, fingerprint purpose: ${in.headers.fingerprintPurpose}"/>
			
			<camel:filter>
				<camel:simple>${in.headers.consolidationJurisdiction} == 'State'</camel:simple>
				
				<camel:choice>
					<camel:when>
						<camel:simple>${in.headers.consolidationType} == 'criminalHistoryExpungementReport'</camel:simple>
						
						<log message="Process state expungement"/>
						<to uri="bean:criminalHistoryConsolidationProcessor?method=expungeCriminalHistoryState" />
						<log message="State Criminal History expunged"/>
										
					</camel:when>
					<camel:when>
						<camel:simple>${in.headers.consolidationType} == 'criminalHistoryIdentifierUpdateReport' or ${in.headers.consolidationType} == 'criminalHistoryConsolidationReport'</camel:simple>
						<to uri="bean:criminalHistoryConsolidationProcessor?method=consolidateCriminalHistoryState" />
						<log message="State Criminal History consolidated"/>
					</camel:when>
							
					<camel:otherwise>
						<log message="State Operation not recognized"/>
					</camel:otherwise>
				</camel:choice>
			</camel:filter>
			
			<camel:filter>
				<camel:simple>${in.headers.consolidationJurisdiction} == 'FBI'</camel:simple>
				
				<!-- Save subsequent results for only consolidations and restorations, not expungements -->
				<camel:filter>
					<camel:simple>${in.headers.consolidationType} == 'criminalHistoryConsolidationReport' or ${in.headers.consolidationType} == 'criminalHistoryRestorationReport' or ${in.headers.consolidationType} == 'criminalHistoryIdentifierUpdateReport'</camel:simple>
					<log message="Saving Subsequent Results"/>
					<camel:to uri="bean:subscriptionNotificationReportingProcessor?method=processFbiNotificationReport"/>
					
				</camel:filter>
				
				<camel:choice>
					<camel:when>
						<camel:simple>${in.headers.consolidationType} == 'criminalHistoryRestorationReport'</camel:simple>
						
						<log message="Process federal restoration"/>
						<to uri="bean:criminalHistoryConsolidationProcessor?method=federalUCNRestoration" />
						<log message="Federal Criminal History expunged"/>
										
					</camel:when>
					<camel:when>
						<camel:simple>${in.headers.consolidationType} == 'criminalHistoryExpungementReport' or ${in.headers.consolidationType} == 'criminalHistoryConsolidationReport' </camel:simple>
						<to uri="bean:criminalHistoryConsolidationProcessor?method=consolidateCriminalHistoryFederal" />
						<log message="Federal Criminal History consolidated"/>
					</camel:when>
							
					<camel:otherwise>
						<log message="Federal Operation not recognized"/>
					</camel:otherwise>
				</camel:choice>				
				
			</camel:filter>
			
			<log message="Body: ${body}"/>
			
			<!-- Report new federal subscriptions with the UCN that was added  -->
			<camel:wireTap uri="direct:updateSubscriptions">
				<body><simple>${body}</simple></body>
			</camel:wireTap>
			
			<camel:to uri="direct:sendConsolidationsEmail"/>
		</route>
		
		<route>
			<camel:from uri="direct:sendConsolidationsEmail"/>
			
			<camel:split>
				<!-- The body is a map of Email Notifications -->
				<camel:simple>${body}</camel:simple>

				<camel:to uri="bean:criminalHistoryConsolidationProcessor?method=returnCamelEmail"/>
					
				<camel:log message="headers: ${in.headers}" />

				<camel:log message="The email address(es) ${in.header.to} will be sent a CH consolidation notification.  To: ${in.header.to}, CC: ${in.header.cc}, BCC: ${in.header.bcc}."
					logName="notificationLogger" />
	
				<camel:filter>
					<camel:simple>${properties:rapbackDatastoreAdapter.sendConsolidationNotificationEmails} == true</camel:simple>
					<camel:to uri="smtpEndpoint" />
				</camel:filter>

			</camel:split>
		</route>

		<route id="directUpdateSubscriptionsRoute">
			<camel:from uri="direct:updateSubscriptions"/>

			<camel:split>
				<!-- The body is a map of Subscriptions -->
				<camel:simple>${in.header.subscriptionsToModify}</camel:simple>


				<camel:log message="Subscription to Add ${body}"/>
			
				<!-- Create OJB OJBC_Subscription_Document.xml here -->
				<to uri="bean:subscriptionModificationXMLProcessor?method=createOJBCsubscriptionDocument" />
				
				<camel:log message="Subscription message: ${body}"/>
				
				<camel:to uri="bean:messageProcessor?method=prepareNewExchangeResponseMessage"/>
			
				<!-- Call broker here -->
				<camel:setHeader headerName="operationName">
		            <constant>Subscribe</constant>
		        </camel:setHeader>
		        
		        <camel:setHeader headerName="operationNamespace">
		            <constant>http://docs.oasis-open.org/wsn/brw-2</constant>
		        </camel:setHeader>

				<camel:delay>
					<constant>1000</constant>
				</camel:delay>
							
				<camel:to uri="notificationBrokerServiceEndpoint"/>
				
			</camel:split>			

		</route>
		
		<route>
			<camel:from uri="direct:processCriminalHistoryDemographicsUpdateReport"/>
			
			<camel:log message="Processing demographics update"/>
			
			<camel:to uri="bean:criminalHistoryDemographicUpdateProcessor?method=processCriminalHistoryDemographicsUpdate"/>
			
			<camel:log message="Subscriptions to update: ${in.headers.subscriptionsToModify}"/>
			
			<camel:to uri="direct:updateSubscriptions"/>
			
			<camel:stop/>
			
		</route>
		
		<!-- Automatically Archive idled records flow -->
		<route id="automaticArchivingCivilRoute">
			<from uri="automaticArchivingCivilTimerEndpoint" />
			<to uri="bean:rapbackDAO?method=archiveCivilIdentifications" />
			<log message="Automatic archiving civil identifications completed"/>
		</route>
		
		<route id="automaticArchivingCriminalRoute">
			<from uri="automaticArchivingCriminalTimerEndpoint" />
			<to uri="bean:rapbackDAO?method=archiveCriminalIdentifications" />
			<log message="Automatic archiving completed"/>
		</route>
	</routeContext>
</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy