Source:
public AccessResultCode execute(final DlmsConnectionHolder conn, final DlmsDevice device, final ActivityCalendarDto activityCalendar) throws ProtocolAdapterException { LOGGER.debug("SetActivityCalendarCommandExecutor.execute called", activityCalendar.getCalendarName()); final List<SeasonProfileDto> seasonProfileList = activityCalendar.getSeasonProfileList(); final Set<WeekProfileDto> weekProfileSet = this.getWeekProfileSet(seasonProfileList); final Set<DayProfileDto> dayProfileSet = this.getDayProfileSet(weekProfileSet); final DataObjectAttrExecutors dataObjectExecutors = new DataObjectAttrExecutors("SetActivityCalendar") .addExecutor(this.getCalendarNameExecutor(activityCalendar)) .addExecutor(this.getSeasonProfileExecutor(seasonProfileList)) .addExecutor(this.getWeekProfileTableExecutor(weekProfileSet)) .addExecutor(this.getDayProfileTablePassiveExecutor(dayProfileSet)); if (conn.hasDlmsMessageListener()) { final List<DataObjectAttrExecutor> dataObjectAttrExecutorList = dataObjectExecutors .getDataObjectAttrExecutorList(); final int numberOfAttributes = dataObjectAttrExecutorList.size(); final AttributeAddress[] attributeAddresses = new AttributeAddress[numberOfAttributes]; for (int i = 0; i < numberOfAttributes; i++) { attributeAddresses[i] = dataObjectAttrExecutorList.get(i).getAttrAddress(); } conn.getDlmsMessageListener() .setDescription("SetActivityCalendar for calendar " + activityCalendar.getCalendarName() + ", set attributes: " + this.describeAttributes(attributeAddresses)); } dataObjectExecutors.execute(conn); LOGGER.info("Finished setting the passive activity calendar"); try { this.setActivityCalendarCommandActivationExecutor.execute(conn, device, null); LOGGER.info("Finished activating the passive to the active activity calendar"); } catch (final ProtocolAdapterException e) { String message = ""; for (final DataObjectAttrExecutor executor : dataObjectExecutors.getDataObjectAttrExecutorList()) { message += executor.createRequestAndResultCodeInfo(); } throw new ProtocolAdapterException(e.getMessage() + message, e); } return AccessResultCode.SUCCESS; }

Target:
public AccessResultCode execute(final DlmsConnectionHolder conn, final DlmsDevice device, final ActivityCalendarDto activityCalendar) throws ProtocolAdapterException { LOGGER.debug("SetActivityCalendarCommandExecutor.execute called", activityCalendar.getCalendarName()); final List<SeasonProfileDto> seasonProfileList = activityCalendar.getSeasonProfileList(); final Set<WeekProfileDto> weekProfileSet = this.getWeekProfileSet(seasonProfileList); final Set<DayProfileDto> dayProfileSet = this.getDayProfileSet(weekProfileSet); final DataObjectAttrExecutors dataObjectExecutors = new DataObjectAttrExecutors("SetActivityCalendar") .addExecutor(this.getCalendarNameExecutor(activityCalendar)) .addExecutor(this.getSeasonProfileExecutor(seasonProfileList)) .addExecutor(this.getWeekProfileTableExecutor(weekProfileSet)) .addExecutor(this.getDayProfileTablePassiveExecutor(dayProfileSet)); conn.getDlmsMessageListener() .setDescription("SetActivityCalendar for calendar " + activityCalendar.getCalendarName() + ", set attributes: " + dataObjectExecutors.describeAttributes()); dataObjectExecutors.execute(conn); LOGGER.info("Finished setting the passive activity calendar"); try { this.setActivityCalendarCommandActivationExecutor.execute(conn, device, null); LOGGER.info("Finished activating the passive to the active activity calendar"); } catch (final ProtocolAdapterException e) { String message = ""; for (final DataObjectAttrExecutor executor : dataObjectExecutors.getDataObjectAttrExecutorList()) { message += executor.createRequestAndResultCodeInfo(); } throw new ProtocolAdapterException(e.getMessage() + message, e); } return AccessResultCode.SUCCESS; }