Example usage for javax.jms ObjectMessage getIntProperty

List of usage examples for javax.jms ObjectMessage getIntProperty

Introduction

In this page you can find the example usage for javax.jms ObjectMessage getIntProperty.

Prototype


int getIntProperty(String name) throws JMSException;

Source Link

Document

Returns the value of the int property with the specified name.

Usage

From source file:com.alliander.osgp.adapter.protocol.oslp.elster.infra.messaging.processors.CommonSwitchFirmwareRequestMessageProcessor.java

@Override
public void processMessage(final ObjectMessage message) {
    LOGGER.debug("Processing common switch firmware message");

    String correlationUid = null;
    String domain = null;//from   w w  w  .  j  a  v a  2  s  . co m
    String domainVersion = null;
    String messageType = null;
    String organisationIdentification = null;
    String deviceIdentification = null;
    String ipAddress = null;
    int retryCount = 0;
    boolean isScheduled = false;
    String version = null;

    try {
        correlationUid = message.getJMSCorrelationID();
        domain = message.getStringProperty(Constants.DOMAIN);
        domainVersion = message.getStringProperty(Constants.DOMAIN_VERSION);
        messageType = message.getJMSType();
        organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION);
        deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION);
        ipAddress = message.getStringProperty(Constants.IP_ADDRESS);
        retryCount = message.getIntProperty(Constants.RETRY_COUNT);
        isScheduled = message.propertyExists(Constants.IS_SCHEDULED)
                ? message.getBooleanProperty(Constants.IS_SCHEDULED)
                : false;
        version = (String) message.getObject();
    } catch (final JMSException e) {
        LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
        LOGGER.debug("correlationUid: {}", correlationUid);
        LOGGER.debug("domain: {}", domain);
        LOGGER.debug("domainVersion: {}", domainVersion);
        LOGGER.debug("messageType: {}", messageType);
        LOGGER.debug("organisationIdentification: {}", organisationIdentification);
        LOGGER.debug("deviceIdentification: {}", deviceIdentification);
        LOGGER.debug("ipAddress: {}", ipAddress);
        return;
    }

    LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);

    final SwitchFirmwareDeviceRequest deviceRequest = new SwitchFirmwareDeviceRequest(
            organisationIdentification, deviceIdentification, correlationUid, version, domain, domainVersion,
            messageType, ipAddress, retryCount, isScheduled);

    this.deviceService.switchFirmware(deviceRequest);
}

From source file:com.alliander.osgp.adapter.protocol.oslp.elster.infra.messaging.processors.CommonSetEventNotificationsRequestMessageProcessor.java

@Override
public void processMessage(final ObjectMessage message) {
    LOGGER.debug("Processing common set event notifications request message");

    String correlationUid = null;
    String domain = null;/* ww  w .  j  a  v a  2 s  .  co  m*/
    String domainVersion = null;
    String messageType = null;
    String organisationIdentification = null;
    String deviceIdentification = null;
    String ipAddress = null;
    int retryCount = 0;
    boolean isScheduled = false;

    try {
        correlationUid = message.getJMSCorrelationID();
        domain = message.getStringProperty(Constants.DOMAIN);
        domainVersion = message.getStringProperty(Constants.DOMAIN_VERSION);
        messageType = message.getJMSType();
        organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION);
        deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION);
        ipAddress = message.getStringProperty(Constants.IP_ADDRESS);
        retryCount = message.getIntProperty(Constants.RETRY_COUNT);
        isScheduled = message.propertyExists(Constants.IS_SCHEDULED)
                ? message.getBooleanProperty(Constants.IS_SCHEDULED)
                : false;
    } catch (final JMSException e) {
        LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
        LOGGER.debug("correlationUid: {}", correlationUid);
        LOGGER.debug("domain: {}", domain);
        LOGGER.debug("domainVersion: {}", domainVersion);
        LOGGER.debug("messageType: {}", messageType);
        LOGGER.debug("organisationIdentification: {}", organisationIdentification);
        LOGGER.debug("deviceIdentification: {}", deviceIdentification);
        LOGGER.debug("ipAddress: {}", ipAddress);
        return;
    }

    try {
        final EventNotificationMessageDataContainerDto eventNotificationMessageDataContainer = (EventNotificationMessageDataContainerDto) message
                .getObject();

        LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);

        final SetEventNotificationsDeviceRequest deviceRequest = new SetEventNotificationsDeviceRequest(
                organisationIdentification, deviceIdentification, correlationUid,
                eventNotificationMessageDataContainer, domain, domainVersion, messageType, ipAddress,
                retryCount, isScheduled);

        this.deviceService.setEventNotifications(deviceRequest);
    } catch (final Exception e) {
        this.handleError(e, correlationUid, organisationIdentification, deviceIdentification, domain,
                domainVersion, messageType, retryCount);
    }
}

