Mercurial > hg > RemoteEditor > REPSessionManager
comparison rep/SessionList.java @ 359:fa041bae35f1
all code written for distributed session except gather.
author | kono |
---|---|
date | Sun, 19 Oct 2008 19:24:38 +0900 |
parents | 034acadc0cdc |
children | 1d5b608f39da |
comparison
equal
deleted
inserted
replaced
358:034acadc0cdc | 359:fa041bae35f1 |
---|---|
81 // e.printStackTrace(); | 81 // e.printStackTrace(); |
82 // } | 82 // } |
83 // return str.toString(); | 83 // return str.toString(); |
84 // }*/ | 84 // }*/ |
85 | 85 |
86 | |
87 public int addSession(Session session) { | |
88 int sid; | |
89 session.setSID(sid=newSessionID()); | |
90 put(sid,session); | |
91 return sid; | |
92 } | |
93 | 86 |
94 public Session getSession(int sid) { | 87 public Session getSession(int sid) { |
95 return get(sid); | 88 return get(sid); |
96 } | 89 } |
97 | 90 |
98 public int newSessionID() { | 91 public int newSessionID() { |
99 return ++sid_root ; | 92 return ++sid_root ; |
100 } | 93 } |
101 | 94 |
102 public void merge(SessionList receivedSessionList) { | 95 public void merge(SessionList receivedSessionList) { |
103 // TODO Auto-generated method stub | 96 for(Session s:receivedSessionList.values()) { |
104 | 97 int sid = s.getSID(); |
98 if (containsKey(sid)) { | |
99 get(sid).merge(s); | |
100 } else { | |
101 put(sid,s); | |
102 } | |
103 } | |
105 } | 104 } |
106 | 105 |
107 | 106 |
108 } | 107 } |