{"action":"created","comment":{"url":"https://api.github.com/repos/project-ncl/dependency-analysis/pulls/comments/35208116","id":35208116,"diff_hunk":"@@ -1,34 +1,68 @@\n package org.jboss.da.communcation.pnc;\n \n-import org.jboss.da.communcation.pnc.entity.BuildConfiguration;\n-import org.jboss.da.communcation.pnc.entity.BuildConfigurationSet;\n-import org.jboss.da.communcation.pnc.entity.Product;\n-import org.jboss.da.communcation.pnc.entity.Project;\n+import org.jboss.da.common.json.DAConfig;\n+import org.jboss.da.common.util.Configuration;\n+import org.jboss.da.common.util.ConfigurationParseException;\n+import org.jboss.da.communcation.pnc.authentication.PNCAuthentication;\n+import org.jboss.da.communcation.pnc.model.BuildConfiguration;\n+import org.jboss.da.communcation.pnc.model.BuildConfigurationSet;\n+import org.jboss.da.communcation.pnc.model.Product;\n+import org.jboss.da.communcation.pnc.model.Project;\n+import org.jboss.resteasy.client.ClientRequest;\n+import org.jboss.resteasy.client.ClientResponse;\n \n-import javax.ws.rs.*;\n import javax.ws.rs.core.MediaType;\n+import java.util.Arrays;\n import java.util.List;\n \n-@Path(\"pnc-rest/rest\")\n-public interface PNC {\n+public class PNC {\n \n-    @GET\n-    @Path(\"build-configurations\")\n-    @Produces(MediaType.APPLICATION_JSON)\n-    List<BuildConfiguration> getBuildConfigurations();\n+    private Configuration config;\n+    private DAConfig conf;\n+    private String pncServer;\n+    private String token;\n \n-    @GET\n-    @Path(\"build-configuration-sets\")\n-    @Produces(MediaType.APPLICATION_JSON)\n-    List<BuildConfigurationSet> getBuildConfigurationSets();\n+    public PNC() throws ConfigurationParseException {\n+        Configuration config = new Configuration();\n+        DAConfig conf = config.getConfig();\n+        pncServer = config.getConfig().getPncServer();\n \n-    @GET\n-    @Path(\"products\")\n-    @Produces(MediaType.APPLICATION_JSON)\n-    List<Product> getProducts();\n+        PNCAuthentication pncAuthenticate = new PNCAuthentication();\n+        token = pncAuthenticate.authenticate();","path":"communication/src/main/java/org/jboss/da/communcation/pnc/PNC.java","position":50,"original_position":50,"commit_id":"276f3a999211b743e2b7e3eadd7fd50707da74af","original_commit_id":"276f3a999211b743e2b7e3eadd7fd50707da74af","user":{"login":"janinko","id":644267,"avatar_url":"https://avatars.githubusercontent.com/u/644267?v=3","gravatar_id":"","url":"https://api.github.com/users/janinko","html_url":"https://github.com/janinko","followers_url":"https://api.github.com/users/janinko/followers","following_url":"https://api.github.com/users/janinko/following{/other_user}","gists_url":"https://api.github.com/users/janinko/gists{/gist_id}","starred_url":"https://api.github.com/users/janinko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janinko/subscriptions","organizations_url":"https://api.github.com/users/janinko/orgs","repos_url":"https://api.github.com/users/janinko/repos","events_url":"https://api.github.com/users/janinko/events{/privacy}","received_events_url":"https://api.github.com/users/janinko/received_events","type":"User","site_admin":false},"body":"But what about the token expiration?","created_at":"2015-07-22T12:45:24Z","updated_at":"2015-07-22T12:45:24Z","html_url":"https://github.com/project-ncl/dependency-analysis/pull/28#discussion_r35208116","pull_request_url":"https://api.github.com/repos/project-ncl/dependency-analysis/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/project-ncl/dependency-analysis/pulls/comments/35208116"},"html":{"href":"https://github.com/project-ncl/dependency-analysis/pull/28#discussion_r35208116"},"pull_request":{"href":"https://api.github.com/repos/project-ncl/dependency-analysis/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/project-ncl/dependency-analysis/pulls/28","id":40066651,"html_url":"https://github.com/project-ncl/dependency-analysis/pull/28","diff_url":"https://github.com/project-ncl/dependency-analysis/pull/28.diff","patch_url":"https://github.com/project-ncl/dependency-analysis/pull/28.patch","issue_url":"https://api.github.com/repos/project-ncl/dependency-analysis/issues/28","number":28,"state":"open","locked":false,"title":"Use ClientRequest instead of resteasy3.","user":{"login":"thescouser89","id":630746,"avatar_url":"https://avatars.githubusercontent.com/u/630746?v=3","gravatar_id":"","url":"https://api.github.com/users/thescouser89","html_url":"https://github.com/thescouser89","followers_url":"https://api.github.com/users/thescouser89/followers","following_url":"https://api.github.com/users/thescouser89/following{/other_user}","gists_url":"https://api.github.com/users/thescouser89/gists{/gist_id}","starred_url":"https://api.github.com/users/thescouser89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thescouser89/subscriptions","organizations_url":"https://api.github.com/users/thescouser89/orgs","repos_url":"https://api.github.com/users/thescouser89/repos","events_url":"https://api.github.com/users/thescouser89/events{/privacy}","received_events_url":"https://api.github.com/users/thescouser89/received_events","type":"User","site_admin":false},"body":"Previously we were using annotations to setup a REST client (via\r\nresteasy-client) for PNC in Dependency Analysis. This worked well except\r\nwhen we deploy on JBoss EAP 6.4. JBoss EAP 6.4 uses and provides\r\nresteasy2 libraries, but we need resteasy3 libraries for resteasy-client\r\nto work.\r\n\r\nInstead, we have decided to use `ClientRequest` class provided by\r\nresteasy2 to write the REST client. It's a little bit more verbose than\r\nresteasy-client, but it does the job and avoids the version conflict we\r\nhave right now.\r\n\r\nThe `PNC` object will throw some exceptions, if the REST call fails or\r\nthe configuration in common cannot be parsed.\r\n\r\nThe `pom.xml` was adjusted so that we have no more dependency on\r\nresteasy-client, and we use resteasy v2 instead.\r\n\r\nI have also decided to rename my 'model classes' package to `model`,\r\ninstead of using `entity` to avoid confusion.","created_at":"2015-07-15T20:36:07Z","updated_at":"2015-07-22T12:45:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ecacc04abf1b12da2bdc7c6764eceb5f046e1bf8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/project-ncl/dependency-analysis/pulls/28/commits","review_comments_url":"https://api.github.com/repos/project-ncl/dependency-analysis/pulls/28/comments","review_comment_url":"https://api.github.com/repos/project-ncl/dependency-analysis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/project-ncl/dependency-analysis/issues/28/comments","statuses_url":"https://api.github.com/repos/project-ncl/dependency-analysis/statuses/276f3a999211b743e2b7e3eadd7fd50707da74af","head":{"label":"thescouser89:pnc_interface_fix","ref":"pnc_interface_fix","sha":"276f3a999211b743e2b7e3eadd7fd50707da74af","user":{"login":"thescouser89","id":630746,"avatar_url":"https://avatars.githubusercontent.com/u/630746?v=3","gravatar_id":"","url":"https://api.github.com/users/thescouser89","html_url":"https://github.com/thescouser89","followers_url":"https://api.github.com/users/thescouser89/followers","following_url":"https://api.github.com/users/thescouser89/following{/other_user}","gists_url":"https://api.github.com/users/thescouser89/gists{/gist_id}","starred_url":"https://api.github.com/users/thescouser89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thescouser89/subscriptions","organizations_url":"https://api.github.com/users/thescouser89/orgs","repos_url":"https://api.github.com/users/thescouser89/repos","events_url":"https://api.github.com/users/thescouser89/events{/privacy}","received_events_url":"https://api.github.com/users/thescouser89/received_events","type":"User","site_admin":false},"repo":{"id":37862616,"name":"dependency-analysis","full_name":"thescouser89/dependency-analysis","owner":{"login":"thescouser89","id":630746,"avatar_url":"https://avatars.githubusercontent.com/u/630746?v=3","gravatar_id":"","url":"https://api.github.com/users/thescouser89","html_url":"https://github.com/thescouser89","followers_url":"https://api.github.com/users/thescouser89/followers","following_url":"https://api.github.com/users/thescouser89/following{/other_user}","gists_url":"https://api.github.com/users/thescouser89/gists{/gist_id}","starred_url":"https://api.github.com/users/thescouser89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thescouser89/subscriptions","organizations_url":"https://api.github.com/users/thescouser89/orgs","repos_url":"https://api.github.com/users/thescouser89/repos","events_url":"https://api.github.com/users/thescouser89/events{/privacy}","received_events_url":"https://api.github.com/users/thescouser89/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thescouser89/dependency-analysis","description":"","fork":true,"url":"https://api.github.com/repos/thescouser89/dependency-analysis","forks_url":"https://api.github.com/repos/thescouser89/dependency-analysis/forks","keys_url":"https://api.github.com/repos/thescouser89/dependency-analysis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thescouser89/dependency-analysis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thescouser89/dependency-analysis/teams","hooks_url":"https://api.github.com/repos/thescouser89/dependency-analysis/hooks","issue_events_url":"https://api.github.com/repos/thescouser89/dependency-analysis/issues/events{/number}","events_url":"https://api.github.com/repos/thescouser89/dependency-analysis/events","assignees_url":"https://api.github.com/repos/thescouser89/dependency-analysis/assignees{/user}","branches_url":"https://api.github.com/repos/thescouser89/dependency-analysis/branches{/branch}","tags_url":"https://api.github.com/repos/thescouser89/dependency-analysis/tags","blobs_url":"https://api.github.com/repos/thescouser89/dependency-analysis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thescouser89/dependency-analysis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thescouser89/dependency-analysis/git/refs{/sha}","trees_url":"https://api.github.com/repos/thescouser89/dependency-analysis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thescouser89/dependency-analysis/statuses/{sha}","languages_url":"https://api.github.com/repos/thescouser89/dependency-analysis/languages","stargazers_url":"https://api.github.com/repos/thescouser89/dependency-analysis/stargazers","contributors_url":"https://api.github.com/repos/thescouser89/dependency-analysis/contributors","subscribers_url":"https://api.github.com/repos/thescouser89/dependency-analysis/subscribers","subscription_url":"https://api.github.com/repos/thescouser89/dependency-analysis/subscription","commits_url":"https://api.github.com/repos/thescouser89/dependency-analysis/commits{/sha}","git_commits_url":"https://api.github.com/repos/thescouser89/dependency-analysis/git/commits{/sha}","comments_url":"https://api.github.com/repos/thescouser89/dependency-analysis/comments{/number}","issue_comment_url":"https://api.github.com/repos/thescouser89/dependency-analysis/issues/comments{/number}","contents_url":"https://api.github.com/repos/thescouser89/dependency-analysis/contents/{+path}","compare_url":"https://api.github.com/repos/thescouser89/dependency-analysis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thescouser89/dependency-analysis/merges","archive_url":"https://api.github.com/repos/thescouser89/dependency-analysis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thescouser89/dependency-analysis/downloads","issues_url":"https://api.github.com/repos/thescouser89/dependency-analysis/issues{/number}","pulls_url":"https://api.github.com/repos/thescouser89/dependency-analysis/pulls{/number}","milestones_url":"https://api.github.com/repos/thescouser89/dependency-analysis/milestones{/number}","notifications_url":"https://api.github.com/repos/thescouser89/dependency-analysis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thescouser89/dependency-analysis/labels{/name}","releases_url":"https://api.github.com/repos/thescouser89/dependency-analysis/releases{/id}","created_at":"2015-06-22T15:12:43Z","updated_at":"2015-07-20T18:38:50Z","pushed_at":"2015-07-22T01:08:53Z","git_url":"git://github.com/thescouser89/dependency-analysis.git","ssh_url":"git@github.com:thescouser89/dependency-analysis.git","clone_url":"https://github.com/thescouser89/dependency-analysis.git","svn_url":"https://github.com/thescouser89/dependency-analysis","homepage":null,"size":200,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"project-ncl:master","ref":"master","sha":"5e913ac4dd35906f5e536f6acb175063124d9c8c","user":{"login":"project-ncl","id":9921139,"avatar_url":"https://avatars.githubusercontent.com/u/9921139?v=3","gravatar_id":"","url":"https://api.github.com/users/project-ncl","html_url":"https://github.com/project-ncl","followers_url":"https://api.github.com/users/project-ncl/followers","following_url":"https://api.github.com/users/project-ncl/following{/other_user}","gists_url":"https://api.github.com/users/project-ncl/gists{/gist_id}","starred_url":"https://api.github.com/users/project-ncl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-ncl/subscriptions","organizations_url":"https://api.github.com/users/project-ncl/orgs","repos_url":"https://api.github.com/users/project-ncl/repos","events_url":"https://api.github.com/users/project-ncl/events{/privacy}","received_events_url":"https://api.github.com/users/project-ncl/received_events","type":"Organization","site_admin":false},"repo":{"id":37196945,"name":"dependency-analysis","full_name":"project-ncl/dependency-analysis","owner":{"login":"project-ncl","id":9921139,"avatar_url":"https://avatars.githubusercontent.com/u/9921139?v=3","gravatar_id":"","url":"https://api.github.com/users/project-ncl","html_url":"https://github.com/project-ncl","followers_url":"https://api.github.com/users/project-ncl/followers","following_url":"https://api.github.com/users/project-ncl/following{/other_user}","gists_url":"https://api.github.com/users/project-ncl/gists{/gist_id}","starred_url":"https://api.github.com/users/project-ncl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-ncl/subscriptions","organizations_url":"https://api.github.com/users/project-ncl/orgs","repos_url":"https://api.github.com/users/project-ncl/repos","events_url":"https://api.github.com/users/project-ncl/events{/privacy}","received_events_url":"https://api.github.com/users/project-ncl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/project-ncl/dependency-analysis","description":"","fork":false,"url":"https://api.github.com/repos/project-ncl/dependency-analysis","forks_url":"https://api.github.com/repos/project-ncl/dependency-analysis/forks","keys_url":"https://api.github.com/repos/project-ncl/dependency-analysis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/project-ncl/dependency-analysis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/project-ncl/dependency-analysis/teams","hooks_url":"https://api.github.com/repos/project-ncl/dependency-analysis/hooks","issue_events_url":"https://api.github.com/repos/project-ncl/dependency-analysis/issues/events{/number}","events_url":"https://api.github.com/repos/project-ncl/dependency-analysis/events","assignees_url":"https://api.github.com/repos/project-ncl/dependency-analysis/assignees{/user}","branches_url":"https://api.github.com/repos/project-ncl/dependency-analysis/branches{/branch}","tags_url":"https://api.github.com/repos/project-ncl/dependency-analysis/tags","blobs_url":"https://api.github.com/repos/project-ncl/dependency-analysis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/project-ncl/dependency-analysis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/project-ncl/dependency-analysis/git/refs{/sha}","trees_url":"https://api.github.com/repos/project-ncl/dependency-analysis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/project-ncl/dependency-analysis/statuses/{sha}","languages_url":"https://api.github.com/repos/project-ncl/dependency-analysis/languages","stargazers_url":"https://api.github.com/repos/project-ncl/dependency-analysis/stargazers","contributors_url":"https://api.github.com/repos/project-ncl/dependency-analysis/contributors","subscribers_url":"https://api.github.com/repos/project-ncl/dependency-analysis/subscribers","subscription_url":"https://api.github.com/repos/project-ncl/dependency-analysis/subscription","commits_url":"https://api.github.com/repos/project-ncl/dependency-analysis/commits{/sha}","git_commits_url":"https://api.github.com/repos/project-ncl/dependency-analysis/git/commits{/sha}","comments_url":"https://api.github.com/repos/project-ncl/dependency-analysis/comments{/number}","issue_comment_url":"https://api.github.com/repos/project-ncl/dependency-analysis/issues/comments{/number}","contents_url":"https://api.github.com/repos/project-ncl/dependency-analysis/contents/{+path}","compare_url":"https://api.github.com/repos/project-ncl/dependency-analysis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/project-ncl/dependency-analysis/merges","archive_url":"https://api.github.com/repos/project-ncl/dependency-analysis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/project-ncl/dependency-analysis/downloads","issues_url":"https://api.github.com/repos/project-ncl/dependency-analysis/issues{/number}","pulls_url":"https://api.github.com/repos/project-ncl/dependency-analysis/pulls{/number}","milestones_url":"https://api.github.com/repos/project-ncl/dependency-analysis/milestones{/number}","notifications_url":"https://api.github.com/repos/project-ncl/dependency-analysis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/project-ncl/dependency-analysis/labels{/name}","releases_url":"https://api.github.com/repos/project-ncl/dependency-analysis/releases{/id}","created_at":"2015-06-10T12:52:57Z","updated_at":"2015-07-20T13:33:15Z","pushed_at":"2015-07-22T11:42:48Z","git_url":"git://github.com/project-ncl/dependency-analysis.git","ssh_url":"git@github.com:project-ncl/dependency-analysis.git","clone_url":"https://github.com/project-ncl/dependency-analysis.git","svn_url":"https://github.com/project-ncl/dependency-analysis","homepage":null,"size":414,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/project-ncl/dependency-analysis/pulls/28"},"html":{"href":"https://github.com/project-ncl/dependency-analysis/pull/28"},"issue":{"href":"https://api.github.com/repos/project-ncl/dependency-analysis/issues/28"},"comments":{"href":"https://api.github.com/repos/project-ncl/dependency-analysis/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/project-ncl/dependency-analysis/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/project-ncl/dependency-analysis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/project-ncl/dependency-analysis/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/project-ncl/dependency-analysis/statuses/276f3a999211b743e2b7e3eadd7fd50707da74af"}}}}