blackboard.platform.security
Class SecurityDbUtil

java.lang.Object
  |
  +--blackboard.platform.security.SecurityDbUtil

public class SecurityDbUtil
extends java.lang.Object

A utility class that encapsulates database operations that are frequently performed by blackboard.platform.security classes and/or classes within its sub-package. SecurityDbUtil

Since:
Bb 6.0

Constructor Summary
SecurityDbUtil()
           
 
Method Summary
static boolean getCreateAccountAllowed(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          getCreateAccountAllowed() Convenience method to determine whether users may create new accounts.
static EntitlementDbLoader getEntitlementDbLoader()
          Returns the EntitlementDbLoader instance associated with the default instance of the database BbPersistenceManager.
static java.lang.String getForgotPasswordUrl()
          getForgotPasswordUrl() Convenience method to determine whether users may request their password.
static java.lang.String getGlobalKey(javax.servlet.http.HttpServletRequest request, java.lang.String name)
          getGlobalKey
static boolean getGuestAllowed(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          getGuestAllowed() Convenience method to determine whether guests may access Blackboard installation.
static Id getId(java.sql.ResultSet rs, java.lang.String col1, java.lang.String col2, DataType dataType, Container container)
          Load the Id given the Resultset and the Container
static java.lang.String getPassportHrefUrl(javax.servlet.http.HttpServletRequest request)
          getPassportHrefUrl Returns the URL for the HREF tag
static java.lang.String getPassportImgUrl(javax.servlet.http.HttpServletRequest request)
          getPassportImgUrl Returns the URL for the IMG tags
static java.lang.String getPassportLogoTag(javax.servlet.http.HttpServletRequest request)
          getPassportLogoTag Returns the HREF and IMG tags, stored in the SESSION_INDS table, concatenated together in a single String.
static boolean getPortalDirectEntry(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          getPortalDirectEntry() Convenience method to determine whether guests may access Blackboard installation
static boolean getRetrievePasswordAllowed(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          getRetrievePasswordAllowed() Convenience method to determine whether users may request their password.
static java.lang.String getSoftwareTitle(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          getSoftwareTitle() Convenience method to determine the proper name for this Blackboard system
static Id getUserId(java.sql.ResultSet rs)
          Load the Id given the Resultset
static Id getUserId(java.sql.ResultSet rs, Container container)
          Load the Id given the Resultset and the Container using USER_DATA_TYPE and default connection
static void setGlobalKey(javax.servlet.http.HttpServletRequest request, java.lang.String name, java.lang.String value)
          setGlobalKey
static void setPassportLogoTag(javax.servlet.http.HttpServletRequest request)
          setPassportLogoTag Parses the "passport-logo-tag" header into separate variables and sets the values.
static void setUserId(java.sql.CallableStatement stmt, int pk1ColNum, int pk2ColNum, Id targetId)
          setUserId
static void setUserId(java.sql.PreparedStatement ps, int pk1ColNum, int pk2ColNum, Id targetId)
          setUserId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityDbUtil

public SecurityDbUtil()
Method Detail

getEntitlementDbLoader

public static EntitlementDbLoader getEntitlementDbLoader()
Returns the EntitlementDbLoader instance associated with the default instance of the database BbPersistenceManager.

Calling this method is equivalent to executing the following code:
 BbPersistenceManager bbPm = BbServiceManager.getPersistenceService().getDbPersistenceManager();
 entitlementLoader = (EntitlementDbLoader) bbPm.getLoader ( EntitlementDbLoader.TYPE );
 

Returns:
the EntitlementDbLoader instance associated with the default database persistence manager
Throws:
PersistenceException - if an error occurs when trying to retrieve the EntitlementDbLoader instance

getUserId

public static Id getUserId(java.sql.ResultSet rs)
Load the Id given the Resultset

Parameters:
rs - the ResultSet of the Id to be loaded

getUserId

public static Id getUserId(java.sql.ResultSet rs,
                           Container container)
Load the Id given the Resultset and the Container using USER_DATA_TYPE and default connection

Parameters:
rs - the ResultSet of the Id to be loaded
container - the Container from which the Id is be loaded

getId

public static Id getId(java.sql.ResultSet rs,
                       java.lang.String col1,
                       java.lang.String col2,
                       DataType dataType,
                       Container container)
Load the Id given the Resultset and the Container

Parameters:
rs - the ResultSet of the Id to be loaded
col1 - the field name used when unmarshalling the rs
col2 - the field name used when unmarshalling the rs
dataType - to use when unmarshalling the rs
container - the Container from which the Id is be loaded

setUserId

public static void setUserId(java.sql.PreparedStatement ps,
                             int pk1ColNum,
                             int pk2ColNum,
                             Id targetId)
                      throws java.sql.SQLException
setUserId

Parameters:
ps - the PreparedStatement used to set the Id userId
pk1ColNum - the column number used in the PreparedStatement
pk2ColNum - the column number used in the PreparedStatement
targetId - to use in the PreparedStatement
java.sql.SQLException

setUserId

public static void setUserId(java.sql.CallableStatement stmt,
                             int pk1ColNum,
                             int pk2ColNum,
                             Id targetId)
                      throws java.sql.SQLException
setUserId

Parameters:
stmt - the Callable used to set the Id userId
pk1ColNum - the column number used in the PreparedStatement
pk2ColNum - the column number used in the PreparedStatement
targetId - to use in the PreparedStatement
java.sql.SQLException

setGlobalKey

public static void setGlobalKey(javax.servlet.http.HttpServletRequest request,
                                java.lang.String name,
                                java.lang.String value)
                         throws PersistenceException
setGlobalKey

Parameters:
request - the HttpServletRequest where the info is stored
name - the name of the session variable
value - the value of the session variable
PersistenceException

getGlobalKey

public static java.lang.String getGlobalKey(javax.servlet.http.HttpServletRequest request,
                                            java.lang.String name)
                                     throws PersistenceException
getGlobalKey

Parameters:
request - the HttpServletRequest where the info is stored
name - the name of the session variable
Returns:
the value of this global variable as a String
PersistenceException

setPassportLogoTag

public static void setPassportLogoTag(javax.servlet.http.HttpServletRequest request)
                               throws PersistenceException
setPassportLogoTag Parses the "passport-logo-tag" header into separate variables and sets the values.

Parameters:
request - the HttpServletRequest where the session info is stored
PersistenceException

getPassportLogoTag

public static java.lang.String getPassportLogoTag(javax.servlet.http.HttpServletRequest request)
                                           throws PersistenceException
getPassportLogoTag Returns the HREF and IMG tags, stored in the SESSION_INDS table, concatenated together in a single String.

Parameters:
request - the HttpServletRequest where the info is stored
PersistenceException

getPassportHrefUrl

public static java.lang.String getPassportHrefUrl(javax.servlet.http.HttpServletRequest request)
                                           throws PersistenceException
getPassportHrefUrl Returns the URL for the HREF tag

Parameters:
request - the HttpServletRequest where the info is stored
PersistenceException

getPassportImgUrl

public static java.lang.String getPassportImgUrl(javax.servlet.http.HttpServletRequest request)
                                          throws PersistenceException
getPassportImgUrl Returns the URL for the IMG tags

Parameters:
request - the HttpServletRequest where the info is stored
PersistenceException

getSoftwareTitle

public static java.lang.String getSoftwareTitle(javax.servlet.http.HttpServletRequest req,
                                                javax.servlet.http.HttpServletResponse res)
getSoftwareTitle() Convenience method to determine the proper name for this Blackboard system

Parameters:
req - the HttpServletRequest
res - the HttpServletResponse

getPortalDirectEntry

public static boolean getPortalDirectEntry(javax.servlet.http.HttpServletRequest req,
                                           javax.servlet.http.HttpServletResponse res)
getPortalDirectEntry() Convenience method to determine whether guests may access Blackboard installation

Parameters:
req - the HttpServletRequest
res - the HttpServletResponse

getGuestAllowed

public static boolean getGuestAllowed(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response)
getGuestAllowed() Convenience method to determine whether guests may access Blackboard installation.

Parameters:
request - the HttpServletRequest
response - the HttpServletResponse

getCreateAccountAllowed

public static boolean getCreateAccountAllowed(javax.servlet.http.HttpServletRequest request,
                                              javax.servlet.http.HttpServletResponse response)
getCreateAccountAllowed() Convenience method to determine whether users may create new accounts.


getRetrievePasswordAllowed

public static boolean getRetrievePasswordAllowed(javax.servlet.http.HttpServletRequest request,
                                                 javax.servlet.http.HttpServletResponse response)
getRetrievePasswordAllowed() Convenience method to determine whether users may request their password.


getForgotPasswordUrl

public static java.lang.String getForgotPasswordUrl()
getForgotPasswordUrl() Convenience method to determine whether users may request their password.



Copyright © 2003 Blackboard, Inc. All Rights Reserved.