From source file:com.alliander.osgp.adapter.protocol.oslp.elster.infra.messaging.processors.PublicLightingSetTransitionRequestMessageProcessor.java

@Override
public void processMessage(final ObjectMessage message) {
    LOGGER.debug("Processing public lighting set transition request message");

    String correlationUid = null;
    String domain = null;//from   w ww. j  ava2 s  . co m
    String domainVersion = null;
    String messageType = null;
    String organisationIdentification = null;
    String deviceIdentification = null;
    String ipAddress = null;
    int retryCount = 0;
    boolean isScheduled = false;

    try {
        correlationUid = message.getJMSCorrelationID();
        domain = message.getStringProperty(Constants.DOMAIN);
        domainVersion = message.getStringProperty(Constants.DOMAIN_VERSION);
        messageType = message.getJMSType();
        organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION);
        deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION);
        ipAddress = message.getStringProperty(Constants.IP_ADDRESS);
        retryCount = message.getIntProperty(Constants.RETRY_COUNT);
        isScheduled = message.propertyExists(Constants.IS_SCHEDULED)
                ? message.getBooleanProperty(Constants.IS_SCHEDULED)
                : false;
    } catch (final JMSException e) {
        LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
        LOGGER.debug("correlationUid: {}", correlationUid);
        LOGGER.debug("domain: {}", domain);
        LOGGER.debug("domainVersion: {}", domainVersion);
        LOGGER.debug("messageType: {}", messageType);
        LOGGER.debug("organisationIdentification: {}", organisationIdentification);
        LOGGER.debug("deviceIdentification: {}", deviceIdentification);
        LOGGER.debug("ipAddress: {}", ipAddress);
        return;
    }

    try {
        final TransitionMessageDataContainerDto transitionMessageDataContainer = (TransitionMessageDataContainerDto) message
                .getObject();

        LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);

        final SetTransitionDeviceRequest deviceRequest = new SetTransitionDeviceRequest(
                organisationIdentification, deviceIdentification, correlationUid,
                transitionMessageDataContainer, domain, domainVersion, messageType, ipAddress, retryCount,
                isScheduled);

        this.deviceService.setTransition(deviceRequest);
    } catch (final Exception e) {
        this.handleError(e, correlationUid, organisationIdentification, deviceIdentification, domain,
                domainVersion, messageType, retryCount);
    }
}

From source file:com.alliander.osgp.adapter.protocol.oslp.elster.infra.messaging.processors.PublicLightingResumeScheduleRequestMessageProcessor.java

