class O2GSystemPropertiesReader
Brief
The class reads a stream of the system properties.
Details
The system properties are requested by the ForexConnect API during the login process.
A response object of the GET_SYSTEM_PROPERTIES type is obtained by the
O2GLoginRules.getSystemPropertiesResponse method. For example,
O2GResponse response = loginRules.getSystemPropertiesResponse();
To create an instance of the O2GSystemPropertiesReader class, pass the response object as an argument to the
O2GResponseReaderFactory.createSystemPropertiesReader method.
For example,
O2GSystemPropertiesReader systemResponseReader = factory.createSystemPropertiesReader(response);
To get the names and values of the system properties, use the getProperties method of the class. For example,
Map<String, String> properties = systemResponseReader.getProperties();
For the list of the system properties, refer to the Constants.SystemProperties description.
For the complete details, see the example below.
Example
Get System properties [hide]
// Get System properties
public static void getProperties(O2GSession session, Map<String, String> properties) {
O2GLoginRules loginRules = session.getLoginRules();
O2GResponse response = loginRules.getSystemPropertiesResponse();
O2GResponseReaderFactory factory = session.getResponseReaderFactory();
if (factory != null) {
O2GSystemPropertiesReader systemResponseReader = factory.createSystemPropertiesReader(response);
if (systemResponseReader != null) {
properties = systemResponseReader.getProperties();
for (Map.Entry<String, String> entry : properties.entrySet()) {
System.out.println("Property = " + entry.getKey() + " Value = " + entry.getValue());
}
}
}
}
The namespace is com.fxcore2.
| Public Methods | |
|
Returns the system properties. |
|
|
Gets the number of the system properties. |
|