connect: building an adapter les westberg copyright 2009. all rights reserved. 1
TRANSCRIPT
Session Agenda
Review of CONNECT components
Project/source layout
Customization of adapter components
Demonstration: Replacing the CONNECT API
Copyright 2009. All Rights Reserved.2
Assumptions/Expectations
Familiarity with…
• Java
• Service Oriented Architecture (SOA)
• NetBeans
• GlassFishESB
Copyright 2009. All Rights Reserved.3
Source Code Directory Structure
DIRECTORY DESCRIPTION
C:\projects\NHINC\Current\ProductContains master ant script that compiles the CONNECT gateway and adapter
C:\projects\NHINC\Current\Product\Production
This project will contain sub folders that separate the code by its primary location (i.e. Common, Gateway, Adapter)
C:\projects\NHINC\Current\Product\Production\Adapter CONNECT adapter source
C:\projects\NHINC\Current\Product\Production\CommonSource used by both gateway and adapter
C:\projects\NHINC\Current\Product\Production\Gateway CONNECT gateway source
C:\projects\NHINC\Current\ThirdPartyContains third party libraries needed to compile
Copyright 2009. All Rights Reserved.8
Project Naming Conventions
PROJECTS ENDING IN… TYPE OF PROJECT
EJB or Ejb Enterprise java bean
Lib Java library
CA OpenESB composite application
DAOData Access (Note some data access objects are defined as Lib)
BPEL BPEL source code
JAXB Library containing JAXB bindings
Copyright 2009. All Rights Reserved.9
Special Projects
PROJECT/DIRECTORY PURPOSE
Common\InterfacesContains all of the WSDL and schemas that are being used within CONNECT
Common\PropertiesContains property files and configuration files that are used within CONNECT
Copyright 2009. All Rights Reserved.10
Web Service WSDL File Naming Conventions
Copyright 2009. All Rights Reserved.11
• First part identifies the type of service
– Adapter: Services on the adapter
– Entity: Services on the gateway which are called by the adapter
– Nhinc: Services on the gateway that are internal to the gateway
– Nhin: NHIN services hosted or called by the CONNECT gateway
• If “component” identified in second part…
– NhincComponent: Identifies internal components to the gateway
– AdapterComponent: Identifies services on the Adapter Service Bus
• Used to customize an adapter service
– EntityComponent: Identifies gateway internal services which orchestrate a message
• Rest of the name identifies the service
• Example
– AdapterComponentMpi.wsdl
XML Schema Layout and Naming Conventions
• Directory: Interfaces\src\schemas
• First level of hierarchy: identifies organization or type of schemas
• schemas\nhinc: CONNECT schemas
• schemas\nhinc\common: used in gateway and adapter
• schemas\nhinc\gateway: used in gateway
• schemas\nhinc\hl7: schemas to combine HL7 messages
Copyright 2009. All Rights Reserved.12
Connection Manager
• Manages endpoint URLs – NHIN services
– Replaceable services
• Two points of configuration– UDDI
• UDDI Update Manager service
• uddiConnectionInfo.xml: CONNECT service information cache
– Do not modify this file by hand
– Internal• Used to override UDDI settings – settings here take precedence over UDDI
• Used for non UDDI supported services
• internalConnectionInfo.xml
Copyright 2009. All Rights Reserved.13
Example internalConnectionInfo.xml
<?xml version="1.0" encoding="UTF-8"?><InternalConnectionInfos>
<internalConnectionInfo><homeCommunityId>1.1</homeCommunityId><name>DoD</name><description>DoD Description</description><services>
<service><name>subjectdiscovery</name><description>subjectdiscovery</description><endpointURL>
https://localhost:8181/PIXConsumer_Service/SubjectDiscovery</endpointURL>
</service><service>
<name>nhincsubjectdiscovery</name><description>NHIN-CONNECT Internal Subject Discovery</description><endpointURL>
http://localhost:9080/NhinConnect/NhincSubjectDiscovery</endpointURL>
</service></services>
</internalConnectionInfo></InternalConnectioninfos>
Copyright 2009. All Rights Reserved.14
Adapter Components
COMPONENT TECHNOLOGY
Document Repository EJB within adapter composite application
Document Registry EJB within adapter composite application
MPI EJB
Policy Engine BPEL within adapter composite application
Subscription Repository BPEL within adapter composite application
Re-identification EJB
Copyright 2009. All Rights Reserved.16
Steps for Customizing an EJB
Create an EJB that implements the correct web service
Undeploy the CONNECT reference EJB
Deploy the customized EJB
Copyright 2009. All Rights Reserved.17
Steps for Customizing an EJB within a Composite Application
• Create an EJB that implements the correct web service
• Undeploy AdapterCA
• Remove the EJB JBI entry from AdapterCA
• Add the customized EJB JBI entry to AdapterCA
• Deploy AdapterCA
Note: When using BPEL or deploying within a CA, you cannot have both the reference implementation and the customized implementation deployed at the same time in the same instance of GlassFish. This is because the web services are constructed using “Document Literal” bindings.
Copyright 2009. All Rights Reserved.18
Steps for Customizing a BPEL within a Composite Application
• Modify or replace the BPEL in the AdapterBPEL project
• Undeploy AdapterCA
• Clean build AdapterCA
• Redeploy AdapterCA
Note: When using BPEL or deploying within a CA, you cannot have both the reference implementation and the customized implementation deployed at the same time in the same instance of GlassFish. This is because the web services are constructed using “Document Literal” bindings.
Copyright 2009. All Rights Reserved.19
Demo: Replace with a Customized MPI
CONNECT 2.0 Adapter Reference MPI
• Simple XML text file (mpi.xml)
• Service reads and writes to this text file
Demonstration• Replace MPI with a MySQL
database implementation
Copyright 2009. All Rights Reserved.21
Demonstration
• The following steps have been completed previously– Installation of gateway and adapter
– Internal self-test of gateway and adapter
– Installation and population of MySQL database for the MPI (§5.2)
– Library using hibernate to store/retrieve from the MPI database (§5.3)
– Add new transform to transforms library (§5.4)
• Steps shown in the demonstration– Creation of MPI EJB (§5.5)
– Fix EJB build.xml file (§5.5)
– Code to call the MPI repository library (§5.6)
– Deployment to GlassFish (§5.7)
– Running SoapUI tests to verify the replacement of the component (§5.8)
Copyright 2009. All Rights Reserved.22
Will be Posted on the Release 2.0 of Web Site
http://www.connectopensource.org/display/NHINR2/Release+2.0+Home
http://www.connectopensource.org/display/NHINR2/Release+2.0+Home
Adapter MPI Example
Copyright 2009. All Rights Reserved.24