{"action":"created","comment":{"url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/pulls/comments/32731780","id":32731780,"diff_hunk":"@@ -0,0 +1,319 @@\n+import org.apache.catalina.*;\n+import org.apache.catalina.session.ManagerBase;\n+import org.apache.catalina.session.StandardSession;\n+import org.apache.catalina.util.LifecycleSupport;\n+import redis.clients.jedis.Jedis;\n+import redis.clients.jedis.JedisPool;\n+import redis.clients.jedis.JedisPoolConfig;\n+import org.apache.commons.lang3.SerializationUtils;\n+import java.io.IOException;\n+import java.text.ParseException;\n+import java.text.SimpleDateFormat;\n+import java.util.*;\n+\n+import org.apache.juli.logging.Log;\n+import org.apache.juli.logging.LogFactory;\n+\n+/**\n+ * Created by Cesar Valverde on 6/10/2015.\n+ */\n+public class RedisSessionManagerT8 extends ManagerBase implements Lifecycle {\n+\n+    private static final Log log = LogFactory.getLog(RedisSessionManagerT8.class);\n+\n+    private static final String REDIS_METADATA_KEY = \":metadata\";\n+    private static final String REDIS_ATTRIBUTES_KEY = \":attributes\";\n+\n+    //Metadata keys\n+    public static final String METADATA_VALID = \"valid\";\n+    public static final String METADATA_CREATION_TIME = \"creation_time\";\n+    public static final String METADATA_LAST_ACCESS_TIME = \"last_access_time\";\n+    public static final String METADATA_MAX_INACTIVE_INTERVAL = \"max_inactive_interval\";\n+\n+    protected JedisPool redisConnectionPool = null;\n+    protected JedisPoolConfig redisConnectionPoolConfig = null;\n+\n+    //Database info\n+    private String dbHost = \"localhost\";\n+    private int dbPort = 2222;\n+    private int dbTimeout = 0;\n+    private String dbPassword = \"\";\n+\n+    private static final String ISO_DATE_FORMAT = \"yyyy-MM-dd'T'HH:mm:ssZ\";","path":"src/main/java/RedisSessionManagerT8.java","position":42,"original_position":42,"commit_id":"0083749a3926a1e94ff90adba3c74c8c775ace15","original_commit_id":"0083749a3926a1e94ff90adba3c74c8c775ace15","user":{"login":"RobertFischer","id":20183,"avatar_url":"https://avatars.githubusercontent.com/u/20183?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertFischer","html_url":"https://github.com/RobertFischer","followers_url":"https://api.github.com/users/RobertFischer/followers","following_url":"https://api.github.com/users/RobertFischer/following{/other_user}","gists_url":"https://api.github.com/users/RobertFischer/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertFischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertFischer/subscriptions","organizations_url":"https://api.github.com/users/RobertFischer/orgs","repos_url":"https://api.github.com/users/RobertFischer/repos","events_url":"https://api.github.com/users/RobertFischer/events{/privacy}","received_events_url":"https://api.github.com/users/RobertFischer/received_events","type":"User","site_admin":false},"body":"Also, note that you're hardcoding the date format to Zulu time/GMT, which is almost certainly wrong.","created_at":"2015-06-18T13:56:09Z","updated_at":"2015-06-18T13:56:09Z","html_url":"https://github.com/RobertFischer/tomcat8-redis-sessions/pull/1#discussion_r32731780","pull_request_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/pulls/comments/32731780"},"html":{"href":"https://github.com/RobertFischer/tomcat8-redis-sessions/pull/1#discussion_r32731780"},"pull_request":{"href":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/pulls/1","id":37744325,"html_url":"https://github.com/RobertFischer/tomcat8-redis-sessions/pull/1","diff_url":"https://github.com/RobertFischer/tomcat8-redis-sessions/pull/1.diff","patch_url":"https://github.com/RobertFischer/tomcat8-redis-sessions/pull/1.patch","issue_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/issues/1","number":1,"state":"open","locked":false,"title":"First version of RedisSessionManager","user":{"login":"cvalverdeSapiens","id":12177562,"avatar_url":"https://avatars.githubusercontent.com/u/12177562?v=3","gravatar_id":"","url":"https://api.github.com/users/cvalverdeSapiens","html_url":"https://github.com/cvalverdeSapiens","followers_url":"https://api.github.com/users/cvalverdeSapiens/followers","following_url":"https://api.github.com/users/cvalverdeSapiens/following{/other_user}","gists_url":"https://api.github.com/users/cvalverdeSapiens/gists{/gist_id}","starred_url":"https://api.github.com/users/cvalverdeSapiens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvalverdeSapiens/subscriptions","organizations_url":"https://api.github.com/users/cvalverdeSapiens/orgs","repos_url":"https://api.github.com/users/cvalverdeSapiens/repos","events_url":"https://api.github.com/users/cvalverdeSapiens/events{/privacy}","received_events_url":"https://api.github.com/users/cvalverdeSapiens/received_events","type":"User","site_admin":false},"body":"@RobertFischer please review my code.\r\n\r\nI didn't work in the Expiration yet.","created_at":"2015-06-15T22:56:33Z","updated_at":"2015-06-18T13:56:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94329e26db5e634011f176c682f466748dd46dc5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/pulls/1/commits","review_comments_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/pulls/1/comments","review_comment_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/issues/1/comments","statuses_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/statuses/0083749a3926a1e94ff90adba3c74c8c775ace15","head":{"label":"cvalverdeSapiens:master","ref":"master","sha":"0083749a3926a1e94ff90adba3c74c8c775ace15","user":{"login":"cvalverdeSapiens","id":12177562,"avatar_url":"https://avatars.githubusercontent.com/u/12177562?v=3","gravatar_id":"","url":"https://api.github.com/users/cvalverdeSapiens","html_url":"https://github.com/cvalverdeSapiens","followers_url":"https://api.github.com/users/cvalverdeSapiens/followers","following_url":"https://api.github.com/users/cvalverdeSapiens/following{/other_user}","gists_url":"https://api.github.com/users/cvalverdeSapiens/gists{/gist_id}","starred_url":"https://api.github.com/users/cvalverdeSapiens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvalverdeSapiens/subscriptions","organizations_url":"https://api.github.com/users/cvalverdeSapiens/orgs","repos_url":"https://api.github.com/users/cvalverdeSapiens/repos","events_url":"https://api.github.com/users/cvalverdeSapiens/events{/privacy}","received_events_url":"https://api.github.com/users/cvalverdeSapiens/received_events","type":"User","site_admin":false},"repo":{"id":37209900,"name":"tomcat8-redis-sessions","full_name":"cvalverdeSapiens/tomcat8-redis-sessions","owner":{"login":"cvalverdeSapiens","id":12177562,"avatar_url":"https://avatars.githubusercontent.com/u/12177562?v=3","gravatar_id":"","url":"https://api.github.com/users/cvalverdeSapiens","html_url":"https://github.com/cvalverdeSapiens","followers_url":"https://api.github.com/users/cvalverdeSapiens/followers","following_url":"https://api.github.com/users/cvalverdeSapiens/following{/other_user}","gists_url":"https://api.github.com/users/cvalverdeSapiens/gists{/gist_id}","starred_url":"https://api.github.com/users/cvalverdeSapiens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvalverdeSapiens/subscriptions","organizations_url":"https://api.github.com/users/cvalverdeSapiens/orgs","repos_url":"https://api.github.com/users/cvalverdeSapiens/repos","events_url":"https://api.github.com/users/cvalverdeSapiens/events{/privacy}","received_events_url":"https://api.github.com/users/cvalverdeSapiens/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cvalverdeSapiens/tomcat8-redis-sessions","description":"Library for using Redis sessions in Tomcat 8.","fork":true,"url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions","forks_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/forks","keys_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/teams","hooks_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/hooks","issue_events_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/issues/events{/number}","events_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/events","assignees_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/assignees{/user}","branches_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/branches{/branch}","tags_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/tags","blobs_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/git/refs{/sha}","trees_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/statuses/{sha}","languages_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/languages","stargazers_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/stargazers","contributors_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/contributors","subscribers_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/subscribers","subscription_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/subscription","commits_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/commits{/sha}","git_commits_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/git/commits{/sha}","comments_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/comments{/number}","issue_comment_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/issues/comments{/number}","contents_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/contents/{+path}","compare_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/merges","archive_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/downloads","issues_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/issues{/number}","pulls_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/pulls{/number}","milestones_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/milestones{/number}","notifications_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/labels{/name}","releases_url":"https://api.github.com/repos/cvalverdeSapiens/tomcat8-redis-sessions/releases{/id}","created_at":"2015-06-10T16:50:24Z","updated_at":"2015-06-15T22:52:23Z","pushed_at":"2015-06-17T18:14:50Z","git_url":"git://github.com/cvalverdeSapiens/tomcat8-redis-sessions.git","ssh_url":"git@github.com:cvalverdeSapiens/tomcat8-redis-sessions.git","clone_url":"https://github.com/cvalverdeSapiens/tomcat8-redis-sessions.git","svn_url":"https://github.com/cvalverdeSapiens/tomcat8-redis-sessions","homepage":null,"size":87,"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":"RobertFischer:master","ref":"master","sha":"2f1a51190726cc4c676adc1a90f735c6939f535a","user":{"login":"RobertFischer","id":20183,"avatar_url":"https://avatars.githubusercontent.com/u/20183?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertFischer","html_url":"https://github.com/RobertFischer","followers_url":"https://api.github.com/users/RobertFischer/followers","following_url":"https://api.github.com/users/RobertFischer/following{/other_user}","gists_url":"https://api.github.com/users/RobertFischer/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertFischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertFischer/subscriptions","organizations_url":"https://api.github.com/users/RobertFischer/orgs","repos_url":"https://api.github.com/users/RobertFischer/repos","events_url":"https://api.github.com/users/RobertFischer/events{/privacy}","received_events_url":"https://api.github.com/users/RobertFischer/received_events","type":"User","site_admin":false},"repo":{"id":37137369,"name":"tomcat8-redis-sessions","full_name":"RobertFischer/tomcat8-redis-sessions","owner":{"login":"RobertFischer","id":20183,"avatar_url":"https://avatars.githubusercontent.com/u/20183?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertFischer","html_url":"https://github.com/RobertFischer","followers_url":"https://api.github.com/users/RobertFischer/followers","following_url":"https://api.github.com/users/RobertFischer/following{/other_user}","gists_url":"https://api.github.com/users/RobertFischer/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertFischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertFischer/subscriptions","organizations_url":"https://api.github.com/users/RobertFischer/orgs","repos_url":"https://api.github.com/users/RobertFischer/repos","events_url":"https://api.github.com/users/RobertFischer/events{/privacy}","received_events_url":"https://api.github.com/users/RobertFischer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RobertFischer/tomcat8-redis-sessions","description":"Library for using Redis sessions in Tomcat 8.","fork":false,"url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions","forks_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/forks","keys_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/teams","hooks_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/hooks","issue_events_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/issues/events{/number}","events_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/events","assignees_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/assignees{/user}","branches_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/branches{/branch}","tags_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/tags","blobs_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/git/refs{/sha}","trees_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/statuses/{sha}","languages_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/languages","stargazers_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/stargazers","contributors_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/contributors","subscribers_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/subscribers","subscription_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/subscription","commits_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/commits{/sha}","git_commits_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/git/commits{/sha}","comments_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/comments{/number}","issue_comment_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/issues/comments{/number}","contents_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/contents/{+path}","compare_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/merges","archive_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/downloads","issues_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/issues{/number}","pulls_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/pulls{/number}","milestones_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/milestones{/number}","notifications_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/labels{/name}","releases_url":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/releases{/id}","created_at":"2015-06-09T14:34:10Z","updated_at":"2015-06-09T14:34:10Z","pushed_at":"2015-06-17T21:27:08Z","git_url":"git://github.com/RobertFischer/tomcat8-redis-sessions.git","ssh_url":"git@github.com:RobertFischer/tomcat8-redis-sessions.git","clone_url":"https://github.com/RobertFischer/tomcat8-redis-sessions.git","svn_url":"https://github.com/RobertFischer/tomcat8-redis-sessions","homepage":null,"size":144,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/pulls/1"},"html":{"href":"https://github.com/RobertFischer/tomcat8-redis-sessions/pull/1"},"issue":{"href":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/issues/1"},"comments":{"href":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/RobertFischer/tomcat8-redis-sessions/statuses/0083749a3926a1e94ff90adba3c74c8c775ace15"}}}}