use of javax.jms.JMSException in project Protocol-Adapter-OSLP by OSGP.
the class CommonUpdateDeviceSslCertificationRequestMessageProcessor method processMessage.
@Override
public void processMessage(final ObjectMessage message) {
LOGGER.debug("Processing common update device ssl certification message");
String correlationUid = null;
String domain = null;
String domainVersion = null;
String messageType = null;
String organisationIdentification = null;
String deviceIdentification = null;
String ipAddress = null;
Boolean isScheduled = null;
int retryCount = 0;
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);
isScheduled = message.propertyExists(Constants.IS_SCHEDULED) ? message.getBooleanProperty(Constants.IS_SCHEDULED) : false;
retryCount = message.getIntProperty(Constants.RETRY_COUNT);
} 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);
LOGGER.debug("scheduled: {}", isScheduled);
return;
}
try {
final com.alliander.osgp.dto.valueobjects.CertificationDto certification = (com.alliander.osgp.dto.valueobjects.CertificationDto) message.getObject();
LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);
final UpdateDeviceSslCertificationDeviceRequest deviceRequest = new UpdateDeviceSslCertificationDeviceRequest(organisationIdentification, deviceIdentification, correlationUid, certification, domain, domainVersion, messageType, ipAddress, retryCount, isScheduled);
this.deviceService.updateDeviceSslCertification(deviceRequest);
} catch (final Exception e) {
this.handleError(e, correlationUid, organisationIdentification, deviceIdentification, domain, domainVersion, messageType, retryCount);
}
}
use of javax.jms.JMSException in project Protocol-Adapter-OSLP by OSGP.
the class PublicLightingGetPowerUsageHistoryRequestMessageProcessor method processMessage.
@Override
public void processMessage(final ObjectMessage message) {
LOGGER.debug("Processing public lighting get power usage history request message");
String correlationUid = null;
String domain = null;
String domainVersion = null;
String messageType = null;
String organisationIdentification = null;
String deviceIdentification = null;
String ipAddress = null;
Boolean isScheduled = null;
int retryCount = 0;
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);
isScheduled = message.getBooleanProperty(Constants.IS_SCHEDULED);
retryCount = message.getIntProperty(Constants.RETRY_COUNT);
} 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);
LOGGER.debug("scheduled: {}", isScheduled);
return;
}
try {
final PowerUsageHistoryMessageDataContainerDto powerUsageHistoryMessageDataContainerDto = (PowerUsageHistoryMessageDataContainerDto) message.getObject();
LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);
final GetPowerUsageHistoryDeviceRequest deviceRequest = new GetPowerUsageHistoryDeviceRequest(organisationIdentification, deviceIdentification, correlationUid, powerUsageHistoryMessageDataContainerDto, domain, domainVersion, messageType, ipAddress, retryCount, isScheduled);
this.deviceService.getPowerUsageHistory(deviceRequest);
} catch (final Exception e) {
this.handleError(e, correlationUid, organisationIdentification, deviceIdentification, domain, domainVersion, messageType, retryCount);
}
}
use of javax.jms.JMSException in project Protocol-Adapter-OSLP by OSGP.
the class PublicLightingResumeScheduleRequestMessageProcessor method processMessage.
@Override
public void processMessage(final ObjectMessage message) {
LOGGER.debug("Processing public lighting resume schedule request message");
String correlationUid = null;
String domain = null;
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);
}
}
use of javax.jms.JMSException in project Protocol-Adapter-OSLP by OSGP.
the class PublicLightingSetLightRequestMessageProcessor method processMessage.
@Override
public void processMessage(final ObjectMessage message) {
LOGGER.debug("Processing public lighting set light request message");
String correlationUid = null;
String domain = null;
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);
}
}
use of javax.jms.JMSException in project Protocol-Adapter-OSLP by OSGP.
the class PublicLightingSetTransitionRequestMessageProcessor method processMessage.
@Override
public void processMessage(final ObjectMessage message) {
LOGGER.debug("Processing public lighting set transition request message");
String correlationUid = null;
String domain = null;
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);
}
}
Aggregations