3.7.2 Adding a custom adapter
Please follow below steps for adding a new custom adapter:
- Create a new project for customized adapter interfaces. Typically, there will be only one customized adapter interfaces project. The name of the project should have the phrase ‘cz’ indicating that it is customized version. For example, com.ofss.digx.cz.extxface.
- Please refer to the ‘Workspace Setup’ section and its ‘Adapter Interfaces’ subsection for details.
- Add required adapter interfaces in this project
- Create another new project for customized adapter implementation classes. Typically, one project will need to be created per entity, however if the core banking host is same for different entities, then one project can be used for multiple entities. This decision should be taken based on implementation scenario. If you are interfacing with any other external system apart from core banking system (e.g. content management system), then separate project should be created for adapters interfacing with such systems.
- Please refer to the ‘Workspace Setup’ section and its ‘Adapter Implementation’ subsection for details.
- Name of the project should be having the phrase ‘cz’ indicating that it is part
of the customization. The name should also include external system name and
version. This will bring clarity about contents of the project by looking at the
name. The same name will be used for the JAR packaged out of this project. For
example, name of the project for customized adapters for UBS 12.4 will be
com.ofss.digx.cz.extxface.ubs124.impl
. - The
MANIFEST.MF
file within this project should have implementation title and implementation version. The implementation title should also capture the phrase ‘CZ’ to indicate that it is a customized adapter package.
Implementation-Title: CZUBS
Implementation-Version: 12.4
- Write required adapter implementation classes that implement appropriate adapter interface.
- Create folder ‘META-INF/services’ under the ‘src’ folder.
- Create a file under this ‘services’ folder with the name as fully qualified name of the adapter interface.
- In this file, write the fully qualified name of the adapter implementation class.
- Package the adapter interface in JAR.
- Package the adapter implementation project(s) in JAR(s).
- Configure the adapter implementation package in
digx_fw_config_all_b
. The prop_value should have comma separated external system IDs.For example,
Insert into digx_fw_config_all_b PROP_ID,CATEGORY_ID,PROP_VALUE,FACTORY_SHIPPED_FLAG,PROP_COMMENTS, SUMMARY_TEXT,CREATED_BY,CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATED_DATE, OBJECT_STATUS,OBJECT_VERSION_NUMBER,EDITABLE,CATEGORY_DESCRIPTION) values ('01','extxfaceadapterconfig', 'CZUBS12.4,UBS12.4,ipm1.0','N',null,'', 'ofssuser',sysdate,'ofssuser', sysdate,'Y',1,'N',null);
- Package all customized adapters in obapi.cz.extsystem.domain.ear and deploy it as a library
Customizing existing adapters (Custom Adapter)
If an added functionality or replacement functionality is required for an existing adapter or existing method in an adapter, the customization developer has to develop a new adapter and corresponding adapter factory and override the method in a new custom adapter class. The custom adapter would have to override and implement the methods which need changes.
Custom Adapter Example
We take the example of LoanApplicationRequirementAdapter. For example the requirement is to send an email alert when the requirements of a particular loan application are updated. The OBAPI application by default does not provide any integration with an SMTP/Email server. The additional interfacing with the gateway can be done in the custom adapter. . The following steps would have to be followed for implementation of a custom LoanApplicationRequirementAdapter.
Develop a CustomLoanApplicationRequirementAdapter
and Custom
LoanApplicationRequirementAdapterFactory
. As a guideline, the custom
adapter should extend the existing adapter and override the methods which needs to
be replaced with new functionality.
For Example:
Custom Adapter Configuration
insert into digx_fw_config_all_b
(PROP_ID, CATEGORY_ID, PROP_VALUE, FACTORY_SHIPPED_FLAG, PROP_COMMENTS, SUMMARY_TEXT,
CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATED_DATE, OBJECT_STATUS_FLAG,
OBJECT_VERSION_NUMBER)
values (‘IS_LOAN_APPLICATION_REQUIREMNT_ADAPTER_CUSTOM', ‘customadapterconfig’,
'true', 'N','asdf', 'asdf', 'asdf', '', 'asdf', '', 'Y', 1);
Parent topic: Adapter Tier