org.chorem.bow
Class BowUtils

java.lang.Object
  extended by org.chorem.bow.BowUtils

public class BowUtils
extends Object


Field Summary
static String BOW_DATE_SHORT_PATTERN
           
 
Method Summary
protected static boolean checkPermanentToken(BowSession session, String token)
          check if token exist, if true, put User associated with it, in BowSession
protected static boolean checkTemporaryToken(BowSession session, String token)
          Check token with temporary token
static BowUser checkToken(BowSession session, String token)
          Retrieves the user by the temporary or the permanent token
static String formatDate(Date date)
           
static String generateToken()
          Generates a random token
static String redirectTo(String searchLine, String fullTextLine)
          Redirects the user either on the home page or on the search page
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOW_DATE_SHORT_PATTERN

public static final String BOW_DATE_SHORT_PATTERN
See Also:
Constant Field Values
Method Detail

formatDate

public static String formatDate(Date date)

generateToken

public static String generateToken()
Generates a random token

Returns:
the generated token

redirectTo

public static String redirectTo(String searchLine,
                                String fullTextLine)
Redirects the user either on the home page or on the search page

Parameters:
searchLine - search line
fullTextLine - full text search
Returns:
the page where the user will be redirected

checkToken

public static BowUser checkToken(BowSession session,
                                 String token)
Retrieves the user by the temporary or the permanent token

Parameters:
session - the session
token - either the temporary or the permanent token
Returns:
the user if the token is valid, null if the token doesn't exist

checkPermanentToken

protected static boolean checkPermanentToken(BowSession session,
                                             String token)
check if token exist, if true, put User associated with it, in BowSession

Parameters:
session - bow session
token - which contains the MD5 encoding token
Returns:
User the token owner, null if the token doesn't exist

checkTemporaryToken

protected static boolean checkTemporaryToken(BowSession session,
                                             String token)
Check token with temporary token

Parameters:
session - bow session
token - which contains the MD5 encoding token
Returns:
user the token owner, null if the token doesn't exist


Copyright © 2010-2011 CodeLutin. All Rights Reserved.