Академический Документы
Профессиональный Документы
Культура Документы
User Guide
Page 1
Information in this document is subject to change without notice.
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 Holdings NV.
Page 2
Contents
Introduction.................................................................................................................................................4
Assumptions................................................................................................................................................5
Developers Guide........................................................................................................................................6
jRemote packages....................................................................................................................................6
jAgent......................................................................................................................................................6
Connecting to jBASE..............................................................................................................................6
Authentication.....................................................................................................................................7
SSL Encryption....................................................................................................................................8
Additional connection properties:.......................................................................................................8
Closing a connection...............................................................................................................................9
jRemote Client API reference..................................................................................................................9
Calling jBC subroutines......................................................................................................................9
Logging into a jBASE account............................................................................................................9
Opening a jBASE file........................................................................................................................10
Operating on jBASE files..................................................................................................................10
Executing a jBASE command...........................................................................................................11
Obtaining the jBASE internal date....................................................................................................12
Obtaining the jBASE internal time....................................................................................................12
Converting data in external format to internal jBASE format..........................................................12
Converting data in internal jBASE format to external format..........................................................12
Obtaining the value of a named jBASE Common variable...............................................................13
Obtaining EIS specific meta data......................................................................................................13
Executing jQL queries.......................................................................................................................13
Starting/Ending a transaction............................................................................................................14
Capturing jBASE standard output.....................................................................................................14
Resources...................................................................................................................................................15
Page 3
Introduction
This user guide provides detailed instructions on how to use the jBASE jRemote Client API.
jRemote (Client) is a jBASE component providing an API to perform jBASE operations remotely such as calling
subroutines or accessing jBASE files. The jRemote Client API is available to multiple development platforms (see
jRemote Packages section for more details).
jRemote Resource Adapter (jRemote RA) is a JCA compliant resource adapter allowing J2EE applications to
access a jBASE Enterprise Information System (EIS) within a transactional context. The J2EE Connector
Architecture (JCA) specification, to which this resource adapter conforms, specifies the mechanisms and
contracts required for this transactional interaction. JCA provides a Java technology solution to the problem of
connectivity between the many application containers and today's enterprise information systems (EIS).
Note: More information on the jRemote RA can be found in the jRemote JCA RA user guide documentation.
jAgent
jBASE Server
This diagram shows how Java and .NET C# client applications may use jRemote (Client) to access jBASE
functionality. jAgent is a jBASE component responsible for accepting and processing incoming client requests.
jAgent, as well as jRemote, use TCP socket connections to communicate between each other and therefore need
to be configured to use the same TCP port.
Page 4
Assumptions
This document describes many concepts and methodologies that are highly technical in nature, and as such
prerequisite knowledge of the following is considered essential:
Page 5
Developers Guide
The following section provides a detailed guide on how to connect and access the jBASE server.
jRemote packages
This document covers the jRemote API for Java platform. Please refer the jBASE jRemote Client (C#)
documentation for more information about this API on C# platform.
The Java version of jRemote is distributed as a Java Archive (jar) file (jremote.jar). This archive must be located
in your CLASSPATH in order to be used by a java application. The jRemote class library is defined under the
com.jbase.jremote namespace. Please read the appropriate class library (javadoc) documentation for more
information about this API.
jAgent
jBASE jAgent is a server-side jBASE component which must be listening on a user-defined TCP port on the
remote jBASE instance. It accepts socket connections to process incoming requests from Client Applications
implementing the jRemote Client API. Please refer to the jBASE jAgent user guide for more information on how to
configure and start jAgent.
Connecting to jBASE
jRemote connection handles are obtained via the JConnectionFactory interface which is implemented by
jRemotes DefaultJConnectionFactory class. This interface provides several
getConnection()
methods to establish a new connection with a remote jBASE instance. For more information please refer to the
API documentation.
Page 6
Information in this document is subject to change without notice.
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 Holdings NV.
try {
DefaultJConnectionFactory cxf = new DefaultJConnectionFactory();
cxf.setHost("127.0.0.1");
cxf.setPort(20002); //Port should match the port jAgent is listening on
JConnection cx = cxf.getConnection();
return cx;
} catch (JRemoteException e) {
// error
}
Authentication
jAgent can be configured to verify user credentials and perform jBASE account authentication. jRemote
implements the following connection properties to supply user credentials:
user
Specifies the user to be authenticated
password
Specifies the users password
One of the following methods should then be used depending on whether the current authentication mode is user
or account:
try {
DefaultJConnectionFactory cxf = new DefaultJConnectionFactory();
cxf.setHost("127.0.0.1");
cxf.setPort(20002); //Port should match the port jAgent is listening on
JConnection cx = cxf.getConnection("myUserName", "myPassword");
//JConnection cx = cxf.getConnection("osUser", "myAccount", "myAccntPassword");
return cx;
Page 7
} catch (JRemoteException e) {
// error
}
SSL Encryption
jAgent may be configured to use SSL encrypted connections for deployment scenarios which require enhanced
security. jRemote implements the following connection properties:
This will force the Java jRemote Client to trust all server certificates.
CertificateDN
try {
DefaultJConnectionFactory cxf = new DefaultJConnectionFactory();
cxf.setHost("127.0.0.1");
cxf.setPort(20002);
cxf.enableSSL(); //Enable SSL encryption
cxf.enableNaiveTrustManager(); //Trust all server credentials
JConnection cx = cxf.getConnection("myUserName", "myPassword");
return cx;
} catch (JRemoteException e) {
// error
}
This property specifies whether the data transferred between client and server should be
compressed. Enabling compression yields a better throughput on large data transfers. The
opposite effect may occur on small data transfers and therefore jRemote will automatically
decide whether to apply compression or not based on the supplied threshold value.
Page 8
less than the specified threshold are not compressed. Value 0 means all data will be
compressed.
Closing a connection
After finishing with the connection, it must be closed to release the associated resources:
cx.close();
Location: JConnection
Return type: JSubroutineParameters
Throws: JSubroutineNotFoundException, JRemoteException;
JSubroutineParameters represents the input/output parameters for the jBC subroutine and is an array of
JDynArray values.
//Show parameters
System.out.println("1st parameter: " + returnParams.get(0).get(1));
System.out.println("2nd parameter: " + returnParams.get(1).get(1));
System.out.println("3rd parameter: " + returnParams.get(2).get(1));
Location: JConnection
Return type: boolean
Page 9
Throws: JRemoteException;
Location: JConnection
Return type: JFile
Throws: JRemoteException;
Reads a record from an opened file respecting locks or locks the specified record for update
readU(String recordKey, boolean blockedRead)
Return type: JDynArray
Throws: JRecordNotFoundException, JRecordLockedException,
JRemoteException
Page 10
//Write record to file
boolean writeOK = file.write("MyRecordId", record));
Location: JConnection
Return type: JExecuteResults
Throws: JRemoteException;
Page 11
Obtaining the jBASE internal date
date()
Location: JConnection
Return type: int
Throws: JRemoteException;
Location: JConnection
Return type: int
Throws: JRemoteException;
Location: JConnection
Return type: String
Throws: JRemoteException;
Location: JConnection
Return type: String
Throws: JRemoteException;
Page 12
Obtaining the value of a named jBASE Common variable
getCommon(String name)
Location: JConnection
Return type: JDynArray
Throws: JRemoteException;
Location: JConnection
Return type: EISMetaDataRepository
Throws: JRemoteException;
execute()
Location: JStatement
Return type: JResultSet
Throws: JRemoteException;
Starting/Ending a transaction
begin()
commit()
Page 13
rollback()
Location: JConnection
Return types: void
Throws: JRemoteException;
Location: JConnection
Return type: void
Throws: Nothing
//Set the writer for the terminal output to capture standard output
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Writer writer = null;
try {
writer = new OutputStreamWriter(bos, "UTF-8");
catch (UnsupportedEncodingException e) {
System.out.println("Error while creating OutputStreamWriter.");
}
cx.setTerminalOutputWriter(writer);
Page 14
Resources
Java JDK http://java.sun.com
JBoss http://www.jboss.org/
Page 15