How to enforce a 5-minute per post rule in a session object in Java?

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-04-06T22:25:34Z Indexed on 2010/04/06 22:33 UTC
Read the original article Hit count: 167

Filed under:
|
|

I'm trying to figure out how to enforce a 5 minute per post/action rule.

I'm developing a web application with Wicket in Java and I've got a session class which I was planning on using to keep track of these timers on a per-user basis. I wasn't planning on storing the timestamp in a database.

public boolean isAllowedToPost() {  
    if(null OR has 5 minutes passed since last post) {  
        // set the new timestamp      
        return true;    
    }  
    else   
    {   
        return false;  
    }  
}

© Stack Overflow or respective owner

Related posts about wicket

Related posts about java