class SetAlarmNotificationsCommandExecutor extends AbstractCommandExecutor<AlarmNotificationsDto, AccessResultCode> {

    @Override
    public AccessResultCode execute(final DlmsConnectionManager conn, final DlmsDevice device,
            final AlarmNotificationsDto alarmNotifications) throws ProtocolAdapterException {
        try {
            final AttributeAddress alarmFilterValue = this.getAttributeAddress(device);

            final AlarmNotificationsDto alarmNotificationsOnDevice =
                    this.retrieveCurrentAlarmNotifications(conn, alarmFilterValue);

            LOGGER.info("Alarm Filter on device before setting notifications: {}", alarmNotificationsOnDevice);

            final long alarmFilterLongValueOnDevice = this.alarmFilterLongValue(alarmNotificationsOnDevice);
            final long updatedAlarmFilterLongValue = this
                    .calculateAlarmFilterLongValue(alarmNotificationsOnDevice, alarmNotifications);

            if (alarmFilterLongValueOnDevice == updatedAlarmFilterLongValue) {
                return AccessResultCode.SUCCESS;
            }

            LOGGER.info("Modified Alarm Filter long value for device: {}", updatedAlarmFilterLongValue);

            return this.writeUpdatedAlarmNotifications(conn, updatedAlarmFilterLongValue, alarmFilterValue);
        } catch (final IOException e) {
            throw new ConnectionException(e);
        }
    }

    @Autowired public  SetAlarmNotificationsCommandExecutor(final DlmsObjectConfigService dlmsObjectConfigService);

}