The SessionData interface is used throughout the AJAPI classes.
All members of SessionData, including inherited members.
ConstructorsModifier and Type | Constructor | Description |
---|---|---|
public SessionData | sessionData(String) | Returns a new SessionData object, configured with the given SDML name prefix, that has access to the same session data as this object. |
Modifier and Type | Method | Description |
---|---|---|
public String | eval(String) | Evaluates the given string as an Agentry SDML expression and returns the result. |
public boolean | getBoolean(String) | Returns the specified property as a Boolean value. |
public byte[] | getBytes(String) | Returns the specified property as an array of bytes. |
public double | getDouble(String) | Returns the specified property as a double-precision floating point decimal value. |
public float | getFloat(String) | Returns the specified property as a floating point decimal value. |
public int | getInteger(String) | Returns the specified property as an integer value. |
public long | getLong(String) | Returns the specified property as a long integer value. |
public String | getString(String) | Returns the specified property as a string. |
public GregorianCalendar | getTimeAndDate(String) | Returns the specified property as a date contained in a GregorianCalendar object. |
public String | getTimeAndDate(String, String) | Returns the specified property as a date string using the given format, specified as an Agentry date format string (not a Java date format string!). |
It can also be used within the designer-implemented extensions of those classes. This class encapsulates the Server Data Markup Language (SDML) functionality available in Agentry. Through a SessionData object, the designer can access the data specific to the current session.
This class contains several getter methods to return specified pieces of data. Each of these methods returns the data as a different data type, such as a string or integer. All of these methods take a single argument of type String that specifies the data to return. A an example, to retrieve the data for a string property within a transaction named "Description", the following line of code would be used:
String desc = _sessionData.getString("Description");
When calling these methods, it is important to make sure that the appropriate method is called for the desired data type. No errors will be reported for mismatched data types. For example, if a property within a transaction is of type integer, and the value is retrieved by calling getString, the value will be returned as a String value. In some cases this may be desirable behavior, but in others it can cause undesirable results.
The primary implementation of this interface is a private class that can only be instantiated by the Agentry Server, since it calls back into the running Agentry server to obtain its data. For unit-testing purposes, you can also create a new subclass or mock implementation of this interface; one example of such a testing version is TestSessionData.