Package com.Yasna.forum.Exceptions

Examples of com.Yasna.forum.Exceptions.RapidPostingException


                ResultSet rs = pstmt.executeQuery();
                if( rs.next() ) {
                    if (rs.getString("lastpost")!=null && !rs.getString("lastpost").toUpperCase().equals("NULL") && !rs.getString("lastpost").equals("")){
                     if(Calendar.getInstance().getTimeInMillis()-Long.parseLong(rs.getString("lastpost")) < Long.parseLong(SystemProperty.getProperty("PeriodBetweenPosts"))*ranking){
                      long timediff = (Calendar.getInstance().getTimeInMillis() - Long.parseLong(rs.getString("lastpost")))/1000;
                      throw new RapidPostingException("Rapid Posting Error. There was a post already posted at " + Long.toString(timediff)+" seconds ago!");
                     }
                    }
                }
            }
            catch( SQLException sqle ) {
View Full Code Here


    pstmt = con.prepareStatement(CHECK_SESSION);
    pstmt.setString(1,clientIP.getRemoteIP());
                ResultSet rs = pstmt.executeQuery();
                if( rs.next() ) {
                     if(Calendar.getInstance().getTimeInMillis()-Long.parseLong(rs.getString("initime"))*1000.0 < Long.parseLong(SystemProperty.getProperty("WaitPeriod"))){
                      throw new RapidPostingException("Rapid Posting Error. Wait period is " + SystemProperty.getProperty("WaitPeriod")+"!");
                     }
                }
            }
            catch( SQLException sqle ) {
                System.err.println("an error occured in DbForumMessage (0936):"+sqle.getMessage());
View Full Code Here

TOP

Related Classes of com.Yasna.forum.Exceptions.RapidPostingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.