{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-taverna-mobile/pulls/comments/81114330","pull_request_review_id":2117452,"id":81114330,"diff_hunk":"@@ -0,0 +1,102 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+package org.apache.taverna.mobile.ui.playerlogin;\n+\n+import android.util.Base64;\n+import android.util.Log;\n+\n+import org.apache.taverna.mobile.data.DataManager;\n+import org.apache.taverna.mobile.ui.base.BasePresenter;\n+\n+import okhttp3.ResponseBody;\n+import retrofit2.adapter.rxjava.HttpException;\n+import rx.Observer;\n+import rx.Subscription;\n+import rx.android.schedulers.AndroidSchedulers;\n+import rx.schedulers.Schedulers;\n+\n+\n+public class PlayerLoginPresenter extends BasePresenter<PlayerLoginMvpView> {\n+\n+    private static final String TAG = PlayerLoginPresenter.class.getSimpleName();\n+\n+    private DataManager mDataManager;\n+\n+    private Subscription mSubscriptions;\n+\n+    public PlayerLoginPresenter(DataManager dataManager) {\n+        mDataManager = dataManager;\n+    }\n+\n+    @Override\n+    public void attachView(PlayerLoginMvpView mvpView) {\n+        super.attachView(mvpView);\n+    }\n+\n+    @Override\n+    public void detachView() {\n+        super.detachView();\n+        if (mSubscriptions != null) mSubscriptions.unsubscribe();\n+    }\n+\n+    public void playerLogin(final String username, final String password, final boolean loginFlag) {\n+        if (mSubscriptions != null) mSubscriptions.unsubscribe();\n+\n+        mSubscriptions = mDataManager.authPlayerUserLoginDetail(getEncodedCredential(username,\n+                password), loginFlag)\n+                .observeOn(AndroidSchedulers.mainThread())\n+                .subscribeOn(Schedulers.io())\n+                .subscribe(new Observer<ResponseBody>() {\n+                    @Override\n+                    public void onCompleted() {\n+\n+                    }\n+\n+                    @Override\n+                    public void onError(Throwable e) {\n+                        Log.e(TAG, \"onError: \", e);\n+                        if (e instanceof HttpException) {\n+                            if (((HttpException) e).code() == 401) {\n+                                getMvpView().showCredentialError();\n+                            } else if (((HttpException) e).code() == 406) {\n+                                getMvpView().validCredential();\n+                                mDataManager.getPreferencesHelper()\n+                                        .setUserPlayerLoggedInFlagAndCredential(loginFlag,\n+                                                getEncodedCredential(username, password));\n+\n+                            } else {\n+                                getMvpView().showError(\"Server Error\");","path":"app/src/main/java/org/apache/taverna/mobile/ui/playerlogin/PlayerLoginPresenter.java","position":84,"original_position":84,"commit_id":"fc036a7bff22af3b747a28f5d874e4d178197bf0","original_commit_id":"fc036a7bff22af3b747a28f5d874e4d178197bf0","user":{"login":"therajanmaurya","id":5724482,"avatar_url":"https://avatars.githubusercontent.com/u/5724482?v=3","gravatar_id":"","url":"https://api.github.com/users/therajanmaurya","html_url":"https://github.com/therajanmaurya","followers_url":"https://api.github.com/users/therajanmaurya/followers","following_url":"https://api.github.com/users/therajanmaurya/following{/other_user}","gists_url":"https://api.github.com/users/therajanmaurya/gists{/gist_id}","starred_url":"https://api.github.com/users/therajanmaurya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therajanmaurya/subscriptions","organizations_url":"https://api.github.com/users/therajanmaurya/orgs","repos_url":"https://api.github.com/users/therajanmaurya/repos","events_url":"https://api.github.com/users/therajanmaurya/events{/privacy}","received_events_url":"https://api.github.com/users/therajanmaurya/received_events","type":"User","site_admin":false},"body":"Do not user hard coded strings. Remove this with string resources","created_at":"2016-09-29T11:18:26Z","updated_at":"2016-09-29T11:18:26Z","html_url":"https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81114330","pull_request_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-taverna-mobile/pulls/comments/81114330"},"html":{"href":"https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81114330"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-taverna-mobile/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-taverna-mobile/pulls/28","id":86716749,"html_url":"https://github.com/apache/incubator-taverna-mobile/pull/28","diff_url":"https://github.com/apache/incubator-taverna-mobile/pull/28.diff","patch_url":"https://github.com/apache/incubator-taverna-mobile/pull/28.patch","issue_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/issues/28","number":28,"state":"open","locked":false,"title":"Taverna 2's workflow running feature ","user":{"login":"sagar15795","id":5468111,"avatar_url":"https://avatars.githubusercontent.com/u/5468111?v=3","gravatar_id":"","url":"https://api.github.com/users/sagar15795","html_url":"https://github.com/sagar15795","followers_url":"https://api.github.com/users/sagar15795/followers","following_url":"https://api.github.com/users/sagar15795/following{/other_user}","gists_url":"https://api.github.com/users/sagar15795/gists{/gist_id}","starred_url":"https://api.github.com/users/sagar15795/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagar15795/subscriptions","organizations_url":"https://api.github.com/users/sagar15795/orgs","repos_url":"https://api.github.com/users/sagar15795/repos","events_url":"https://api.github.com/users/sagar15795/events{/privacy}","received_events_url":"https://api.github.com/users/sagar15795/received_events","type":"User","site_admin":false},"body":"I have implemented Taverna 2's Workflow running functionality ","created_at":"2016-09-26T10:26:27Z","updated_at":"2016-09-29T11:18:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c1a2f0028b8c12adc96860fc14f33114b34cd7b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/pulls/28/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/pulls/28/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/issues/28/comments","statuses_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/statuses/fc036a7bff22af3b747a28f5d874e4d178197bf0","head":{"label":"sagar15795:PlayerIntegration","ref":"PlayerIntegration","sha":"fc036a7bff22af3b747a28f5d874e4d178197bf0","user":{"login":"sagar15795","id":5468111,"avatar_url":"https://avatars.githubusercontent.com/u/5468111?v=3","gravatar_id":"","url":"https://api.github.com/users/sagar15795","html_url":"https://github.com/sagar15795","followers_url":"https://api.github.com/users/sagar15795/followers","following_url":"https://api.github.com/users/sagar15795/following{/other_user}","gists_url":"https://api.github.com/users/sagar15795/gists{/gist_id}","starred_url":"https://api.github.com/users/sagar15795/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagar15795/subscriptions","organizations_url":"https://api.github.com/users/sagar15795/orgs","repos_url":"https://api.github.com/users/sagar15795/repos","events_url":"https://api.github.com/users/sagar15795/events{/privacy}","received_events_url":"https://api.github.com/users/sagar15795/received_events","type":"User","site_admin":false},"repo":{"id":57181122,"name":"incubator-taverna-mobile","full_name":"sagar15795/incubator-taverna-mobile","owner":{"login":"sagar15795","id":5468111,"avatar_url":"https://avatars.githubusercontent.com/u/5468111?v=3","gravatar_id":"","url":"https://api.github.com/users/sagar15795","html_url":"https://github.com/sagar15795","followers_url":"https://api.github.com/users/sagar15795/followers","following_url":"https://api.github.com/users/sagar15795/following{/other_user}","gists_url":"https://api.github.com/users/sagar15795/gists{/gist_id}","starred_url":"https://api.github.com/users/sagar15795/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagar15795/subscriptions","organizations_url":"https://api.github.com/users/sagar15795/orgs","repos_url":"https://api.github.com/users/sagar15795/repos","events_url":"https://api.github.com/users/sagar15795/events{/privacy}","received_events_url":"https://api.github.com/users/sagar15795/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sagar15795/incubator-taverna-mobile","description":"Mirror of Apache Taverna Mobile (Incubating)","fork":true,"url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile","forks_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/forks","keys_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/teams","hooks_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/hooks","issue_events_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/issues/events{/number}","events_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/events","assignees_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/assignees{/user}","branches_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/branches{/branch}","tags_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/tags","blobs_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/git/refs{/sha}","trees_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/statuses/{sha}","languages_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/languages","stargazers_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/stargazers","contributors_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/contributors","subscribers_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/subscribers","subscription_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/subscription","commits_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/commits{/sha}","git_commits_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/git/commits{/sha}","comments_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/comments{/number}","issue_comment_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/issues/comments{/number}","contents_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/contents/{+path}","compare_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/merges","archive_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/downloads","issues_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/issues{/number}","pulls_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/pulls{/number}","milestones_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/milestones{/number}","notifications_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/labels{/name}","releases_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/releases{/id}","deployments_url":"https://api.github.com/repos/sagar15795/incubator-taverna-mobile/deployments","created_at":"2016-04-27T03:38:52Z","updated_at":"2016-06-06T07:00:29Z","pushed_at":"2016-09-27T09:56:18Z","git_url":"git://github.com/sagar15795/incubator-taverna-mobile.git","ssh_url":"git@github.com:sagar15795/incubator-taverna-mobile.git","clone_url":"https://github.com/sagar15795/incubator-taverna-mobile.git","svn_url":"https://github.com/sagar15795/incubator-taverna-mobile","homepage":null,"size":47397,"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":"apache:master","ref":"master","sha":"f4b64b13d1c4f20bdbc96f1f618fe6a9ab4eacbc","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":35204051,"name":"incubator-taverna-mobile","full_name":"apache/incubator-taverna-mobile","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-taverna-mobile","description":"Mirror of Apache Taverna Mobile (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-taverna-mobile","forks_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/forks","keys_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/teams","hooks_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/events","assignees_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/tags","blobs_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/subscription","commits_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/merges","archive_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/downloads","issues_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-taverna-mobile/deployments","created_at":"2015-05-07T07:00:05Z","updated_at":"2016-07-28T16:42:50Z","pushed_at":"2016-09-27T09:56:18Z","git_url":"git://github.com/apache/incubator-taverna-mobile.git","ssh_url":"git@github.com:apache/incubator-taverna-mobile.git","clone_url":"https://github.com/apache/incubator-taverna-mobile.git","svn_url":"https://github.com/apache/incubator-taverna-mobile","homepage":null,"size":55682,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":"git://git.apache.org/incubator-taverna-mobile.git","open_issues_count":1,"forks":9,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-taverna-mobile/pulls/28"},"html":{"href":"https://github.com/apache/incubator-taverna-mobile/pull/28"},"issue":{"href":"https://api.github.com/repos/apache/incubator-taverna-mobile/issues/28"},"comments":{"href":"https://api.github.com/repos/apache/incubator-taverna-mobile/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-taverna-mobile/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-taverna-mobile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-taverna-mobile/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-taverna-mobile/statuses/fc036a7bff22af3b747a28f5d874e4d178197bf0"}}}}
{"actor":{"display_login":"therajanmaurya"}}