{"action":"created","comment":{"url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/pulls/comments/52714270","id":52714270,"diff_hunk":"@@ -122,13 +127,27 @@ public DNode getNode(String nodeName) {\n         return result;\r\n     }\r\n \r\n+    private DNode calculateSourceNode() {\r\n+        DNode result = DNode.NOT_FOUND;\r\n+        \r\n+        for (DNode node : nodes) {\r\n+            List<DLink> links = getLinksTo(node);\r\n+            if (links.size() == 0) {\r\n+                result = node;\r\n+                break;\r\n+            }\r\n+        }\r\n+        return result;\r\n+    }\r\n+    \r","path":"planner/aamwriter/src/main/java/eu/seaclouds/platform/planner/aamwriter/modeldesigner/DGraph.java","position":35,"original_position":35,"commit_id":"8cf71369fafc437830b15f2efdcd843a885949d5","original_commit_id":"8cf71369fafc437830b15f2efdcd843a885949d5","user":{"login":"jacopogiallo","id":12236117,"avatar_url":"https://avatars.githubusercontent.com/u/12236117?v=3","gravatar_id":"","url":"https://api.github.com/users/jacopogiallo","html_url":"https://github.com/jacopogiallo","followers_url":"https://api.github.com/users/jacopogiallo/followers","following_url":"https://api.github.com/users/jacopogiallo/following{/other_user}","gists_url":"https://api.github.com/users/jacopogiallo/gists{/gist_id}","starred_url":"https://api.github.com/users/jacopogiallo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacopogiallo/subscriptions","organizations_url":"https://api.github.com/users/jacopogiallo/orgs","repos_url":"https://api.github.com/users/jacopogiallo/repos","events_url":"https://api.github.com/users/jacopogiallo/events{/privacy}","received_events_url":"https://api.github.com/users/jacopogiallo/received_events","type":"User","site_admin":false},"body":"Just a comment: Here you are assuming that every application has exactly one node with 0 incoming links. Is this enforced by the GUI? I mean is the GUI forcing users to develop application that:\r\n- cannot have all nodes with incoming dependecies (i.e. are all application directed acyclic graphs?), and\r\n- cannot have two separate, independent stacks?\r\n\r\nIf not, you may encounter issues with this code.","created_at":"2016-02-12T08:13:13Z","updated_at":"2016-02-12T08:13:13Z","html_url":"https://github.com/SeaCloudsEU/SeaCloudsPlatform/pull/241#discussion_r52714270","pull_request_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/pulls/241","_links":{"self":{"href":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/pulls/comments/52714270"},"html":{"href":"https://github.com/SeaCloudsEU/SeaCloudsPlatform/pull/241#discussion_r52714270"},"pull_request":{"href":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/pulls/241"}}},"pull_request":{"url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/pulls/241","id":59017588,"html_url":"https://github.com/SeaCloudsEU/SeaCloudsPlatform/pull/241","diff_url":"https://github.com/SeaCloudsEU/SeaCloudsPlatform/pull/241.diff","patch_url":"https://github.com/SeaCloudsEU/SeaCloudsPlatform/pull/241.patch","issue_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/issues/241","number":241,"state":"open","locked":false,"title":"FEATURE(aamwriter): Handles property application_requirements/frontend","user":{"login":"rosogon","id":7441033,"avatar_url":"https://avatars.githubusercontent.com/u/7441033?v=3","gravatar_id":"","url":"https://api.github.com/users/rosogon","html_url":"https://github.com/rosogon","followers_url":"https://api.github.com/users/rosogon/followers","following_url":"https://api.github.com/users/rosogon/following{/other_user}","gists_url":"https://api.github.com/users/rosogon/gists{/gist_id}","starred_url":"https://api.github.com/users/rosogon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosogon/subscriptions","organizations_url":"https://api.github.com/users/rosogon/orgs","repos_url":"https://api.github.com/users/rosogon/repos","events_url":"https://api.github.com/users/rosogon/events{/privacy}","received_events_url":"https://api.github.com/users/rosogon/received_events","type":"User","site_admin":false},"body":"This PR allows the specification of a frontend module in application_requirements/frontend element. Before this, the frontend module is calculated as the source node of the flow graph.\r\n\r\nIf the frontend (the node \"visible\" to the users, to which we want to apply the QoS requirements) is not the source of the node graph (assume a test module that connects to the frontend), the frontend must be specified.\r\n\r\nExample:\r\n\r\n```\r\n{\r\n    \"nodes\": [ ... ],\r\n    \"links\": [ ... ],\r\n    \"application_requirements\": {\r\n        \"response_time\": \"2000\",\r\n        \"availability\": 0.98,\r\n        \"cost\": \"200\",\r\n        \"workload\": \"50\",\r\n        \"frontend\": \"www\"\r\n    }\r\n}\r\n```","created_at":"2016-02-11T11:22:42Z","updated_at":"2016-02-12T08:13:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ef7e7d13b837996f8edcae4c9496ba5d01c5965","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/pulls/241/commits","review_comments_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/pulls/241/comments","review_comment_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/issues/241/comments","statuses_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/statuses/8cf71369fafc437830b15f2efdcd843a885949d5","head":{"label":"rosogon:feature/aamwriter-frontend-module","ref":"feature/aamwriter-frontend-module","sha":"8cf71369fafc437830b15f2efdcd843a885949d5","user":{"login":"rosogon","id":7441033,"avatar_url":"https://avatars.githubusercontent.com/u/7441033?v=3","gravatar_id":"","url":"https://api.github.com/users/rosogon","html_url":"https://github.com/rosogon","followers_url":"https://api.github.com/users/rosogon/followers","following_url":"https://api.github.com/users/rosogon/following{/other_user}","gists_url":"https://api.github.com/users/rosogon/gists{/gist_id}","starred_url":"https://api.github.com/users/rosogon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosogon/subscriptions","organizations_url":"https://api.github.com/users/rosogon/orgs","repos_url":"https://api.github.com/users/rosogon/repos","events_url":"https://api.github.com/users/rosogon/events{/privacy}","received_events_url":"https://api.github.com/users/rosogon/received_events","type":"User","site_admin":false},"repo":{"id":27584503,"name":"SeaCloudsPlatform","full_name":"rosogon/SeaCloudsPlatform","owner":{"login":"rosogon","id":7441033,"avatar_url":"https://avatars.githubusercontent.com/u/7441033?v=3","gravatar_id":"","url":"https://api.github.com/users/rosogon","html_url":"https://github.com/rosogon","followers_url":"https://api.github.com/users/rosogon/followers","following_url":"https://api.github.com/users/rosogon/following{/other_user}","gists_url":"https://api.github.com/users/rosogon/gists{/gist_id}","starred_url":"https://api.github.com/users/rosogon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosogon/subscriptions","organizations_url":"https://api.github.com/users/rosogon/orgs","repos_url":"https://api.github.com/users/rosogon/repos","events_url":"https://api.github.com/users/rosogon/events{/privacy}","received_events_url":"https://api.github.com/users/rosogon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rosogon/SeaCloudsPlatform","description":"Seamless adaptive multi-cloud management of service-based applications","fork":true,"url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform","forks_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/forks","keys_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/teams","hooks_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/hooks","issue_events_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/issues/events{/number}","events_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/events","assignees_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/assignees{/user}","branches_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/branches{/branch}","tags_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/tags","blobs_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/git/refs{/sha}","trees_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/statuses/{sha}","languages_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/languages","stargazers_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/stargazers","contributors_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/contributors","subscribers_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/subscribers","subscription_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/subscription","commits_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/commits{/sha}","git_commits_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/git/commits{/sha}","comments_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/comments{/number}","issue_comment_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/issues/comments{/number}","contents_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/contents/{+path}","compare_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/merges","archive_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/downloads","issues_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/issues{/number}","pulls_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/pulls{/number}","milestones_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/milestones{/number}","notifications_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/labels{/name}","releases_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/releases{/id}","deployments_url":"https://api.github.com/repos/rosogon/SeaCloudsPlatform/deployments","created_at":"2014-12-05T09:35:15Z","updated_at":"2016-01-21T12:26:15Z","pushed_at":"2016-02-11T11:05:59Z","git_url":"git://github.com/rosogon/SeaCloudsPlatform.git","ssh_url":"git@github.com:rosogon/SeaCloudsPlatform.git","clone_url":"https://github.com/rosogon/SeaCloudsPlatform.git","svn_url":"https://github.com/rosogon/SeaCloudsPlatform","homepage":"http://www.seaclouds-project.eu/","size":61626,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"SeaCloudsEU:master","ref":"master","sha":"3014d43d082c0edfad4c616e1cb58e345b327939","user":{"login":"SeaCloudsEU","id":6222853,"avatar_url":"https://avatars.githubusercontent.com/u/6222853?v=3","gravatar_id":"","url":"https://api.github.com/users/SeaCloudsEU","html_url":"https://github.com/SeaCloudsEU","followers_url":"https://api.github.com/users/SeaCloudsEU/followers","following_url":"https://api.github.com/users/SeaCloudsEU/following{/other_user}","gists_url":"https://api.github.com/users/SeaCloudsEU/gists{/gist_id}","starred_url":"https://api.github.com/users/SeaCloudsEU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeaCloudsEU/subscriptions","organizations_url":"https://api.github.com/users/SeaCloudsEU/orgs","repos_url":"https://api.github.com/users/SeaCloudsEU/repos","events_url":"https://api.github.com/users/SeaCloudsEU/events{/privacy}","received_events_url":"https://api.github.com/users/SeaCloudsEU/received_events","type":"Organization","site_admin":false},"repo":{"id":15312233,"name":"SeaCloudsPlatform","full_name":"SeaCloudsEU/SeaCloudsPlatform","owner":{"login":"SeaCloudsEU","id":6222853,"avatar_url":"https://avatars.githubusercontent.com/u/6222853?v=3","gravatar_id":"","url":"https://api.github.com/users/SeaCloudsEU","html_url":"https://github.com/SeaCloudsEU","followers_url":"https://api.github.com/users/SeaCloudsEU/followers","following_url":"https://api.github.com/users/SeaCloudsEU/following{/other_user}","gists_url":"https://api.github.com/users/SeaCloudsEU/gists{/gist_id}","starred_url":"https://api.github.com/users/SeaCloudsEU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeaCloudsEU/subscriptions","organizations_url":"https://api.github.com/users/SeaCloudsEU/orgs","repos_url":"https://api.github.com/users/SeaCloudsEU/repos","events_url":"https://api.github.com/users/SeaCloudsEU/events{/privacy}","received_events_url":"https://api.github.com/users/SeaCloudsEU/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SeaCloudsEU/SeaCloudsPlatform","description":"Seamless adaptive multi-cloud management of service-based applications","fork":false,"url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform","forks_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/forks","keys_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/teams","hooks_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/hooks","issue_events_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/issues/events{/number}","events_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/events","assignees_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/assignees{/user}","branches_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/branches{/branch}","tags_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/tags","blobs_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/git/refs{/sha}","trees_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/statuses/{sha}","languages_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/languages","stargazers_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/stargazers","contributors_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/contributors","subscribers_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/subscribers","subscription_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/subscription","commits_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/commits{/sha}","git_commits_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/git/commits{/sha}","comments_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/comments{/number}","issue_comment_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/issues/comments{/number}","contents_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/contents/{+path}","compare_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/merges","archive_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/downloads","issues_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/issues{/number}","pulls_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/pulls{/number}","milestones_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/milestones{/number}","notifications_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/labels{/name}","releases_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/releases{/id}","deployments_url":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/deployments","created_at":"2013-12-19T13:23:54Z","updated_at":"2016-01-25T21:18:34Z","pushed_at":"2016-02-11T19:03:36Z","git_url":"git://github.com/SeaCloudsEU/SeaCloudsPlatform.git","ssh_url":"git@github.com:SeaCloudsEU/SeaCloudsPlatform.git","clone_url":"https://github.com/SeaCloudsEU/SeaCloudsPlatform.git","svn_url":"https://github.com/SeaCloudsEU/SeaCloudsPlatform","homepage":"http://www.seaclouds-project.eu/","size":129030,"stargazers_count":11,"watchers_count":11,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":16,"forks":16,"open_issues":16,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/pulls/241"},"html":{"href":"https://github.com/SeaCloudsEU/SeaCloudsPlatform/pull/241"},"issue":{"href":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/issues/241"},"comments":{"href":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/issues/241/comments"},"review_comments":{"href":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/pulls/241/comments"},"review_comment":{"href":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/pulls/241/commits"},"statuses":{"href":"https://api.github.com/repos/SeaCloudsEU/SeaCloudsPlatform/statuses/8cf71369fafc437830b15f2efdcd843a885949d5"}}}}