{"action":"created","comment":{"url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls/comments/70941544","id":70941544,"diff_hunk":"@@ -131,38 +187,86 @@ protected void customStart() {\n     }\n \n     private void deploy() {\n-        //TODO deploy application\n-        Map<?, ?> params = null;  //params has to contain applicationName, buildpack, path, etc.\n-        domain = cfLocation.deploy(params);\n+        Map<String, Object> params = MutableMap.copyOf(this.config().getBag().getAllConfig());\n+        params.put(APPLICATION_NAME.getName(), applicationName);\n+        if(params.containsKey(ARTIFACT_PATH.getName())) {\n+            params.put(ARTIFACT_PATH.getName(), getLocalPath((String) params.get(ARTIFACT_PATH.getName())));\n+        }\n+        applicationUrl = cfLocation.deploy(params);\n     }\n \n     private void preLaunch() {\n         configureEnv();\n     }\n \n     private void configureEnv() {\n-        Map<?, ?> envs = this.getConfig(VanillaCloudfoundryApplication.ENVS);\n-        cfLocation.configureEnv(applicationName, (Map<Object, Object>) envs);\n+        //TODO\n+        //Map<?, ?> envs = this.getConfig(VanillaCloudfoundryApplication.ENVS);\n+        //cfLocation.configureEnv(applicationName, (Map<Object, Object>) envs);\n     }\n \n     private void launch() {\n-        //TODO, starting the application\n         cfLocation.startApplication(applicationName);\n     }\n \n     private void postLaunch() {\n-        //waitForEntityStart();\n-        //sensors().set(Attributes.MAIN_URI, domain);\n-        sensors().set(VanillaCloudfoundryApplication.ROOT_URL, domain);\n+        waitForEntityStart();\n+        sensors().set(Attributes.MAIN_URI, URI.create(applicationUrl));\n+        sensors().set(VanillaCloudfoundryApplication.ROOT_URL, applicationUrl);\n     }\n \n     protected void postStart() {\n-        //waitEntityIsUp\n+        Entities.waitForServiceUp(this, Duration.of(\n+                getConfig(BrooklynConfigKeys.START_TIMEOUT).toMilliseconds(),\n+                TimeUnit.MILLISECONDS));\n     }\n \n     protected void connectSensors() {\n         connectedSensors = true;\n-        //TODO connectServiceIsRunning() and connectServiceUp()\n+        connectServiceIsRunning();\n+        connectServiceUp();\n+    }\n+\n+    protected void connectServiceIsRunning() {\n+        serviceProcessIsRunning = FunctionFeed.builder()\n+                .entity(this)\n+                .period(Duration.FIVE_SECONDS)\n+                .poll(new FunctionPollConfig<Boolean, Boolean>(SERVICE_PROCESS_IS_RUNNING)\n+                        .onException(Functions.constant(Boolean.FALSE))\n+                        .callable(new Callable<Boolean>() {\n+                            public Boolean call() {\n+                                return isRunning();\n+                            }\n+                        }))\n+                .build();\n+    }\n+\n+    protected void connectServiceUp() {\n+        serviceProcessUp = FunctionFeed.builder()\n+                .entity(this)\n+                .period(Duration.FIVE_SECONDS)\n+                .poll(new FunctionPollConfig<Boolean, Boolean>(SERVICE_UP)\n+                        .onException(Functions.constant(Boolean.FALSE))\n+                        .callable(new Callable<Boolean>() {\n+                            public Boolean call() {\n+                                return isRunning();\n+                            }\n+                        }))\n+                .build();\n+    }\n+\n+    public boolean isRunning() {\n+        return isApplicationDomainAvailable();\n+    }\n+\n+    protected boolean isApplicationDomainAvailable() {\n+        boolean result;","path":"src/main/java/org/apache/brooklyn/cloudfoundry/entity/VanillaCloudfoundryApplicationImpl.java","position":240,"original_position":240,"commit_id":"b22f8e154b02583ef21a9fc4a87f141627d77681","original_commit_id":"b22f8e154b02583ef21a9fc4a87f141627d77681","user":{"login":"kiuby88","id":3704424,"avatar_url":"https://avatars.githubusercontent.com/u/3704424?v=3","gravatar_id":"","url":"https://api.github.com/users/kiuby88","html_url":"https://github.com/kiuby88","followers_url":"https://api.github.com/users/kiuby88/followers","following_url":"https://api.github.com/users/kiuby88/following{/other_user}","gists_url":"https://api.github.com/users/kiuby88/gists{/gist_id}","starred_url":"https://api.github.com/users/kiuby88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiuby88/subscriptions","organizations_url":"https://api.github.com/users/kiuby88/orgs","repos_url":"https://api.github.com/users/kiuby88/repos","events_url":"https://api.github.com/users/kiuby88/events{/privacy}","received_events_url":"https://api.github.com/users/kiuby88/received_events","type":"User","site_admin":false},"body":"+1","created_at":"2016-07-15T08:58:19Z","updated_at":"2016-07-15T08:58:19Z","html_url":"https://github.com/kiuby88/brooklyn-cloudfoundry/pull/6#discussion_r70941544","pull_request_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls/comments/70941544"},"html":{"href":"https://github.com/kiuby88/brooklyn-cloudfoundry/pull/6#discussion_r70941544"},"pull_request":{"href":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls/6","id":77436023,"html_url":"https://github.com/kiuby88/brooklyn-cloudfoundry/pull/6","diff_url":"https://github.com/kiuby88/brooklyn-cloudfoundry/pull/6.diff","patch_url":"https://github.com/kiuby88/brooklyn-cloudfoundry/pull/6.patch","issue_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/issues/6","number":6,"state":"open","locked":false,"title":"Integration of CloudFoundry location and Vanilla entity ","user":{"login":"kiuby88","id":3704424,"avatar_url":"https://avatars.githubusercontent.com/u/3704424?v=3","gravatar_id":"","url":"https://api.github.com/users/kiuby88","html_url":"https://github.com/kiuby88","followers_url":"https://api.github.com/users/kiuby88/followers","following_url":"https://api.github.com/users/kiuby88/following{/other_user}","gists_url":"https://api.github.com/users/kiuby88/gists{/gist_id}","starred_url":"https://api.github.com/users/kiuby88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiuby88/subscriptions","organizations_url":"https://api.github.com/users/kiuby88/orgs","repos_url":"https://api.github.com/users/kiuby88/repos","events_url":"https://api.github.com/users/kiuby88/events{/privacy}","received_events_url":"https://api.github.com/users/kiuby88/received_events","type":"User","site_admin":false},"body":"Prototype of integration of `CloudFoundryPaasLocation` and `VanillaCloudFoundryApplication` entity. It is just a prototype, for example, driver pattern is not included yet, the envs are not supported yet and the artifact downloading is hardcoded instead of using `DownloaderResolver`. Some sensores and new effectors are necessary, to modify the hardware profile (such as memory or instances).\r\n\r\nNext steps:\r\n- Adding env support (very easy)\r\n- Adding driver pattern\r\n\r\n","created_at":"2016-07-14T10:50:24Z","updated_at":"2016-07-15T08:58:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7745e2cf91397d5fedb0d01511cb6a6a1f721edc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls/6/commits","review_comments_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls/6/comments","review_comment_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/issues/6/comments","statuses_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/statuses/b22f8e154b02583ef21a9fc4a87f141627d77681","head":{"label":"kiuby88:feature/vanilla-cf-application-loc-management","ref":"feature/vanilla-cf-application-loc-management","sha":"b22f8e154b02583ef21a9fc4a87f141627d77681","user":{"login":"kiuby88","id":3704424,"avatar_url":"https://avatars.githubusercontent.com/u/3704424?v=3","gravatar_id":"","url":"https://api.github.com/users/kiuby88","html_url":"https://github.com/kiuby88","followers_url":"https://api.github.com/users/kiuby88/followers","following_url":"https://api.github.com/users/kiuby88/following{/other_user}","gists_url":"https://api.github.com/users/kiuby88/gists{/gist_id}","starred_url":"https://api.github.com/users/kiuby88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiuby88/subscriptions","organizations_url":"https://api.github.com/users/kiuby88/orgs","repos_url":"https://api.github.com/users/kiuby88/repos","events_url":"https://api.github.com/users/kiuby88/events{/privacy}","received_events_url":"https://api.github.com/users/kiuby88/received_events","type":"User","site_admin":false},"repo":{"id":60164372,"name":"brooklyn-cloudfoundry","full_name":"kiuby88/brooklyn-cloudfoundry","owner":{"login":"kiuby88","id":3704424,"avatar_url":"https://avatars.githubusercontent.com/u/3704424?v=3","gravatar_id":"","url":"https://api.github.com/users/kiuby88","html_url":"https://github.com/kiuby88","followers_url":"https://api.github.com/users/kiuby88/followers","following_url":"https://api.github.com/users/kiuby88/following{/other_user}","gists_url":"https://api.github.com/users/kiuby88/gists{/gist_id}","starred_url":"https://api.github.com/users/kiuby88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiuby88/subscriptions","organizations_url":"https://api.github.com/users/kiuby88/orgs","repos_url":"https://api.github.com/users/kiuby88/repos","events_url":"https://api.github.com/users/kiuby88/events{/privacy}","received_events_url":"https://api.github.com/users/kiuby88/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kiuby88/brooklyn-cloudfoundry","description":"","fork":false,"url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry","forks_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/forks","keys_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/teams","hooks_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/hooks","issue_events_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/issues/events{/number}","events_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/events","assignees_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/assignees{/user}","branches_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/branches{/branch}","tags_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/tags","blobs_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/git/refs{/sha}","trees_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/statuses/{sha}","languages_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/languages","stargazers_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/stargazers","contributors_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/contributors","subscribers_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/subscribers","subscription_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/subscription","commits_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/commits{/sha}","git_commits_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/git/commits{/sha}","comments_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/comments{/number}","issue_comment_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/issues/comments{/number}","contents_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/contents/{+path}","compare_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/merges","archive_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/downloads","issues_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/issues{/number}","pulls_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls{/number}","milestones_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/milestones{/number}","notifications_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/labels{/name}","releases_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/releases{/id}","deployments_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/deployments","created_at":"2016-06-01T09:37:46Z","updated_at":"2016-06-24T20:44:06Z","pushed_at":"2016-07-14T10:50:24Z","git_url":"git://github.com/kiuby88/brooklyn-cloudfoundry.git","ssh_url":"git@github.com:kiuby88/brooklyn-cloudfoundry.git","clone_url":"https://github.com/kiuby88/brooklyn-cloudfoundry.git","svn_url":"https://github.com/kiuby88/brooklyn-cloudfoundry","homepage":null,"size":6894,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"kiuby88:master","ref":"master","sha":"e2b790216597a4311748f487049b34d47c93932a","user":{"login":"kiuby88","id":3704424,"avatar_url":"https://avatars.githubusercontent.com/u/3704424?v=3","gravatar_id":"","url":"https://api.github.com/users/kiuby88","html_url":"https://github.com/kiuby88","followers_url":"https://api.github.com/users/kiuby88/followers","following_url":"https://api.github.com/users/kiuby88/following{/other_user}","gists_url":"https://api.github.com/users/kiuby88/gists{/gist_id}","starred_url":"https://api.github.com/users/kiuby88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiuby88/subscriptions","organizations_url":"https://api.github.com/users/kiuby88/orgs","repos_url":"https://api.github.com/users/kiuby88/repos","events_url":"https://api.github.com/users/kiuby88/events{/privacy}","received_events_url":"https://api.github.com/users/kiuby88/received_events","type":"User","site_admin":false},"repo":{"id":60164372,"name":"brooklyn-cloudfoundry","full_name":"kiuby88/brooklyn-cloudfoundry","owner":{"login":"kiuby88","id":3704424,"avatar_url":"https://avatars.githubusercontent.com/u/3704424?v=3","gravatar_id":"","url":"https://api.github.com/users/kiuby88","html_url":"https://github.com/kiuby88","followers_url":"https://api.github.com/users/kiuby88/followers","following_url":"https://api.github.com/users/kiuby88/following{/other_user}","gists_url":"https://api.github.com/users/kiuby88/gists{/gist_id}","starred_url":"https://api.github.com/users/kiuby88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiuby88/subscriptions","organizations_url":"https://api.github.com/users/kiuby88/orgs","repos_url":"https://api.github.com/users/kiuby88/repos","events_url":"https://api.github.com/users/kiuby88/events{/privacy}","received_events_url":"https://api.github.com/users/kiuby88/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kiuby88/brooklyn-cloudfoundry","description":"","fork":false,"url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry","forks_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/forks","keys_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/teams","hooks_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/hooks","issue_events_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/issues/events{/number}","events_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/events","assignees_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/assignees{/user}","branches_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/branches{/branch}","tags_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/tags","blobs_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/git/refs{/sha}","trees_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/statuses/{sha}","languages_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/languages","stargazers_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/stargazers","contributors_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/contributors","subscribers_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/subscribers","subscription_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/subscription","commits_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/commits{/sha}","git_commits_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/git/commits{/sha}","comments_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/comments{/number}","issue_comment_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/issues/comments{/number}","contents_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/contents/{+path}","compare_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/merges","archive_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/downloads","issues_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/issues{/number}","pulls_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls{/number}","milestones_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/milestones{/number}","notifications_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/labels{/name}","releases_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/releases{/id}","deployments_url":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/deployments","created_at":"2016-06-01T09:37:46Z","updated_at":"2016-06-24T20:44:06Z","pushed_at":"2016-07-14T10:50:24Z","git_url":"git://github.com/kiuby88/brooklyn-cloudfoundry.git","ssh_url":"git@github.com:kiuby88/brooklyn-cloudfoundry.git","clone_url":"https://github.com/kiuby88/brooklyn-cloudfoundry.git","svn_url":"https://github.com/kiuby88/brooklyn-cloudfoundry","homepage":null,"size":6894,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls/6"},"html":{"href":"https://github.com/kiuby88/brooklyn-cloudfoundry/pull/6"},"issue":{"href":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/issues/6"},"comments":{"href":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/kiuby88/brooklyn-cloudfoundry/statuses/b22f8e154b02583ef21a9fc4a87f141627d77681"}}}}
{"actor":{"display_login":"kiuby88"}}