Webservice Component
TAFJRestServices.war is a JAX-RS based archive to provide webservice access to Temenos Transact processing and TAFJ session management functionalities. It allows processing OFS requests, CALL_AT and tRun commands. It also gives details about active TAFJ sessions and provides a logoff access in case of need. This section provides the invocation details of OFS, CALL_AT, tRun, and TAFJ sessions management webservices.
OFS Webservice
This service processes the specified OFS request.

To invoke this service, you need to post the OFS request to /TAFJRestServices/resources/ofs
The following code enables you to process the ENQUIRY.SELECT,,INPUTT/123456,ACCOUNT.DETAILS,CURRENCY:EQ=EUR enquiry request.
curl --request POST \ --url http://localhost:8080/TAFJRestServices/resources/ofs \ --header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \ --header 'cache-control: no-cache' \ --header 'content-type: application/json' \ --header 'postman-token: 52783562-667f-1fa9-190e-69916605964f' \ --data '{\n "ofsRequest" : "ENQUIRY.SELECT,,INPUTT/123456,ACCOUNT.DETAILS,CURRENCY:EQ=EUR "\n}'
Form media type:
curl --request POST \ --url http://localhost:8080/TAFJRestServices/resources/ofs \ --header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \ --header 'cache-control: no-cache' \ --header 'content-type: application/x-www-form-urlencoded' \ --header 'postman-token: 16bf809e-eab0-161c-ba43-a80296fe0c12' \ --data ofsRequest=ENQUIRY.SELECT%2C%2CINPUTT%2F123456%2CACCOUNT.DETAILS%2CCURRENCY%3AEQ%3DEUR%20
This webservice can be tested from the URL http://localhost:8080/TAFJEE/html/webservice.html.
Subroutine Invoker Webservice (CALL_AT)
This service executes the specified routine with the given routine parameters.

To invoke this service, you need to post the CALL_AT invocation to /TAFJRestServices/resources/callAt
The following properties enable you to execute EXCHRATE routine which takes 10 parameters.
Property | Value |
---|---|
Routine Name |
EXCHRATE |
Parameters |
param=1¶m=CHF¶m=500¶m=GBP¶m=¶m=¶m=¶m=¶m=¶m= |
JSON media type:
curl --request POST \ --url http://localhost:8080/TAFJRestServices/resources/callAt \ --header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \ --header 'cache-control: no-cache' \ --header 'content-type: application/json' \ --header 'postman-token: 733442c1-fd06-21fc-9d25-0229c8333322' \ --data '{\n "routineName" : "EXCHRATE",\n "inParameters" : ["1","CHF","500","GBP","","","","","",""]\n}'
Form media type:
curl --request POST \ --url http://localhost:8080/TAFJRestServices/resources/callAt \ --header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \ --header 'cache-control: no-cache' \ --header 'content-type: application/x-www-form-urlencoded' \ --header 'postman-token: bf23b91e-9eda-183f-dfab-934e8b1c6003' \ --data 'routineName=EXCHRATE&inParameters=param%3D1%26param%3DCHF%26param%3D500%26param%3DGBP%26param%3D%26param%3D%26param%3D%26param%3D%26param%3D%26param%3D%09'
This webservice can be tested from the URL http://localhost:8080/TAFJEE/html/webservice.html.
Background Program Runner Webservice (tRun)
This service executes the specified program if it is authorised with the given arguments and optional user data inputs and returns response status (0 – SUCCESS, 1 – FAILURE) and eventual program outputs.
Please refer to the tRun entry point section for more details about parameters and options.

To invoke this service, you need to post the tRun invocation to /TAFJRestServices/resources/trun
The following code enables you to execute TEST.TRUN which takes an argument, uses two user input data and captures program outputs.
@param command the mandatory command name followed by optional arguments. @param input an optional list of user input data: input=data1&input=data2... @param output an optional boolean value disabling output capture when set to false. @param timeout an optional integer value to override the default ejb processing timeout. @param jta an optional boolean value to override the default ejb jta setup. False means no global jta transaction.
JSON media type:
curl --request POST \ --url http://localhost:8080/TAFJRestServices/resources/trun \ --header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \ --header 'cache-control: no-cache' \ --header 'content-type: application/json' \ --header 'postman-token: a974ebdf-9270-94bf-0e38-fa04d56b4629' \ --data '{"command":"TEST.TRUN 1",\n "inputParameters":["rolf","gerling],\n "outputParameters":[]\n}'
Form media type:
curl --request POST \ --url http://localhost:8080/TAFJRestServices/resources/trun \ --header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \ --header 'cache-control: no-cache' \ --header 'content-type: application/x-www-form-urlencoded' \ --header 'postman-token: 29c06be8-5fbf-c56e-0b42-47d81dd52a1e' \ --data 'command=TEST.TRUN%2010&input=input%3Drolf%26input%3Dgerling'
This webservice can be tested from the URL http://localhost:8080/TAFJEE/html/webservice.html
TAFJ Sessions Management Webservice
This webservice allows access to session and server management operations. The base service URL is /TAFJRestServices/resources/management.

