{"action":"created","comment":{"url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls/comments/59833358","id":59833358,"diff_hunk":"@@ -0,0 +1,58 @@\n+/**\n+ * Copyright 2016 Smart Society Services B.V.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License.  You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ */\n+package org.osgp.adapter.protocol.dlms.domain.commands;\n+\n+import org.openmuc.jdlms.ClientConnection;\n+import org.openmuc.jdlms.MethodResultCode;\n+import org.osgp.adapter.protocol.dlms.domain.entities.DlmsDevice;\n+import org.osgp.adapter.protocol.dlms.exceptions.ProtocolAdapterException;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.stereotype.Component;\n+\n+import com.alliander.osgp.dto.valueobjects.smartmetering.ActionResponseDto;\n+import com.alliander.osgp.dto.valueobjects.smartmetering.ActivityCalendarDataDto;\n+\n+@Component()\n+public class SetActivityCalendarBundleCommandExecutor implements\n+        CommandExecutor<ActivityCalendarDataDto, ActionResponseDto> {\n+\n+    private static final Logger LOGGER = LoggerFactory.getLogger(SetActivityCalendarBundleCommandExecutor.class);\n+\n+    @Autowired\n+    private SetActivityCalendarCommandExecutor setActivityCalendarCommandExecutor;\n+\n+    @Autowired\n+    private SetActivityCalendarCommandActivationExecutor setActivityCalendarCommandActivationExecutor;\n+\n+    @Override\n+    public ActionResponseDto execute(final ClientConnection conn, final DlmsDevice device,\n+            final ActivityCalendarDataDto activityCalendar) {\n+\n+        MethodResultCode methodResult = null;\n+\n+        try {\n+            this.setActivityCalendarCommandExecutor.execute(conn, device, activityCalendar.getActivityCalendar());\n+\n+            methodResult = this.setActivityCalendarCommandActivationExecutor.execute(conn, device, null);\n+        } catch (final ProtocolAdapterException e) {\n+            LOGGER.error(\"Error while setting new activity calendar\", e);\n+            return new ActionResponseDto(e, \"Error while setting new activity calendar\");\n+        }\n+\n+        if (!MethodResultCode.SUCCESS.equals(methodResult)) {","path":"osgp-protocol-adapter-dlms/src/main/java/org/osgp/adapter/protocol/dlms/domain/commands/SetActivityCalendarBundleCommandExecutor.java","position":49,"original_position":49,"commit_id":"ce8c6017620c96d957ba252c31b335738e3a75e0","original_commit_id":"ce8c6017620c96d957ba252c31b335738e3a75e0","user":{"login":"robinbakkeruscgi","id":18286805,"avatar_url":"https://avatars.githubusercontent.com/u/18286805?v=3","gravatar_id":"","url":"https://api.github.com/users/robinbakkeruscgi","html_url":"https://github.com/robinbakkeruscgi","followers_url":"https://api.github.com/users/robinbakkeruscgi/followers","following_url":"https://api.github.com/users/robinbakkeruscgi/following{/other_user}","gists_url":"https://api.github.com/users/robinbakkeruscgi/gists{/gist_id}","starred_url":"https://api.github.com/users/robinbakkeruscgi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robinbakkeruscgi/subscriptions","organizations_url":"https://api.github.com/users/robinbakkeruscgi/orgs","repos_url":"https://api.github.com/users/robinbakkeruscgi/repos","events_url":"https://api.github.com/users/robinbakkeruscgi/events{/privacy}","received_events_url":"https://api.github.com/users/robinbakkeruscgi/received_events","type":"User","site_admin":false},"body":"stop deze hierboven in try block","created_at":"2016-04-15T06:53:38Z","updated_at":"2016-04-15T06:53:38Z","html_url":"https://github.com/OSGP/Protocol-Adapter-DLMS/pull/97#discussion_r59833358","pull_request_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls/97","_links":{"self":{"href":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls/comments/59833358"},"html":{"href":"https://github.com/OSGP/Protocol-Adapter-DLMS/pull/97#discussion_r59833358"},"pull_request":{"href":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls/97","id":65303989,"html_url":"https://github.com/OSGP/Protocol-Adapter-DLMS/pull/97","diff_url":"https://github.com/OSGP/Protocol-Adapter-DLMS/pull/97.diff","patch_url":"https://github.com/OSGP/Protocol-Adapter-DLMS/pull/97.patch","issue_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/issues/97","number":97,"state":"open","locked":false,"title":"Slim 484 bundle","user":{"login":"hannek24","id":6457709,"avatar_url":"https://avatars.githubusercontent.com/u/6457709?v=3","gravatar_id":"","url":"https://api.github.com/users/hannek24","html_url":"https://github.com/hannek24","followers_url":"https://api.github.com/users/hannek24/followers","following_url":"https://api.github.com/users/hannek24/following{/other_user}","gists_url":"https://api.github.com/users/hannek24/gists{/gist_id}","starred_url":"https://api.github.com/users/hannek24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hannek24/subscriptions","organizations_url":"https://api.github.com/users/hannek24/orgs","repos_url":"https://api.github.com/users/hannek24/repos","events_url":"https://api.github.com/users/hannek24/events{/privacy}","received_events_url":"https://api.github.com/users/hannek24/received_events","type":"User","site_admin":false},"body":"https://smartsocietyservices.atlassian.net/browse/SLIM-484","created_at":"2016-04-05T13:28:14Z","updated_at":"2016-04-15T06:53:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2920c6bf151cd73edd943bc7d8dba2694f2acbe3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls/97/commits","review_comments_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls/97/comments","review_comment_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/issues/97/comments","statuses_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/statuses/ce8c6017620c96d957ba252c31b335738e3a75e0","head":{"label":"OSGP:SLIM-484-bundle","ref":"SLIM-484-bundle","sha":"ce8c6017620c96d957ba252c31b335738e3a75e0","user":{"login":"OSGP","id":11352045,"avatar_url":"https://avatars.githubusercontent.com/u/11352045?v=3","gravatar_id":"","url":"https://api.github.com/users/OSGP","html_url":"https://github.com/OSGP","followers_url":"https://api.github.com/users/OSGP/followers","following_url":"https://api.github.com/users/OSGP/following{/other_user}","gists_url":"https://api.github.com/users/OSGP/gists{/gist_id}","starred_url":"https://api.github.com/users/OSGP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OSGP/subscriptions","organizations_url":"https://api.github.com/users/OSGP/orgs","repos_url":"https://api.github.com/users/OSGP/repos","events_url":"https://api.github.com/users/OSGP/events{/privacy}","received_events_url":"https://api.github.com/users/OSGP/received_events","type":"Organization","site_admin":false},"repo":{"id":33675294,"name":"Protocol-Adapter-DLMS","full_name":"OSGP/Protocol-Adapter-DLMS","owner":{"login":"OSGP","id":11352045,"avatar_url":"https://avatars.githubusercontent.com/u/11352045?v=3","gravatar_id":"","url":"https://api.github.com/users/OSGP","html_url":"https://github.com/OSGP","followers_url":"https://api.github.com/users/OSGP/followers","following_url":"https://api.github.com/users/OSGP/following{/other_user}","gists_url":"https://api.github.com/users/OSGP/gists{/gist_id}","starred_url":"https://api.github.com/users/OSGP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OSGP/subscriptions","organizations_url":"https://api.github.com/users/OSGP/orgs","repos_url":"https://api.github.com/users/OSGP/repos","events_url":"https://api.github.com/users/OSGP/events{/privacy}","received_events_url":"https://api.github.com/users/OSGP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OSGP/Protocol-Adapter-DLMS","description":"Protocol adapter and device simulator for Device Language Message Specification protocol.","fork":false,"url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS","forks_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/forks","keys_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/teams","hooks_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/hooks","issue_events_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/issues/events{/number}","events_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/events","assignees_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/assignees{/user}","branches_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/branches{/branch}","tags_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/tags","blobs_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/git/refs{/sha}","trees_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/statuses/{sha}","languages_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/languages","stargazers_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/stargazers","contributors_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/contributors","subscribers_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/subscribers","subscription_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/subscription","commits_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/commits{/sha}","git_commits_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/git/commits{/sha}","comments_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/comments{/number}","issue_comment_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/issues/comments{/number}","contents_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/contents/{+path}","compare_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/merges","archive_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/downloads","issues_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/issues{/number}","pulls_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls{/number}","milestones_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/milestones{/number}","notifications_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/labels{/name}","releases_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/releases{/id}","deployments_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/deployments","created_at":"2015-04-09T14:59:22Z","updated_at":"2016-01-13T08:54:07Z","pushed_at":"2016-04-14T08:54:58Z","git_url":"git://github.com/OSGP/Protocol-Adapter-DLMS.git","ssh_url":"git@github.com:OSGP/Protocol-Adapter-DLMS.git","clone_url":"https://github.com/OSGP/Protocol-Adapter-DLMS.git","svn_url":"https://github.com/OSGP/Protocol-Adapter-DLMS","homepage":"","size":8372,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":9,"forks":1,"open_issues":9,"watchers":0,"default_branch":"development"}},"base":{"label":"OSGP:development","ref":"development","sha":"a1c918c8cd62eb9bdba0e189d1f800a32c918187","user":{"login":"OSGP","id":11352045,"avatar_url":"https://avatars.githubusercontent.com/u/11352045?v=3","gravatar_id":"","url":"https://api.github.com/users/OSGP","html_url":"https://github.com/OSGP","followers_url":"https://api.github.com/users/OSGP/followers","following_url":"https://api.github.com/users/OSGP/following{/other_user}","gists_url":"https://api.github.com/users/OSGP/gists{/gist_id}","starred_url":"https://api.github.com/users/OSGP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OSGP/subscriptions","organizations_url":"https://api.github.com/users/OSGP/orgs","repos_url":"https://api.github.com/users/OSGP/repos","events_url":"https://api.github.com/users/OSGP/events{/privacy}","received_events_url":"https://api.github.com/users/OSGP/received_events","type":"Organization","site_admin":false},"repo":{"id":33675294,"name":"Protocol-Adapter-DLMS","full_name":"OSGP/Protocol-Adapter-DLMS","owner":{"login":"OSGP","id":11352045,"avatar_url":"https://avatars.githubusercontent.com/u/11352045?v=3","gravatar_id":"","url":"https://api.github.com/users/OSGP","html_url":"https://github.com/OSGP","followers_url":"https://api.github.com/users/OSGP/followers","following_url":"https://api.github.com/users/OSGP/following{/other_user}","gists_url":"https://api.github.com/users/OSGP/gists{/gist_id}","starred_url":"https://api.github.com/users/OSGP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OSGP/subscriptions","organizations_url":"https://api.github.com/users/OSGP/orgs","repos_url":"https://api.github.com/users/OSGP/repos","events_url":"https://api.github.com/users/OSGP/events{/privacy}","received_events_url":"https://api.github.com/users/OSGP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OSGP/Protocol-Adapter-DLMS","description":"Protocol adapter and device simulator for Device Language Message Specification protocol.","fork":false,"url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS","forks_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/forks","keys_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/teams","hooks_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/hooks","issue_events_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/issues/events{/number}","events_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/events","assignees_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/assignees{/user}","branches_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/branches{/branch}","tags_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/tags","blobs_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/git/refs{/sha}","trees_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/statuses/{sha}","languages_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/languages","stargazers_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/stargazers","contributors_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/contributors","subscribers_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/subscribers","subscription_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/subscription","commits_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/commits{/sha}","git_commits_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/git/commits{/sha}","comments_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/comments{/number}","issue_comment_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/issues/comments{/number}","contents_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/contents/{+path}","compare_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/merges","archive_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/downloads","issues_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/issues{/number}","pulls_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls{/number}","milestones_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/milestones{/number}","notifications_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/labels{/name}","releases_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/releases{/id}","deployments_url":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/deployments","created_at":"2015-04-09T14:59:22Z","updated_at":"2016-01-13T08:54:07Z","pushed_at":"2016-04-14T08:54:58Z","git_url":"git://github.com/OSGP/Protocol-Adapter-DLMS.git","ssh_url":"git@github.com:OSGP/Protocol-Adapter-DLMS.git","clone_url":"https://github.com/OSGP/Protocol-Adapter-DLMS.git","svn_url":"https://github.com/OSGP/Protocol-Adapter-DLMS","homepage":"","size":8372,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":9,"forks":1,"open_issues":9,"watchers":0,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls/97"},"html":{"href":"https://github.com/OSGP/Protocol-Adapter-DLMS/pull/97"},"issue":{"href":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/issues/97"},"comments":{"href":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/OSGP/Protocol-Adapter-DLMS/statuses/ce8c6017620c96d957ba252c31b335738e3a75e0"}}}}