use of org.openmuc.jdlms.AccessResultCode in project open-smart-grid-platform by OSGP.
the class ConfigurationService method setSpecialDays.
public void setSpecialDays(final DlmsConnectionManager conn, final DlmsDevice device, final SpecialDaysRequestDto specialDaysRequest, final MessageMetadata messageMetadata) throws ProtocolAdapterException {
// The Special days towards the Smart Meter
final SpecialDaysRequestDataDto specialDaysRequestData = specialDaysRequest.getSpecialDaysRequestData();
LOGGER.info(VISUAL_SEPARATOR);
LOGGER.info("********** Set Special Days: 0-0:11.0.0.255 **********");
LOGGER.info(VISUAL_SEPARATOR);
final List<SpecialDayDto> specialDays = specialDaysRequestData.getSpecialDays();
for (final SpecialDayDto specialDay : specialDays) {
LOGGER.info("Date :{}, dayId : {} ", specialDay.getSpecialDayDate(), specialDay.getDayId());
}
LOGGER.info(VISUAL_SEPARATOR);
final AccessResultCode accessResultCode = this.setSpecialDaysCommandExecutor.execute(conn, device, specialDays, messageMetadata);
if (!AccessResultCode.SUCCESS.equals(accessResultCode)) {
throw new ProtocolAdapterException("Set special days reported result is: " + accessResultCode);
}
}
use of org.openmuc.jdlms.AccessResultCode in project open-smart-grid-platform by OSGP.
the class ConfigurationService method requestSetAdministrativeStatus.
public void requestSetAdministrativeStatus(final DlmsConnectionManager conn, final DlmsDevice device, final AdministrativeStatusTypeDto administrativeStatusType, final MessageMetadata messageMetadata) throws ProtocolAdapterException {
LOGGER.info("Device for Set Administrative Status is: {}", device);
final AccessResultCode accessResultCode = this.setAdministrativeStatusCommandExecutor.execute(conn, device, administrativeStatusType, messageMetadata);
if (AccessResultCode.SUCCESS != accessResultCode) {
throw new ProtocolAdapterException("AccessResultCode for set administrative status was not SUCCESS: " + accessResultCode);
}
}
use of org.openmuc.jdlms.AccessResultCode in project open-smart-grid-platform by OSGP.
the class ConfigurationService method setPushSetupAlarm.
public void setPushSetupAlarm(final DlmsConnectionManager conn, final DlmsDevice device, final PushSetupAlarmDto pushSetupAlarm, final MessageMetadata messageMetadata) throws ProtocolAdapterException {
LOGGER.info("Push Setup Alarm to set on the device: {}", pushSetupAlarm);
final AccessResultCode accessResultCode = this.setPushSetupAlarmCommandExecutor.execute(conn, device, pushSetupAlarm, messageMetadata);
if (AccessResultCode.SUCCESS != accessResultCode) {
throw new ProtocolAdapterException("AccessResultCode for set push setup alarm was not SUCCESS: " + accessResultCode);
}
}
use of org.openmuc.jdlms.AccessResultCode in project open-smart-grid-platform by OSGP.
the class ConfigurationService method setPushSetupSms.
public void setPushSetupSms(final DlmsConnectionManager conn, final DlmsDevice device, final PushSetupSmsDto pushSetupSms, final MessageMetadata messageMetadata) throws ProtocolAdapterException {
LOGGER.info("Push Setup Sms to set on the device: {}", pushSetupSms);
final AccessResultCode accessResultCode = this.setPushSetupSmsCommandExecutor.execute(conn, device, pushSetupSms, messageMetadata);
if (AccessResultCode.SUCCESS != accessResultCode) {
throw new ProtocolAdapterException("AccessResultCode for set push setup sms was not SUCCESS: " + accessResultCode);
}
}
use of org.openmuc.jdlms.AccessResultCode in project open-smart-grid-platform by OSGP.
the class ConfigurationService method requestSetConfiguration.
// === REQUEST Configuration Object DATA ===
public void requestSetConfiguration(final DlmsConnectionManager conn, final DlmsDevice device, final SetConfigurationObjectRequestDto setConfigurationObjectRequest, final MessageMetadata messageMetadata) throws ProtocolAdapterException {
// Configuration Object towards the Smart Meter
final ConfigurationObjectDto configurationObject = setConfigurationObjectRequest.getSetConfigurationObjectRequestData().getConfigurationObject();
final GprsOperationModeTypeDto gprsOperationModeType = configurationObject.getGprsOperationMode();
final ConfigurationFlagsDto configurationFlags = configurationObject.getConfigurationFlags();
LOGGER.info(VISUAL_SEPARATOR);
LOGGER.info("******** Configuration Object: 0-1:94.31.3.255 *******");
LOGGER.info(VISUAL_SEPARATOR);
LOGGER.info("Operation mode: {}", gprsOperationModeType == null ? "not altered by this request" : gprsOperationModeType);
if (configurationFlags == null) {
LOGGER.info("Flags: none enabled or disabled by this request");
} else {
LOGGER.info("{}", configurationFlags);
}
LOGGER.info(VISUAL_SEPARATOR);
final AccessResultCode accessResultCode = this.setConfigurationObjectCommandExecutor.execute(conn, device, configurationObject, messageMetadata);
if (!AccessResultCode.SUCCESS.equals(accessResultCode)) {
throw new ProtocolAdapterException("Set configuration object reported result is: " + accessResultCode);
}
}
Aggregations