public Connection.CompressionPolicy getCompressionPolicy()
    {
        // Depending on the connection type, define a good default value.
        final Connection.CompressionPolicy defaultPolicy = switch (getType()) {
            // More likely to have good bandwidth. Compression on high-volume data gobbles CPU.
            case COMPONENT, CONNECTION_MANAGER, SOCKET_S2S -> Connection.CompressionPolicy.disabled;

            // At least *offer* compression functionality.
            default -> Connection.CompressionPolicy.optional;
        };

        if ( compressionPolicyPropertyName == null )
        {
            return defaultPolicy;
        }
        else
        {
            final String policyName = JiveGlobals.getProperty( compressionPolicyPropertyName, defaultPolicy.toString() );
            try
            {
                return Connection.CompressionPolicy.valueOf( policyName );
            }
            catch ( IllegalArgumentException e )
            {
                Log.error( "Error parsing property value of '{}' into a valid Compression Policy. Offending value: '{}'.", tlsPolicyPropertyName, policyName, e );
                return defaultPolicy;
            }
        }
    }
Returns whether compression is optional or disabled for new connections.

@return A compression policy (never null)
xmppserver/src/main/java/org/jivesoftware/openfire/spi/ConnectionListener.java