@Override
public void processMessage(final ObjectMessage message) {
    LOGGER.debug("Processing public lighting resume schedule request message");

    String correlationUid = null;
    String domain = null;/*ww  w .  j a  v  a 2s . c  o m*/
    String domainVersion = null;
    String messageType = null;
    String organisationIdentification = null;
    String deviceIdentification = null;
    String ipAddress = null;
    int retryCount = 0;
    boolean isScheduled = false;

    try {
        correlationUid = message.getJMSCorrelationID();
        domain = message.getStringProperty(Constants.DOMAIN);
        domainVersion = message.getStringProperty(Constants.DOMAIN_VERSION);
        messageType = message.getJMSType();
        organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION);
        deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION);
        ipAddress = message.getStringProperty(Constants.IP_ADDRESS);
        retryCount = message.getIntProperty(Constants.RETRY_COUNT);
        isScheduled = message.propertyExists(Constants.IS_SCHEDULED)
                ? message.getBooleanProperty(Constants.IS_SCHEDULED)
                : false;
    } catch (final JMSException e) {
        LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
        LOGGER.debug("correlationUid: {}", correlationUid);
        LOGGER.debug("domain: {}", domain);
        LOGGER.debug("domainVersion: {}", domainVersion);
        LOGGER.debug("messageType: {}", messageType);
        LOGGER.debug("organisationIdentification: {}", organisationIdentification);
        LOGGER.debug("deviceIdentification: {}", deviceIdentification);
        LOGGER.debug("ipAddress: {}", ipAddress);
        return;
    }

    try {
        final ResumeScheduleMessageDataContainerDto resumeScheduleMessageDataContainer = (ResumeScheduleMessageDataContainerDto) message
                .getObject();

        LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);

        final ResumeScheduleDeviceRequest deviceRequest = new ResumeScheduleDeviceRequest(
                organisationIdentification, deviceIdentification, correlationUid,
                resumeScheduleMessageDataContainer, domain, domainVersion, messageType, ipAddress, retryCount,
                isScheduled);

        this.deviceService.resumeSchedule(deviceRequest);
    } catch (final Exception e) {
        this.handleError(e, correlationUid, organisationIdentification, deviceIdentification, domain,
                domainVersion, messageType, retryCount);
    }
}

From source file:com.alliander.osgp.adapter.protocol.oslp.elster.infra.messaging.processors.PublicLightingSetLightRequestMessageProcessor.java

@Override
public void processMessage(final ObjectMessage message) {
    LOGGER.debug("Processing public lighting set light request message");

    String correlationUid = null;
    String domain = null;// w w  w . ja va2  s  . com
    String domainVersion = null;
    String messageType = null;
    String organisationIdentification = null;
    String deviceIdentification = null;
    String ipAddress = null;
    int retryCount = 0;
    boolean isScheduled = false;

    try {
        correlationUid = message.getJMSCorrelationID();
        domain = message.getStringProperty(Constants.DOMAIN);
        domainVersion = message.getStringProperty(Constants.DOMAIN_VERSION);
        messageType = message.getJMSType();
        organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION);
        deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION);
        ipAddress = message.getStringProperty(Constants.IP_ADDRESS);
        retryCount = message.getIntProperty(Constants.RETRY_COUNT);
        isScheduled = message.propertyExists(Constants.IS_SCHEDULED)
                ? message.getBooleanProperty(Constants.IS_SCHEDULED)
                : false;
    } catch (final JMSException e) {
        LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
        LOGGER.debug("correlationUid: {}", correlationUid);
        LOGGER.debug("domain: {}", domain);
        LOGGER.debug("domainVersion: {}", domainVersion);
        LOGGER.debug("messageType: {}", messageType);
        LOGGER.debug("organisationIdentification: {}", organisationIdentification);
        LOGGER.debug("deviceIdentification: {}", deviceIdentification);
        LOGGER.debug("ipAddress: {}", ipAddress);
        return;
    }

    try {
        final LightValueMessageDataContainerDto lightValueMessageDataContainer = (LightValueMessageDataContainerDto) message
                .getObject();

        LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);

        final SetLightDeviceRequest deviceRequest = new SetLightDeviceRequest(organisationIdentification,
                deviceIdentification, correlationUid, lightValueMessageDataContainer, domain, domainVersion,
                messageType, ipAddress, retryCount, isScheduled);

        this.deviceService.setLight(deviceRequest);
    } catch (final Exception e) {
        this.handleError(e, correlationUid, organisationIdentification, deviceIdentification, domain,
                domainVersion, messageType, retryCount);
    }
}

