Try OpenEdge Now
skip to main content
Java Open Clients
Accessing Proxy Properties : Accessing properties with methods : Accessing properties using purposed accessor methods : Compression methods
 
Compression methods
You can compress the messages exchanged between the Java Open client and an AppServer. The methods listed in the following table provide compression functionality to the Java Open Client. These methods apply to the RuntimeProperties class and Connection class.
Table 18. Compression methods
Method
Description
getCompressionEnabled()
Gets PROGRESS.Session.CompressionEnabledReturns TRUE if getCompressionEnabled() is called. The default value is FALSE.
getCompressionLevel()
getCompressionThreshold()
setCompressionEnabled()
setCompressionLevel()
setCompressionThreshold()
The following example shows the creation of a new Connection object, which is compression enabled with a default compression level of 1 and a minimum message size of 300 bytes.

com.progress.open4gl.javaproxy.Connection conn = new
Connection("AppServer://localhost:5162/asbroker1", null, null, "TestApp");

conn.setCompressionEnabled(true);

conn.setCompressionLevel(1);

conn.setCompressionThreshold(300);
The following example shows the creation of a new RuntimeProperties object, which is compression enabled. The compression level is set to 5, and the message size is set to 550 bytes.
com.progress.open4gl.RuntimeProperties.setCompressionEnabled(true);

com.progress.open4gl.RuntimeProperties.setCompressionLevel (5);

com.progress.open4gl.RuntimeProperties.setCompressionThreshold (550);