Temenos Connector Plug-ins
TEMENOS EDUCATION CENTRE
Warning: This document, is protected by copyright law and international treaties. No part of this document
may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of TEMENOS HEADQUARTERS SA Unauthorized
reproduction or distribution of this presentation or any portion of it, may result in severe civil and criminal
penalties, and will be prosecuted to the maximum extent possible under applicable law.” Information in this
document is subject to change without notice
Objectives
After completing this learning unit/course, you will be able to
Define plug-in
Types of plug-ins
Default plug-ins
Plug-in oriented TCServer Architecture
User defined plug-ins
Slide 2
What is a Plug-in?
A plug-in is a small unit of code
Independent from the core of the TCServer
Basically plug-ins are jar files
You already know two plug-ins namely,
Listener
Adapter
Types of plug-ins
There are 4 types of plug-ins :
Listener
Splitter
Adapter
Formatter
Adapters, Formatters, Listeners And Splitters
Listener
API
Allow III party systems to communicate with TCS
The common listener receives requests through a port
Splitter
Split requests/responses
Adapter
Send out data from TCS
The common adapter enables communication with T24 via tSS
Formatter
Format requests/responses
Request formatter
Response formatter
Slide 5
Rules for plug-ins
Starting up default plug-ins
Why being plug-in oriented
To extend / upgrade the TCServer functionalities without touching at the
core
Customers to define what the TCServer does (interfaces)
To be more secure in a fact that you can remove the functionalities you
won’t activate
Slide 8
The TCServer API
The TCServer API is contained in the package com.temenos.tocf.tcs.API.
In that package, five classes are available :
AbstractListener, AbstractAdapter, AbstractFormatter, AbstractSplitter and
TimeStamps
Slide 9
Listener Types
atmlistener
byteslistener
mqlistener
ssllistener
filelistener
jconsrvlistener
t24evtlistener
batchfilelistener
jmslistener
rawtcplistener
tcplistener
Slide 10
Slide 11
Slide 12
File Listener and Batch File Listener
File Listener Batch File Listener
Cannot process more than one Processes more than one message
message in a single file in a single file
Suitable for static batch updates Suitable for a clearing file and high-
and not so high volumes volume files can also be used for
static updates
Not required
Has inbuilt scalability and duplicate
checking which is essential for
financial entry
Doesn’t spawn the requests across
multiple tSS sessions
Sends the request across all
available tSS threads
Built especially to process inward
SWIFT messages
Built to all other feeds into T24
Slide 13
Slide 14
Task
Create two formatters and a splitter attach it to a listener at TCS these
formatter(s) should execute the enquiry CURRENCY-LIST on the T24
Server. The same ENQUIRY REQUEST you need pass twice use the
delimiter as + to split two ENQUIRY REQUESTS.
Slide 15
To achieve this task you need …
Split the request into 2 Splitter
Supply user name and Formatter
password
Supply enquiry name Formatter
Slide 16
An Example of a Splitter
Format of a request that is to be sent to TCS
+ is the delimiter
Supply the user name and password to the request
Supply the enquiry name to the request
Slide 17
TCS Plug-in Helper
Useful utility to create Plug-in(s)
Available in the TCS’s bin directory
Windows : TCPluginsHelper.bat and on Unix : TCPluginsHelper.sh
A Java Developer Kit (JDK) version 1.4.1 or above required
The TCServer version 1.4.0 or above required
Allows you to create
Formatters
Adapters
Listeners
Splitters
Slide 18
Using the TCPluginsHelper
The TCPluginsHelper only needs 2 files to work.
The script TCPluginsHelper.bat (or TCPpluginsHelper.sh) to start it, (it
is in the folder of the TCServer under ./bin) and the Jar file
tcpluginshelper.jar (under ./lib).
The permissions minimums to apply to the script have to be read and
execute (rx) and read (r) for the jar file.
<TCServer>
bin
TCPluginsHelper.bat (rx)
lib
TCPluginsHelper.jar (r)
Creating Formatters – To Supply UserName And Password
Captivate TrgFormatter1_demo
Slide 20
Slide 21
Slide 22
TrgFormatter1.jav
a
package com.temenos;
import com.temenos.tocf.tcs.API.*;
public class TrgFormatter1 extends AbstractFormatter {
private String NAME = null;
private String PASSWORD = null;
public void Initialize() {
NAME = super.getParam("NAME");
PASSWORD = super.getParam("PASSWORD");
}
public byte[] format(byte[] request, byte[] response) {
super.debug("This is a trace.");
try {
if (response == null) {
String sRequest = new String(request);
int pos1 = sRequest.indexOf(",");
int pos2 = sRequest.indexOf(",", pos1+1);
int pos3 = sRequest.indexOf(",", pos2+1);
Slide 23
TrgFormatter1.jav
a
String sNewRequest = sRequest.substring(0,pos2+1) +
NAME + "/" + PASSWORD + sRequest.substring(pos3);
return sNewRequest.getBytes();
} else {
return response;
}
} catch (Exception e) {
e.printStackTrace();
}
return response;
}
}
Slide 24
Configuring Formatters In tcserver.xml
Captivate tcserver-TrgFormatter1_demo
Slide 25
Creating Formatters (Cont.)
Start TCS
Testing
Connect to the raw-tcp port 7023 and issue the following command
Slide 26
Testing Formatter1
Captivate TELNET7023TFM1_demo
Creating Formatter 2 – To Supply Enquiry Name
Captivate TrgFormatter2_demo
Slide 28
Slide 29
Slide 30
TrgFormatter2.jav
a
package com.temenos;
import com.temenos.tocf.tcs.API.*;
public class TrgFormatter2 extends AbstractFormatter {
private String ENQNAME = null;
public void Initialize() {
ENQNAME = super.getParam("ENQNAME");
}
public byte[] format(byte[] request, byte[] response) {
super.debug("This is a trace.");
try {
if (response == null) {
String sRequest = new String(request);
String sNewRequest = sRequest + ENQNAME;
return sNewRequest.getBytes();
} else {
return response;
}
} catch (Exception e) {
e.printStackTrace();
}
return response;
}}
Slide 31
Creating Formatters (Cont.)
Captivate tcserver-TrgFormatter2_demo
Slide 32
Creating Formatters (Cont.)
Start TCS
Testing
Connect to the raw-tcp port 7023 and issue the following command
Slide 33
Testing Formatter2
TELNET7023TFM2_demo
Creating Splitters
Captivate splitter_Demo
Slide 35
Slide 36
Slide 37
TrgSplitter.jav
a
package com.temenos;
import java.util.StringTokenizer;
import com.temenos.tocf.tcs.API.AbstractSplitter;
public class TrgSplitter extends AbstractSplitter {
private String _sSep = null;
public void Initialize() {
_sSep = super.getParam("SEPARATOR");
}
public byte[][] split(byte[] bRequest) {
if (_sSep == null) {
return new byte[][]{bRequest};
}
StringTokenizer st = new StringTokenizer(new
String(bRequest),_sSep);
int nCount = st.countTokens();
byte[][] bReturn = new byte[nCount][];
for(int i=0; i< nCount; i++){
bReturn[i] = st.nextToken().getBytes();
}
Slide 38
TrgSplitter.jav
a
super.debug("Returning " + nCount + " messages");
System.out.println("AdapterID : " + super.getAdapterID());
System.out.println("ListenerID : " +
super.getListenerID());
return bReturn;
}
public byte[] concat(byte[][]bResponse){
int nArrayLength = bResponse.length;
StringBuffer sb = new StringBuffer();
int bPos = 0;
for (int i = 0; i < nArrayLength; i++){
sb.append(new String(bResponse[i]));
if (i < (nArrayLength-1)) {
sb.append(this._sSep);
}
}
return sb.toString().getBytes();
}
}
Slide 39
Configure TCS for Splitter
Captivate tcserver-TrgSplitter_demo
Slide 40
Creating Splitters (Cont.)
Start TCS
Test your splitter using the message
ENQUIRY.SELECT,,,+ENQUIRY.SELECT,,,
Slide 41
Testing Splitters
Captivate TELNET7023SPLT_demo
Creating Adapters
CaptivateTrgAdapter2_demo
Slide 43
TrgAdapter2.jav
a
package com.temenos;
import java.io.File;
import java.io.FileOutputStream;
import com.temenos.tocf.tcs.API.*;
public class TrgAdapter2 extends AbstractAdapter {
public void Initialize() { }
public byte[] process(byte[] bRequest, String sTag) {
super.debug("Process");
String sFileName = System.currentTimeMillis() + ".txt";
File f = new File(sFileName);
System.out.println("Creating file : '" + f.getAbsolutePath() +
"'" );
try{
FileOutputStream fos = new FileOutputStream(f);
fos.write(bRequest);
fos.flush();
fos.close();
return sFileName.getBytes();
}catch(Exception e){
e.printStackTrace();
return ("Error : " + e.getMessage()).getBytes();
}
}
public void stopIt() { }
}
Slide 44
Slide 45
Configure TCS for Adapters
Captivate Tcserver-TrgAdapter2_demo
Slide 46
Creating Adapters (Cont.)
Start TCS
Connect to the raw-tcp port 7033 and type in any message
You should see a similar message on your TC console
Verify the contents of this file
Slide 47
Testing Adapters
CaptivateTELNET7033Adapter_demo
Creating Listeners
Let us create a listener named TrgListener1 that is capable of
Passing text to TrgAdapter2
Specifying number of times the data that it supplies need to be processed
by TrgAdapter2
Slide 49
Creating Listeners
Captivate Listener1_demo
Slide 50
Slide 51
Slide 52
TrgListener1.jav
a
package com.temenos;
import com.temenos.tocf.tcs.API.*;
public class TrgListener1 extends AbstractListener {
private boolean bStop = false;
private boolean bStopped = false;
public void stopIt() {
bStop = true;
}
public boolean isStopped() {
return bStopped;
}
public void run() {
super.debug("Start");
//Extract the incoming text
byte[] bRequest = super.getParam("REQUEST").getBytes();
int nFrequency = Integer.parseInt(super.getParam("FREQUENCY"));
int nIndex = 1;
while (nIndex <= nFrequency){
byte[] bResponse = super.process(bRequest);
System.out.println(nIndex + " : " + new
String(bResponse));
nIndex ++;
}
bStopped = true;
}
}
Slide 53
Configure TCS
Captivate Tcserver-Listener_demo
Slide 54
Creating Listeners
Start TCS
Check if your listener’s up and running
Slide 55
Testing Listeners
TESTING_TrgListener1_demo
Obtaining Listener Status
Type listenerinfo at the TCS prompt
Slide 57
Obtaining Listener Status
Logging Facility With TCS
Uses log4j mechanism of logging
log4j is an industry standard
View the tcslog.properties file under
TCS 1.5 and above : TCS’s conf/TCServer directory
TCS 1.4 and below : TCS’s conf directory
Slide 59
Logging Facility With TCS
###############################################
log4j.rootLogger=TRUE
log4j.logger.common=INFO, file
log4j.logger.tcs=DEBUG, file
log4j.logger.ofs=DEBUG, file
log4j.logger.monitor=INFO, filelog4j.logger.alert=INFO, file
log4j.logger.raw-tcp=DEBUG, console
log4j.logger.securityAdmin=DEBUG, file
log4j.logger.securityLogin=DEBUG, file
log4j.logger.tcp=INFO, file
log4j.logger.TrgFormatter1=DEBUG, console
log4j.logger.TrgFormatter2=DEBUG, console
log4j.logger.TrgSplitter=DEBUG, console
log4j.logger.TrgListener1=DEBUG, console
log4j.logger.TrgAdapter2=DEBUG, console
log4j.logger.mqseries=DEBUG, file
###############################################
Compiling java code with javac
Summary
In this learning unit/course, you learnt ,
Define plug-in
Types of plug-ins
Default plug-ins
Plug-in oriented TCServer Architecture
User defined plug-ins
Slide 62
Thank You
TEMENOS EDUCATION CENTRE
Warning: This document, is protected by copyright law and international treaties. No part of this document
may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of TEMENOS HEADQUARTERS SA Unauthorized
reproduction or distribution of this presentation or any portion of it, may result in severe civil and criminal
penalties, and will be prosecuted to the maximum extent possible under applicable law.” Information in this
document is subject to change without notice