The service returns the list of all active TAFJ sessions running on the server with information related to their current technical status. These session details vary depending on the session type—batch (background=true) or online.

GET access to /TAFJRestServices/resources/management/session.
@GET @Path("session") /** * Get all sessions registered in MBeanServer * * @return JsonObject set of sessions details */
curl --request GET \ --url http://localhost:8080/TAFJRestServices/resources/management/session \ --header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \ --header 'cache-control: no-cache' \ --header 'content-type: application/json' \ --header 'postman-token: 21e35e75-ff10-b42a-013a-f28e4166410e'
Returns:
{ "sessions": [ { "objectName": "com.temenos:Product=tafj,Service=Sessions,Category=2063007969-225,Id=Session", "sessionId": 2063007969, "processId": 9336, "threadId": 1084616604, "portNum": 225, "background": false, "ofsSource": "GCS", "nbRequests": 2, "creationDate": "2018-02-27T18:33:57.672", "executionTime": 0, "idleTime": 1868315, "expired": false, "shutdownInProgress": false, "shutdown": false }, { "objectName": "com.temenos:Product=tafj,Service=Sessions,Category=\"2064449766-230-TEST.BATCH 2\",Id=Session", "sessionId": 2064449766, "processId": 9336, "threadId": 1508300335, "portNum": 230, "background": true, "command": "TEST_BATCH 2", "creationDate": "2018-02-27T19:06:21.273", "executionTime": 2041, "expired": false, "shutdownInProgress": false, "shutdown": false }…

Executes an immediate logoff order on a TAFJ session running on the current server given its JMX object name. The object name can be retrieved through the GET TAFJ session details invocation.

To logoff a session, you need to post the logoff order to /TAFJRestServices/resources/management/session/logoff.
@POST @Path("/session/logoff") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) /** * Execute a logoff for specified session * * @param objectname * the JMX session object name as registered in MBeanServer. * @return JsonObject representing the logoff operation result. */
The following code enables you to logoff session identified by ‘com.temenos:Product=tafj,Service=Sessions,Category=2063139042-226,Id=Session’
curl --request POST \ --url http://localhost:8080/TAFJRestServices/resources/management/session/logoff \ --header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \ --header 'cache-control: no-cache' \ --header 'content-type: application/x-www-form-urlencoded' \ --header 'postman-token: 7acf2d2e-dbbc-8920-e027-99864f10136a' \ --data objectname=com.temenos%3AProduct%3Dtafj%2CService%3DSessions%2CCategory%3D2063139042-226%2CId%3DSession
It returns true in case of successful logoff.
{ "objectname": "com.temenos:Product=tafj,Service=Sessions,Category=2063139042-226,Id=Session", "logoff": true }

You can either log off all sessions or only the background or online sessions simultaneously.

To log off all sessions, you need to post the logoff order to /TAFJRestServices/resources/management/session/logoff/all.
@POST @Path("/session/logoff/all") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) /** * Logoff all existing sessions. * * * @return JsonObject representing the logoff operation result. */

To log off all background sessions, you need to post the logoff order to /TAFJRestServices/resources/management/session/logoff/background.
@POST @Path("/session/logoff/background") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) /** * Logoff all background sessions. * * * @return JsonObject representing the logoff operation result. */

To log off all online sessions, you need to post the logoff order to /TAFJRestServices/resources/management/session/logoff/online.
@POST @Path("/session/logoff/online") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) /** * Logoff all online sessions except idle ones. * * * @return JsonObject representing the logoff operation result. */

The server registry contains all Temenos Transact registered server instances and their associated background sessions, if enabled.

GET access to TAFJRestServices/resources/management/registry.
@GET @Path("registry") /** * Get access to the server registry. When server registration is enabled it * contains the list of registered servers and their associated background * session. * * @return JsonObject representing the set of registered servers and * associated background sessions. */

You can start the server registration process to send, a JMS message periodically to the Temenos Transact management topic containing the server detail and its associated background session details depending on the registration frequency.