From source file:com.alliander.osgp.adapter.protocol.oslp.elster.infra.messaging.processors.CommonGetFirmwareRequestMessageProcessor.java

@Override
public void processMessage(final ObjectMessage message) {
    LOGGER.debug("Processing common get firmware request message");

    String correlationUid = null;
    String domain = null;/* w  ww  .  j  av a2 s . c  o  m*/
    String domainVersion = null;
    String messageType = null;
    String organisationIdentification = null;
    String deviceIdentification = null;
    String ipAddress = null;
    int retryCount = 0;
    boolean isScheduled = false;

    try {
        correlationUid = message.getJMSCorrelationID();
        domain = message.getStringProperty(Constants.DOMAIN);
        domainVersion = message.getStringProperty(Constants.DOMAIN_VERSION);
        messageType = message.getJMSType();
        organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION);
        deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION);
        ipAddress = message.getStringProperty(Constants.IP_ADDRESS);
        retryCount = message.getIntProperty(Constants.RETRY_COUNT);
        isScheduled = message.propertyExists(Constants.IS_SCHEDULED)
                ? message.getBooleanProperty(Constants.IS_SCHEDULED)
                : false;
    } catch (final JMSException e) {
        LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
        LOGGER.debug("correlationUid: {}", correlationUid);
        LOGGER.debug("domain: {}", domain);
        LOGGER.debug("domainVersion: {}", domainVersion);
        LOGGER.debug("messageType: {}", messageType);
        LOGGER.debug("organisationIdentification: {}", organisationIdentification);
        LOGGER.debug("deviceIdentification: {}", deviceIdentification);
        LOGGER.debug("ipAddress: {}", ipAddress);
        return;
    }

    LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);

    final DeviceRequest deviceRequest = new DeviceRequest(organisationIdentification, deviceIdentification,
            correlationUid, domain, domainVersion, messageType, ipAddress, retryCount, isScheduled);

    this.deviceService.getFirmwareVersion(deviceRequest);
}

From source file:com.alliander.osgp.adapter.protocol.oslp.elster.infra.messaging.processors.PublicLightingGetStatusRequestMessageProcessor.java

@Override
public void processMessage(final ObjectMessage message) {
    LOGGER.info("Processing public lighting get status request message");

    String correlationUid = null;
    String domain = null;/*from  w  ww .j  a  v a 2  s .co m*/
    String domainVersion = null;
    String messageType = null;
    String organisationIdentification = null;
    String deviceIdentification = null;
    String ipAddress = null;
    int retryCount = 0;
    boolean isScheduled = false;

    try {
        correlationUid = message.getJMSCorrelationID();
        domain = message.getStringProperty(Constants.DOMAIN);
        domainVersion = message.getStringProperty(Constants.DOMAIN_VERSION);
        messageType = message.getJMSType();
        organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION);
        deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION);
        ipAddress = message.getStringProperty(Constants.IP_ADDRESS);
        retryCount = message.getIntProperty(Constants.RETRY_COUNT);
        isScheduled = message.propertyExists(Constants.IS_SCHEDULED)
                ? message.getBooleanProperty(Constants.IS_SCHEDULED)
                : false;
    } catch (final JMSException e) {
        LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
        LOGGER.debug("correlationUid: {}", correlationUid);
        LOGGER.debug("domain: {}", domain);
        LOGGER.debug("domainVersion: {}", domainVersion);
        LOGGER.debug("messageType: {}", messageType);
        LOGGER.debug("organisationIdentification: {}", organisationIdentification);
        LOGGER.debug("deviceIdentification: {}", deviceIdentification);
        LOGGER.debug("ipAddress: {}", ipAddress);
        return;
    }

    LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);

    final GetStatusDeviceRequest deviceRequest = new GetStatusDeviceRequest(organisationIdentification,
            deviceIdentification, correlationUid, DomainTypeDto.PUBLIC_LIGHTING, domain, domainVersion,
            messageType, ipAddress, retryCount, isScheduled);

    this.deviceService.getStatus(deviceRequest);
}

