etherpad-lite
etherpad-lite copied to clipboard
Java, Etherpad : Create a non-expiring session.
I am currently using Etherpad in Java and creating session for it. This session information is saved in our Database.
-
Ideally, I would like to create a session object which is non-expiring? Is there any way to do that?
-
Is there any way to check if the given session-ID has expired? Thank you.
COde I have :
public void createSessionForAll(){
List<GroupAccount> groupAccountList = this.groupAccountService.getAllGroupAccounts();
for(GroupAccount groupAccount : groupAccountList){
Person person = this.personService.findPersonByUsername(groupAccount.getAdminUsername());
Map group = client.createGroup();
System.out.println("Group to string is " + group.toString());
Map author = client.createAuthor(String.valueOf(person.getFirstName()));
System.out.println("Author is " + author.toString());
Map sessionData = client.createSession(String.valueOf(group.get("groupID")), String.valueOf(author.get("authorID")), 2048);
if (sessionData != null) {
sessionData.put("groupID", group.get("groupID"));
sessionData.put("authorID", author.get("authorID"));
groupAccount.setSessionData(sessionData.toString());
this.groupAccountService.directUpdateGroupAccount(groupAccount);
//return client.createGroupPad(String.valueOf(group.get("groupID")),String.valueOf(noteId),noteText);
}
}
}
Thank you.