Add MongoSession.changeSessionId
This commit is contained in:
@@ -40,7 +40,7 @@ public class MongoSession implements Session {
|
|||||||
*/
|
*/
|
||||||
private static final char DOT_COVER_CHAR = '\uF607';
|
private static final char DOT_COVER_CHAR = '\uF607';
|
||||||
|
|
||||||
private final String id;
|
private String id;
|
||||||
private long createdMillis = System.currentTimeMillis();
|
private long createdMillis = System.currentTimeMillis();
|
||||||
private long accessedMillis;
|
private long accessedMillis;
|
||||||
private long intervalSeconds;
|
private long intervalSeconds;
|
||||||
@@ -66,6 +66,17 @@ public class MongoSession implements Session {
|
|||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String changeSessionId() {
|
||||||
|
String changedId = generateId();
|
||||||
|
this.id = changedId;
|
||||||
|
return changedId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String generateId() {
|
||||||
|
return UUID.randomUUID().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T getAttribute(String attributeName) {
|
public <T> T getAttribute(String attributeName) {
|
||||||
return (T) this.attrs.get(coverDot(attributeName));
|
return (T) this.attrs.get(coverDot(attributeName));
|
||||||
|
|||||||
Reference in New Issue
Block a user