class FindEventsCommandExecutor extends AbstractCommandExecutor<FindEventsRequestDto, List<EventDto>> {

    @Override
    public List<EventDto> execute(final DlmsConnectionManager conn, final DlmsDevice device,
            final FindEventsRequestDto findEventsQuery) throws ProtocolAdapterException {

        final SelectiveAccessDescription selectiveAccessDescription = this
                .getSelectiveAccessDescription(findEventsQuery.getFrom(), findEventsQuery.getUntil());

        final AttributeAddress eventLogBuffer = new AttributeAddress(CLASS_ID,
                EVENT_LOG_CATEGORY_OBISCODE_MAP.get(findEventsQuery.getEventLogCategory()), ATTRIBUTE_ID,
                selectiveAccessDescription);

        conn.getDlmsMessageListener().setDescription(
                "RetrieveEvents for " + findEventsQuery.getEventLogCategory() + " from " + findEventsQuery.getFrom()
                        + " until " + findEventsQuery.getUntil() + ", retrieve attribute: " + JdlmsObjectToStringUtil
                        .describeAttributes(eventLogBuffer));

        final GetResult getResult;
        try {
            getResult = conn.getConnection().get(eventLogBuffer);
        } catch (final IOException e) {
            throw new ConnectionException(e);
        }

        if (getResult == null) {
            throw new ProtocolAdapterException(
                    "No GetResult received while retrieving event register " + findEventsQuery.getEventLogCategory());
        }

        if (!AccessResultCode.SUCCESS.equals(getResult.getResultCode())) {
            LOGGER.info("Result of getting events for {} is {}", findEventsQuery.getEventLogCategory(),
                    getResult.getResultCode());
            throw new ProtocolAdapterException(
                    "Getting the events for  " + findEventsQuery.getEventLogCategory() + " from the meter resulted in: "
                            + getResult.getResultCode());
        }

        final DataObject resultData = getResult.getResultData();
        return this.dataObjectToEventListConverter.convert(resultData, findEventsQuery.getEventLogCategory());
    }

    @Autowired public  FindEventsCommandExecutor(final DlmsHelper dlmsHelper,
            final DataObjectToEventListConverter dataObjectToEventListConverter);

}