To start the server registry, you need to post the registry start order to TAFJRestServices/resources/management/registry/start.
@POST @Path("registry/start") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) /** * Start the server registration for current server. * * @param registrationFrequency * the time in seconds between two registration messages. * @param registrationExpiration * the time in seconds before a registration expires. * * @return JsomObject the operation status, true when successfully started, * false in case of error or when registration is already running. */

This process stops the server registration process.

To stop the server registry, you need to post the registry stop order to TAFJRestServices/resources/management/registry/stop
@POST @Path("registry/stop") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) /** * Stop the server registration for current server. * * @return JsonObject the operation status, true when successfully stopped, * false in case of error or when registration is already stopped. */

You can trigger a session warmup for the requested EJBs and pool size.

To trigger EJB warmup, you need to post the ejb warmup start order to TAFJRestServices/resources/management/warmup.
@POST @Path("/warmup") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) /** * Trigger an ejb warmup if not already triggered by management bean * configuration at server startup. The ejb warmup is creating the specified * number of session(s) for the specified ejb(s) following a pattern. The * warmup could be synchronous and waiting for the specified amount of time * to complete, or asynchronous and return immediately. * * * @param ejbWarmup * the ejb pattern, representing a semi colon separated sequence * of EJB names as defined in ejb-jar.xml and size e.g. * OFSProcessingBean=5;BROWSERProcessingBean=3. * @param synchronousWarmup * wait for warmup completion with specified timeout when set to * true. Defaulted to false when undefined. * @param warmupTimeout * time to wait before returning when using synchronous mode. * Defaulted to 60s when undefined and synchronousWarmup is true * to avoid deadlock. * @return JsonObject representing the operation status, SUCCESS when the * warmup has been processed or FAILURE otherwise. */

You can publish a JMS message to the Temenos Transact management topic to perform management operation either on all Temenos Transact server instances or on a specific instance when a server instance ID is specified.
To send a management message, you need to post the management message to TAFJRestServices/resources/management/topic
The message target can be a specific server instance when a server ID is specified.
@POST @Path("/topic") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) /** * Publish a management message to the management topic, to be handled by * all server instances or by a specific instance when server id is * specified. The message must be a supported message as per the * ManagementMessageType enumeration. * * @param message * the String representation of the ManagementMessageType. * @param serverid * the String representation of the server id if the message is * dedicated to a specific server only * @param parameter * an optional parameter which will be assigned to the message * when the message defines parameters * @return JsonObject representing the operation status, true when the * message is valid and has been successfully sent, false otherwise. */

The following table lists the management messages that are supported in this environment.
Message Text | Management Operation | Target | Parameter |
---|---|---|---|
START.TSM |
Starts TSM service |
Either all or a specific instance |
Optional serverid = Server id |
LOGOFF.SESSION |
Logs off a session |
Specific instance where the session runs |
serverid = Server id parameter = Session object name |
LOGOFF.ALL |
Logs off all sessions |
Either all or a specific instance |
Either all or a specific instance |
LOGOFF.ALL.BACKGROUND |
Logs off all background sessions |
Either all or a specific instance |
Either all or a specific instance |
LOGOFF.ALL.ONLINE |
Logs off all online sessions |
Either all or a specific instance |
Either all or a specific instance |
START.REGISTRY |
Starts server registration |
Either all or a specific instance |
Optional serverid = Server id |
STOP.REGISTRY |
Stops server registration |
Either all or a specific instance |
Optional serverid = Server id |
SET.REGISTRATION.FREQUENCY |
Sets the time between two registration events |
Either all or a specific instance |
Optional serverid = Server id parameter = Time in seconds |
START.IDLE.DETECTION |
Starts session idle detection service |
Either all or a specific instance |
Optional serverid = Server id |
STOP.IDLE.DETECTION |
Stops session idle detection service |
Either all or a specific instance |
Optional serverid = Server id |
SET.IDLE.DETECTION.THRESHOLD |
Sets the idle detection threshold |
Either all or a specific instance |
Optional serverid = Server id parameter = Time in seconds |
LOGOFF.BACKGROUND.ON.STOP |
Enables background session logoff on container stop |
Either all or a specific instance |
Optional serverid = Server id |
LOGOFF.ONLINE.ON.STOP |
Enables online session logoff on container stop |
Either all or a specific instance |
Optional serverid = Server id |
DISABLE.LOGOFF.BACKGROUND.ON.STOP |
Disables background session logoff on container stop |
Either all or a specific instance |
Optional serverid = Server id |
DISABLE.LOGOFF.BACKGROUND.ON.STOP |
Disables online session logoff on container stop |
Either all or a specific instance |
Optional serverid = Server id |
In this topic