{"action":"created","comment":{"url":"https://api.github.com/repos/openhab/openhab/pulls/comments/29547859","id":29547859,"diff_hunk":"@@ -0,0 +1,509 @@\n+/**\n+ * Copyright (c) 2010-2015, openHAB.org and others.\n+ *\n+ * All rights reserved. This program and the accompanying materials\n+ * are made available under the terms of the Eclipse Public License v1.0\n+ * which accompanies this distribution, and is available at\n+ * http://www.eclipse.org/legal/epl-v10.html\n+ */\n+package org.openhab.binding.caldav_command.internal;\n+\n+\n+import java.util.ArrayList;\n+import java.util.Collections;\n+import java.util.Comparator;\n+import java.util.Dictionary;\n+import java.util.List;\n+import java.util.Map.Entry;\n+import java.util.concurrent.ConcurrentHashMap;\n+\n+import org.joda.time.DateTime;\n+import org.joda.time.format.DateTimeFormat;\n+import org.joda.time.format.DateTimeFormatter;\n+import org.openhab.binding.caldav_command.CalDavBindingProvider;\n+\n+import org.openhab.core.binding.AbstractBinding;\n+import org.openhab.core.items.Item;\n+import org.openhab.core.items.ItemNotFoundException;\n+import org.openhab.core.items.ItemRegistry;\n+import org.openhab.core.library.types.DateTimeType;\n+import org.openhab.core.library.types.OnOffType;\n+import org.openhab.core.types.Command;\n+import org.openhab.core.types.State;\n+import org.openhab.core.types.TypeParser;\n+import org.openhab.io.caldav.CalDavEvent;\n+import org.openhab.io.caldav.CalDavLoader;\n+import org.openhab.io.caldav.EventNotifier;\n+import org.osgi.service.cm.ConfigurationException;\n+import org.osgi.service.cm.ManagedService;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\t\n+\n+/**\n+ * This is the default implementation of the caldav binding\n+ * \n+ * \n+ * BEGIN:ItemName:ON\n+ * BEGIN:ItemName:23\n+ * \n+ * END:ItemName:OFF\n+ * END:ItemName:16\n+ * \n+ * @author Robert Delbrück\n+ * @since 1.7.0\n+ */\n+public class CalDavBinding extends AbstractBinding<CalDavBindingProvider> implements ManagedService, EventNotifier {\n+\tprivate static final DateTimeFormatter FORMATTER = DateTimeFormat.forPattern(\"yyyy-MM-dd'T'HH:mm:ss\");\n+\tprivate static final String SCOPE_END = \"END\";\n+\tprivate static final String SCOPE_BEGIN = \"BEGIN\";\n+\t\n+\tprivate static final String KEY_READ_CALENDARS = \"readCalendars\";\n+\n+\tprivate static final Logger logger = \n+\t\tLoggerFactory.getLogger(CalDavBinding.class);\n+\t\n+\tprivate ItemRegistry itemRegistry;\n+\t\n+\tprivate CalDavLoader calDavLoader;\n+\t\n+\tprivate List<String> readCalendars = new ArrayList<String>();\n+\t\n+\t// key=item config, value=list of item changes to listen to\n+\tprivate ConcurrentHashMap<CalDavNextEventConfig, List<NextEventContainer>> itemNextEventMap = new ConcurrentHashMap<CalDavNextEventConfig, List<NextEventContainer>>();\n+\t\n+\tprivate List<String> disabledItems = new ArrayList<String>();\n+\t\n+\tpublic CalDavBinding() {\n+\t}\n+\t\n+\tpublic void setItemRegistry(ItemRegistry itemRegistry) {\n+\t\tthis.itemRegistry = itemRegistry;\n+\t}\n+\t\n+\tpublic void unsetItemRegistry(ItemRegistry itemRegistry) {\n+\t\tthis.itemRegistry = null;\n+\t}\n+\t\n+\tpublic void setCalDavLoader(CalDavLoader calDavLoader) {\n+\t\tthis.calDavLoader = calDavLoader;\n+\t\tthis.calDavLoader.addListener(this);\n+\t}\n+\t\n+\tpublic void unsetCalDavLoader() {\n+\t\tthis.calDavLoader.removeListener(this);\n+\t\tthis.calDavLoader = null;\n+\t}\n+\t\n+\tpublic void activate() {\n+\t\t\n+\t}\n+\t\n+\tpublic void deactivate() {\n+\t\t// deallocate resources here that are no longer needed and \n+\t\t// should be reset when activating this binding again\n+\t}\n+\n+\t\n+\t@Override\n+\tpublic void updated(Dictionary<String, ?> properties)\n+\t\t\tthrows ConfigurationException {\n+\t\tif (properties == null) {\n+\t\t\tlogger.warn(\"no configuration found\");","path":"bundles/binding/org.openhab.binding.caldav-command/src/main/java/org/openhab/binding/caldav_command/internal/CalDavBinding.java","position":112,"original_position":112,"commit_id":"53df4f3b0ab5e29740b007066dde20dc89d1d97e","original_commit_id":"53df4f3b0ab5e29740b007066dde20dc89d1d97e","user":{"login":"teichsta","id":2108636,"avatar_url":"https://avatars.githubusercontent.com/u/2108636?v=3","gravatar_id":"","url":"https://api.github.com/users/teichsta","html_url":"https://github.com/teichsta","followers_url":"https://api.github.com/users/teichsta/followers","following_url":"https://api.github.com/users/teichsta/following{/other_user}","gists_url":"https://api.github.com/users/teichsta/gists{/gist_id}","starred_url":"https://api.github.com/users/teichsta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teichsta/subscriptions","organizations_url":"https://api.github.com/users/teichsta/orgs","repos_url":"https://api.github.com/users/teichsta/repos","events_url":"https://api.github.com/users/teichsta/events{/privacy}","received_events_url":"https://api.github.com/users/teichsta/received_events","type":"User","site_admin":false},"body":"afaik updated() is called in every class which implements ManagedService without taking the service.pid into account. So this warn statements will appear quite offen in the logs and should be removed though.","created_at":"2015-05-02T14:36:38Z","updated_at":"2015-05-02T14:36:38Z","html_url":"https://github.com/openhab/openhab/pull/2215#discussion_r29547859","pull_request_url":"https://api.github.com/repos/openhab/openhab/pulls/2215","_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab/pulls/comments/29547859"},"html":{"href":"https://github.com/openhab/openhab/pull/2215#discussion_r29547859"},"pull_request":{"href":"https://api.github.com/repos/openhab/openhab/pulls/2215"}}},"pull_request":{"url":"https://api.github.com/repos/openhab/openhab/pulls/2215","id":30240082,"html_url":"https://github.com/openhab/openhab/pull/2215","diff_url":"https://github.com/openhab/openhab/pull/2215.diff","patch_url":"https://github.com/openhab/openhab/pull/2215.patch","issue_url":"https://api.github.com/repos/openhab/openhab/issues/2215","number":2215,"state":"open","locked":false,"title":"New CalDAV Binding, Used for scheduling and presence detection","user":{"login":"querdenker2k","id":6350333,"avatar_url":"https://avatars.githubusercontent.com/u/6350333?v=3","gravatar_id":"","url":"https://api.github.com/users/querdenker2k","html_url":"https://github.com/querdenker2k","followers_url":"https://api.github.com/users/querdenker2k/followers","following_url":"https://api.github.com/users/querdenker2k/following{/other_user}","gists_url":"https://api.github.com/users/querdenker2k/gists{/gist_id}","starred_url":"https://api.github.com/users/querdenker2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/querdenker2k/subscriptions","organizations_url":"https://api.github.com/users/querdenker2k/orgs","repos_url":"https://api.github.com/users/querdenker2k/repos","events_url":"https://api.github.com/users/querdenker2k/events{/privacy}","received_events_url":"https://api.github.com/users/querdenker2k/received_events","type":"User","site_admin":false},"body":"- Used to send commands from calendars to openhab\r\n- Used for presence detection\r\n- Used to show events (upcoming, active, all)","created_at":"2015-03-01T10:34:57Z","updated_at":"2015-05-02T14:36:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b0c259a37d8853964192278d97442f75b3deeab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openhab/openhab/pulls/2215/commits","review_comments_url":"https://api.github.com/repos/openhab/openhab/pulls/2215/comments","review_comment_url":"https://api.github.com/repos/openhab/openhab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openhab/openhab/issues/2215/comments","statuses_url":"https://api.github.com/repos/openhab/openhab/statuses/53df4f3b0ab5e29740b007066dde20dc89d1d97e","head":{"label":"querdenker2k:caldav-new","ref":"caldav-new","sha":"53df4f3b0ab5e29740b007066dde20dc89d1d97e","user":{"login":"querdenker2k","id":6350333,"avatar_url":"https://avatars.githubusercontent.com/u/6350333?v=3","gravatar_id":"","url":"https://api.github.com/users/querdenker2k","html_url":"https://github.com/querdenker2k","followers_url":"https://api.github.com/users/querdenker2k/followers","following_url":"https://api.github.com/users/querdenker2k/following{/other_user}","gists_url":"https://api.github.com/users/querdenker2k/gists{/gist_id}","starred_url":"https://api.github.com/users/querdenker2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/querdenker2k/subscriptions","organizations_url":"https://api.github.com/users/querdenker2k/orgs","repos_url":"https://api.github.com/users/querdenker2k/repos","events_url":"https://api.github.com/users/querdenker2k/events{/privacy}","received_events_url":"https://api.github.com/users/querdenker2k/received_events","type":"User","site_admin":false},"repo":{"id":30401626,"name":"openhab","full_name":"querdenker2k/openhab","owner":{"login":"querdenker2k","id":6350333,"avatar_url":"https://avatars.githubusercontent.com/u/6350333?v=3","gravatar_id":"","url":"https://api.github.com/users/querdenker2k","html_url":"https://github.com/querdenker2k","followers_url":"https://api.github.com/users/querdenker2k/followers","following_url":"https://api.github.com/users/querdenker2k/following{/other_user}","gists_url":"https://api.github.com/users/querdenker2k/gists{/gist_id}","starred_url":"https://api.github.com/users/querdenker2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/querdenker2k/subscriptions","organizations_url":"https://api.github.com/users/querdenker2k/orgs","repos_url":"https://api.github.com/users/querdenker2k/repos","events_url":"https://api.github.com/users/querdenker2k/events{/privacy}","received_events_url":"https://api.github.com/users/querdenker2k/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/querdenker2k/openhab","description":"Source code of the open Home Automation Bus (openHAB)","fork":true,"url":"https://api.github.com/repos/querdenker2k/openhab","forks_url":"https://api.github.com/repos/querdenker2k/openhab/forks","keys_url":"https://api.github.com/repos/querdenker2k/openhab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/querdenker2k/openhab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/querdenker2k/openhab/teams","hooks_url":"https://api.github.com/repos/querdenker2k/openhab/hooks","issue_events_url":"https://api.github.com/repos/querdenker2k/openhab/issues/events{/number}","events_url":"https://api.github.com/repos/querdenker2k/openhab/events","assignees_url":"https://api.github.com/repos/querdenker2k/openhab/assignees{/user}","branches_url":"https://api.github.com/repos/querdenker2k/openhab/branches{/branch}","tags_url":"https://api.github.com/repos/querdenker2k/openhab/tags","blobs_url":"https://api.github.com/repos/querdenker2k/openhab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/querdenker2k/openhab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/querdenker2k/openhab/git/refs{/sha}","trees_url":"https://api.github.com/repos/querdenker2k/openhab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/querdenker2k/openhab/statuses/{sha}","languages_url":"https://api.github.com/repos/querdenker2k/openhab/languages","stargazers_url":"https://api.github.com/repos/querdenker2k/openhab/stargazers","contributors_url":"https://api.github.com/repos/querdenker2k/openhab/contributors","subscribers_url":"https://api.github.com/repos/querdenker2k/openhab/subscribers","subscription_url":"https://api.github.com/repos/querdenker2k/openhab/subscription","commits_url":"https://api.github.com/repos/querdenker2k/openhab/commits{/sha}","git_commits_url":"https://api.github.com/repos/querdenker2k/openhab/git/commits{/sha}","comments_url":"https://api.github.com/repos/querdenker2k/openhab/comments{/number}","issue_comment_url":"https://api.github.com/repos/querdenker2k/openhab/issues/comments{/number}","contents_url":"https://api.github.com/repos/querdenker2k/openhab/contents/{+path}","compare_url":"https://api.github.com/repos/querdenker2k/openhab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/querdenker2k/openhab/merges","archive_url":"https://api.github.com/repos/querdenker2k/openhab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/querdenker2k/openhab/downloads","issues_url":"https://api.github.com/repos/querdenker2k/openhab/issues{/number}","pulls_url":"https://api.github.com/repos/querdenker2k/openhab/pulls{/number}","milestones_url":"https://api.github.com/repos/querdenker2k/openhab/milestones{/number}","notifications_url":"https://api.github.com/repos/querdenker2k/openhab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/querdenker2k/openhab/labels{/name}","releases_url":"https://api.github.com/repos/querdenker2k/openhab/releases{/id}","created_at":"2015-02-06T07:59:43Z","updated_at":"2015-02-25T21:12:05Z","pushed_at":"2015-04-16T20:30:28Z","git_url":"git://github.com/querdenker2k/openhab.git","ssh_url":"git@github.com:querdenker2k/openhab.git","clone_url":"https://github.com/querdenker2k/openhab.git","svn_url":"https://github.com/querdenker2k/openhab","homepage":null,"size":154532,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openhab:master","ref":"master","sha":"b5f3be393cdf5f4ba28a5bfc9ad9979488d338d0","user":{"login":"openhab","id":1007353,"avatar_url":"https://avatars.githubusercontent.com/u/1007353?v=3","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"repo":{"id":12983151,"name":"openhab","full_name":"openhab/openhab","owner":{"login":"openhab","id":1007353,"avatar_url":"https://avatars.githubusercontent.com/u/1007353?v=3","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openhab/openhab","description":"Source code of the open Home Automation Bus (openHAB)","fork":false,"url":"https://api.github.com/repos/openhab/openhab","forks_url":"https://api.github.com/repos/openhab/openhab/forks","keys_url":"https://api.github.com/repos/openhab/openhab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openhab/openhab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openhab/openhab/teams","hooks_url":"https://api.github.com/repos/openhab/openhab/hooks","issue_events_url":"https://api.github.com/repos/openhab/openhab/issues/events{/number}","events_url":"https://api.github.com/repos/openhab/openhab/events","assignees_url":"https://api.github.com/repos/openhab/openhab/assignees{/user}","branches_url":"https://api.github.com/repos/openhab/openhab/branches{/branch}","tags_url":"https://api.github.com/repos/openhab/openhab/tags","blobs_url":"https://api.github.com/repos/openhab/openhab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openhab/openhab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openhab/openhab/git/refs{/sha}","trees_url":"https://api.github.com/repos/openhab/openhab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openhab/openhab/statuses/{sha}","languages_url":"https://api.github.com/repos/openhab/openhab/languages","stargazers_url":"https://api.github.com/repos/openhab/openhab/stargazers","contributors_url":"https://api.github.com/repos/openhab/openhab/contributors","subscribers_url":"https://api.github.com/repos/openhab/openhab/subscribers","subscription_url":"https://api.github.com/repos/openhab/openhab/subscription","commits_url":"https://api.github.com/repos/openhab/openhab/commits{/sha}","git_commits_url":"https://api.github.com/repos/openhab/openhab/git/commits{/sha}","comments_url":"https://api.github.com/repos/openhab/openhab/comments{/number}","issue_comment_url":"https://api.github.com/repos/openhab/openhab/issues/comments{/number}","contents_url":"https://api.github.com/repos/openhab/openhab/contents/{+path}","compare_url":"https://api.github.com/repos/openhab/openhab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openhab/openhab/merges","archive_url":"https://api.github.com/repos/openhab/openhab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openhab/openhab/downloads","issues_url":"https://api.github.com/repos/openhab/openhab/issues{/number}","pulls_url":"https://api.github.com/repos/openhab/openhab/pulls{/number}","milestones_url":"https://api.github.com/repos/openhab/openhab/milestones{/number}","notifications_url":"https://api.github.com/repos/openhab/openhab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openhab/openhab/labels{/name}","releases_url":"https://api.github.com/repos/openhab/openhab/releases{/id}","created_at":"2013-09-20T20:28:43Z","updated_at":"2015-05-02T13:47:05Z","pushed_at":"2015-05-02T13:47:05Z","git_url":"git://github.com/openhab/openhab.git","ssh_url":"git@github.com:openhab/openhab.git","clone_url":"https://github.com/openhab/openhab.git","svn_url":"https://github.com/openhab/openhab","homepage":null,"size":224817,"stargazers_count":1324,"watchers_count":1324,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":775,"mirror_url":null,"open_issues_count":462,"forks":775,"open_issues":462,"watchers":1324,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab/pulls/2215"},"html":{"href":"https://github.com/openhab/openhab/pull/2215"},"issue":{"href":"https://api.github.com/repos/openhab/openhab/issues/2215"},"comments":{"href":"https://api.github.com/repos/openhab/openhab/issues/2215/comments"},"review_comments":{"href":"https://api.github.com/repos/openhab/openhab/pulls/2215/comments"},"review_comment":{"href":"https://api.github.com/repos/openhab/openhab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openhab/openhab/pulls/2215/commits"},"statuses":{"href":"https://api.github.com/repos/openhab/openhab/statuses/53df4f3b0ab5e29740b007066dde20dc89d1d97e"}}}}