public void setCompressionPolicy( Connection.CompressionPolicy policy )
    {
        final Connection.CompressionPolicy oldPolicy = getCompressionPolicy();
        if ( oldPolicy.equals( policy ) )
        {
            Log.debug( "Ignoring Compression Policy change request (to '{}'): listener already in this state.", policy );
            return;
        }

        Log.debug( "Changing Compression Policy from '{}' to '{}'.", oldPolicy, policy );
        JiveGlobals.setProperty( compressionPolicyPropertyName, policy.toString() );
        restart();
    }
Sets whether compression is optional or disabled for new connections. This configuration change is persisted.

If the listener is currently enabled, this configuration change will be applied immediately (which will cause a
restart of the underlying connection acceptor).

An invocation of this method has no effect if the new policy value is equal to the existing value.

@param policy a compression policy (not null).
xmppserver/src/main/java/org/jivesoftware/openfire/spi/ConnectionListener.java