From source file:com.alliander.osgp.adapter.protocol.oslp.elster.infra.messaging.processors.TariffSwitchingGetStatusRequestMessageProcessor.java

@Override
public void processMessage(final ObjectMessage message) {
    LOGGER.info("Processing tariff switching get status request message");

    String correlationUid = null;
    String domain = null;//from   w w w . j a  v  a2s . c  o m
    String domainVersion = null;
    String messageType = null;
    String organisationIdentification = null;
    String deviceIdentification = null;
    String ipAddress = null;
    int retryCount = 0;
    boolean isScheduled = false;

    try {
        correlationUid = message.getJMSCorrelationID();
        domain = message.getStringProperty(Constants.DOMAIN);
        domainVersion = message.getStringProperty(Constants.DOMAIN_VERSION);
        messageType = message.getJMSType();
        organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION);
        deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION);
        ipAddress = message.getStringProperty(Constants.IP_ADDRESS);
        retryCount = message.getIntProperty(Constants.RETRY_COUNT);
        isScheduled = message.propertyExists(Constants.IS_SCHEDULED)
                ? message.getBooleanProperty(Constants.IS_SCHEDULED)
                : false;
    } catch (final JMSException e) {
        LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
        LOGGER.debug("correlationUid: {}", correlationUid);
        LOGGER.debug("domain: {}", domain);
        LOGGER.debug("domainVersion: {}", domainVersion);
        LOGGER.debug("messageType: {}", messageType);
        LOGGER.debug("organisationIdentification: {}", organisationIdentification);
        LOGGER.debug("deviceIdentification: {}", deviceIdentification);
        LOGGER.debug("ipAddress: {}", ipAddress);
        return;
    }

    LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);

    final GetStatusDeviceRequest deviceRequest = new GetStatusDeviceRequest(organisationIdentification,
            deviceIdentification, correlationUid, DomainTypeDto.TARIFF_SWITCHING, domain, domainVersion,
            messageType, ipAddress, retryCount, isScheduled);

    this.deviceService.getStatus(deviceRequest);
}

From source file:com.alliander.osgp.adapter.protocol.oslp.elster.infra.messaging.processors.CommonSwitchConfigurationRequestMessageProcessor.java

@Override
public void processMessage(final ObjectMessage message) {
    LOGGER.debug("Processing common get configuration message");

    String correlationUid = null;
    String domain = null;//ww w . jav a 2s. c om
    String domainVersion = null;
    String messageType = null;
    String organisationIdentification = null;
    String deviceIdentification = null;
    String ipAddress = null;
    int retryCount = 0;
    boolean isScheduled = false;
    String configurationBank = null;

    try {
        correlationUid = message.getJMSCorrelationID();
        domain = message.getStringProperty(Constants.DOMAIN);
        domainVersion = message.getStringProperty(Constants.DOMAIN_VERSION);
        messageType = message.getJMSType();
        organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION);
        deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION);
        ipAddress = message.getStringProperty(Constants.IP_ADDRESS);
        retryCount = message.getIntProperty(Constants.RETRY_COUNT);
        isScheduled = message.propertyExists(Constants.IS_SCHEDULED)
                ? message.getBooleanProperty(Constants.IS_SCHEDULED)
                : false;
        configurationBank = (String) message.getObject();
    } catch (final JMSException e) {
        LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
        LOGGER.debug("correlationUid: {}", correlationUid);
        LOGGER.debug("domain: {}", domain);
        LOGGER.debug("domainVersion: {}", domainVersion);
        LOGGER.debug("messageType: {}", messageType);
        LOGGER.debug("organisationIdentification: {}", organisationIdentification);
        LOGGER.debug("deviceIdentification: {}", deviceIdentification);
        LOGGER.debug("ipAddress: {}", ipAddress);
        return;
    }

    LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);

    final SwitchConfigurationBankRequest deviceRequest = new SwitchConfigurationBankRequest(
            organisationIdentification, deviceIdentification, correlationUid, configurationBank, domain,
            domainVersion, messageType, ipAddress, retryCount, isScheduled);

    this.deviceService.switchConfiguration(deviceRequest);
}

