etherpad-lite icon indicating copy to clipboard operation
etherpad-lite copied to clipboard

Java, Etherpad : Create a non-expiring session.

Open kernelfreak opened this issue 10 years ago • 0 comments

I am currently using Etherpad in Java and creating session for it. This session information is saved in our Database.

  1. Ideally, I would like to create a session object which is non-expiring? Is there any way to do that?

  2. 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.

kernelfreak avatar Nov 02 '16 10:11 kernelfreak