Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 2 Adapter Configuration : Properties Files

Properties Files
The Adapter SDK supports properties files, which contain property key/property value pairs that would otherwise be supplied on the command line. Properties files are supported with both the C++ and the Java API.
If an adapter includes a properties file, the precedence of options is affected.
An option "-system:propfile file" is not supported within the properties file itself. Therefore, properties files cannot be nested. You may, however, call an SDK properties file from a TIBCO Wrapper properties file. See Chapter 13, TIBCO Wrapper Utility.
Format of Properties File
Each line in a properties file is a single property. Each property consists of a key and a value. The key starts with the first non-whitespace character and ends at the first "=", ":", or whitespace character. The value starts at the first character after the equal sign (=).
The properties file format is identical to the Java properties file format defined in java.util.Properties.load(). Therefore, the following restrictions apply:
The "!" character cannot be used as a comment line indicator. Only the "#" character is recognized.
The key cannot contain any of the termination characters. Although Java allows termination characters by escaping the value with a preceding "\" character, TIBCO Adapter SDK does not support this syntax.
Tagging Values for Encryption
The presence of "#!" as the first two characters in a value (not the key) indicates that the value has been encrypted or is to be encrypted.
The encryption tool can be found in tra/version/bin. It is also called obfuscate for compatibility. When the encryption tool is run, it rewrites the properties file with the encrypted value in place.
Using "#" for obfuscation is obsolete.
Recognized Property Keys
The following property keys are predefined and recognized by the Adapter SDK:
tibco.repourl
tibco.configurl
tibco.instanceid
tibco.appname
tibco.appinfo
tibco.appversion
tibco.username
tibco.password
tibco.clientVar.varname
tibco.messageFormat (values: aeRvMsg, xmlRvMsg, and xmlJmsMsg)
tibco.jmsReconnectCount
tibco.jmsReconnectDelay
tibco.xsdGeneration (values: off, and on)
tibco.dedicatedHawkThread (values: off, and on)
tibco.showBanner (values: true, and false)
tibco.jmsclientid.session_name
Two Types of Properties
The Adapter SDK allows two types of properties in a properties file:
SDK properties affect the SDK program. They are listed in Recognized Property Keys.
TIBCO Wrapper properties affect the TIBCO Wrapper. The TIBCO Wrapper utility is separate from the SDK libraries and must be explicitly linked in if you want to use it. See Chapter 13, TIBCO Wrapper Utility for more information.
Both types of properties can be included in one file. Alternatively, you can place each in an individual file and call the SDK properties file from the TIBCO Wrapper properties file using application.args --propfile in the latter.
Properties File Examples
Example Properties File
tibco.configurl=/tibco/private/adapter/test/config/config1
tibco.repourl=tibcr://SDK_TEST
tibco.appname=MyApp
tibco.instanceid=config
tibco.appversion=4.0
tibco.appinfo=TIB/Adapter SDK test for Configuration
tibco.username=admin
tibco.password=samplePassword
tibco.clientVar.service=7600
tibco.clientVar.daemon=tcp:7600
tibco.showBanner=false
Setting the Properties File Inside the Program
Custom adapters that want to set the properties file in code instead of passing it on the command line can refer to the following example.
main()
{
   MAppProperties myAppProps;
   //…
   myAppProps.set( MAppProperties::PROPFILE, "obfuscatedFile" );
   //…
   MString r3password;
   if ( myAppProps.get( "r3.password", r3password )== Mtrue )
   {
      // log into R/3…
   };
//…
}

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved