class AmqpConnectionHandler extends ChannelInboundHandlerAdapter {

    public int closeConnection(String reason, boolean force, boolean used) throws ValidationException {
        int numberOfChannels = channels.size();
        if (!used && numberOfChannels > 0) {
            throw new ValidationException("Cannot close connection. " + numberOfChannels + " active channels exist "
                                          + "and used parameter is not set.");
        }
        if (force) {
            forceCloseConnection(reason);
        } else {
            closeConnection(reason);
        }
        return numberOfChannels;
    }

    public  AmqpConnectionHandler(AmqpMetricManager metricManager, AmqpChannelFactory amqpChannelFactory,
                                 AmqpConnectionManager amqpConnectionManager);

}