From source file:com.alliander.osgp.adapter.protocol.iec61850.infra.messaging.processors.CommonStopDeviceTestRequestMessageProcessor.java

@Override
public void processMessage(final ObjectMessage message) throws JMSException {
    LOGGER.debug("Processing common stop device test request message");

    String correlationUid = null;
    String domain = null;/*w ww  . jav  a 2 s  .c o m*/
    String domainVersion = null;
    String messageType = null;
    String organisationIdentification = null;
    String deviceIdentification = null;
    String ipAddress = null;
    int retryCount = 0;
    boolean isScheduled = false;

    try {
        correlationUid = message.getJMSCorrelationID();
        domain = message.getStringProperty(Constants.DOMAIN);
        domainVersion = message.getStringProperty(Constants.DOMAIN_VERSION);
        messageType = message.getJMSType();
        organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION);
        deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION);
        ipAddress = message.getStringProperty(Constants.IP_ADDRESS);
        retryCount = message.getIntProperty(Constants.RETRY_COUNT);
        isScheduled = message.propertyExists(Constants.IS_SCHEDULED)
                ? message.getBooleanProperty(Constants.IS_SCHEDULED)
                : false;
    } catch (final JMSException e) {
        LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
        LOGGER.debug("correlationUid: {}", correlationUid);
        LOGGER.debug("domain: {}", domain);
        LOGGER.debug("domainVersion: {}", domainVersion);
        LOGGER.debug("messageType: {}", messageType);
        LOGGER.debug("organisationIdentification: {}", organisationIdentification);
        LOGGER.debug("deviceIdentification: {}", deviceIdentification);
        LOGGER.debug("ipAddress: {}", ipAddress);
        return;
    }

    LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);

    final RequestMessageData requestMessageData = new RequestMessageData(null, domain, domainVersion,
            messageType, retryCount, isScheduled, correlationUid, organisationIdentification,
            deviceIdentification);

    final DeviceResponseHandler deviceResponseHandler = new DeviceResponseHandler() {

        @Override
        public void handleResponse(final DeviceResponse deviceResponse) {
            CommonStopDeviceTestRequestMessageProcessor.this.handleEmptyDeviceResponse(deviceResponse,
                    CommonStopDeviceTestRequestMessageProcessor.this.responseMessageSender,
                    requestMessageData.getDomain(), requestMessageData.getDomainVersion(),
                    requestMessageData.getMessageType(), requestMessageData.getRetryCount());
        }

        @Override
        public void handleException(final Throwable t, final DeviceResponse deviceResponse,
                final boolean expected) {

            if (expected) {
                CommonStopDeviceTestRequestMessageProcessor.this.handleExpectedError(
                        new ConnectionFailureException(ComponentType.PROTOCOL_IEC61850, t.getMessage()),
                        requestMessageData.getCorrelationUid(),
                        requestMessageData.getOrganisationIdentification(),
                        requestMessageData.getDeviceIdentification(), requestMessageData.getDomain(),
                        requestMessageData.getDomainVersion(), requestMessageData.getMessageType());
            } else {
                CommonStopDeviceTestRequestMessageProcessor.this.handleUnExpectedError(deviceResponse, t,
                        requestMessageData.getMessageData(), requestMessageData.getDomain(),
                        requestMessageData.getDomainVersion(), requestMessageData.getMessageType(),
                        requestMessageData.isScheduled(), requestMessageData.getRetryCount());
            }
        }
    };

    LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);

    final DeviceRequest deviceRequest = new DeviceRequest(organisationIdentification, deviceIdentification,
            correlationUid, domain, domainVersion, messageType, ipAddress, retryCount, isScheduled);

    // This is a stop selftest, so startOfTest == false
    this.deviceService.runSelfTest(deviceRequest, deviceResponseHandler, false);
}