public class ThreadServletContext extends MappedAttributesObject implements FlashServletContext
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
The class' serialization version id.
|
ivHashCode, ivHashFlds, ivObjAttrs
Constructor and Description |
---|
ThreadServletContext(FlashServletContext ctx)
Constructs a new
ThreadServletContext with no JDBC connection. |
ThreadServletContext(FlashServletContext ctx,
boolean dbaccess)
Constructs a new
ThreadServletContext and optionally obtains
a JDBC connection. |
Modifier and Type | Method and Description |
---|---|
void |
delAttr(java.lang.String key)
Deprecated.
|
boolean |
equals(java.lang.Object obj)
Compares the given object to this object and determines if the two are
equal.
|
void |
freeDbConnection()
Returns the context's JDBC connection to the connection pool.
|
java.lang.Object |
getAttr(java.lang.String key)
Deprecated.
|
java.math.BigDecimal |
getAttrBigDecimal(java.lang.String key)
Deprecated.
|
boolean |
getAttrBoolean(java.lang.String key)
Deprecated.
|
double |
getAttrDouble(java.lang.String key)
Deprecated.
|
int |
getAttrInteger(java.lang.String key)
Deprecated.
|
long |
getAttrLong(java.lang.String key)
Deprecated.
|
java.lang.String |
getAttrString(java.lang.String key)
Deprecated.
|
UserCatalogVerifier |
getCatalogVerifier()
Returns the context's user catalog verifier.
|
java.sql.Connection |
getDbConnection()
Returns the JDBC connection from the context's JDBC connection information
object.
|
JDBCConnectionInfo |
getDbConnectionInfo()
Returns the context's JDBC connection information object.
|
<DBOBJCTLR extends JDBCObjectController<? extends JDBCObject<?>>> |
getDbController(java.lang.Class<DBOBJCTLR> ctlrcls)
Returns the JDBC object controller for the given controller class.
|
<DBOBJ extends JDBCObject<?>> |
getDbObject(java.lang.Class<DBOBJ> objcls)
Returns the JDBC object for the given object class.
|
UserFavoritesHandler |
getFavoritesHandler()
Returns the context's user favorites handler.
|
<ERPTYPE extends ERPInterface> |
getInterface(java.lang.Class<ERPTYPE> type)
Returns the ERP interface for the given interface type.
|
User |
getLogonUser()
Returns the context's logon user.
|
java.lang.String |
getParam(java.lang.String name)
Deprecated.
|
java.math.BigDecimal |
getParamBigDecimal(java.lang.String name)
Deprecated.
|
java.util.Date |
getParamDate(java.lang.String name)
Deprecated.
|
double |
getParamDouble(java.lang.String name)
Deprecated.
|
int |
getParamInteger(java.lang.String name)
Deprecated.
|
long |
getParamLong(java.lang.String name)
Deprecated.
|
java.lang.String[] |
getParams(java.lang.String name)
Deprecated.
|
java.lang.String |
getParamString(java.lang.String name)
Deprecated.
|
javax.servlet.http.HttpServletRequest |
getRequest()
Deprecated.
|
javax.servlet.http.HttpServletResponse |
getResponse()
Deprecated.
|
FlashServletRequest |
getServletRequest()
Returns the current request's servlet request object.
|
FlashServlet.Stack |
getServletStack()
Returns the current session's servlet request stack.
|
javax.servlet.http.HttpSession |
getSession()
Returns the current servlet session.
|
Cart |
getShoppingCart()
Returns the context's shopping cart.
|
SecurityProfile |
getShoppingProfile()
Returns the security profile that governs how shopping & other functions
are processed.
|
User |
getShoppingUser()
Returns the context's shopping user.
|
SiteActivity |
getSiteActivity()
Returns the context's site activity.
|
UnitMeasureHandler |
getUomHandler()
Returns the context's unit of measure handler.
|
boolean |
isCustAdmin()
Answers if the logon user is a customer administrator.
|
boolean |
isDefaultUser()
Answers if the logon user is the default user (no one is logged on).
|
boolean |
isLoggedOn()
Answers if a successful logon has occurred during the session passed to
the context's constructor (within the supplied context).
|
boolean |
isPermitActive()
Answers if permit processing is in effect (active) based on the value
of
Flash.PERMIT_ENABLED and whether any shopping is currently
taking place. |
boolean |
isPost()
Deprecated.
|
boolean |
isRetail()
Answers if the site is for a retail store.
|
boolean |
isSfiSelect()
Answers if the logon user is a sales rep user and there is no account
currently selected.
|
boolean |
isSfiShopping()
Answers if the logon user is a sales rep user and there is an account
currently selected.
|
boolean |
isShopping()
Answers if the logon user is a basic shopping user.
|
boolean |
isSiteAdmin()
Answers if the logon user is a site administrator.
|
boolean |
isWholesale()
Answers if the site is for a wholesale store.
|
void |
setAttr(java.lang.String key,
java.lang.Object value)
Deprecated.
|
void |
setLogonUser(User user)
Sets the context's logon user.
|
cloneMapAttributes, formatValue, formatValue, getHashFields, getMapArrayList, getMapAttributes, getMapBigDecimal, getMapBoolean, getMapDate, getMapDouble, getMapInteger, getMapLong, getMapMapped, getMapObject, getMapShort, getMapString, getMapString, getMapStringBuffer, getMapStringBuilder, getMapTime, getMapTimestamp, getMapVector, hashCode, setHashFields, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMapAttributes, setMapObject, setMapTime, setMapTimestamp, toStringArray
private static final long serialVersionUID
public ThreadServletContext(FlashServletContext ctx)
ThreadServletContext
with no JDBC connection.ctx
- (FlashServletContext) The current servlet context.public ThreadServletContext(FlashServletContext ctx, boolean dbaccess)
ThreadServletContext
and optionally obtains
a JDBC connection.
THREAD CLASSES THAT USE A JDBC CONNECTION MUST RETURN THE CONNECTION
TO THE CONNECTION POOL PRIOR TO COMPLETING PROCESSING.
SEE freeDbConnection
.
ctx
- (FlashServletContext) The current servlet context.dbaccess
- (boolean) true
if the user of this thread
servlet context requires access to the database, otherwise
false
.java.lang.NullPointerException
- - if unable to obtain a JDBC connection.public boolean equals(java.lang.Object obj)
equals
in MappedAttributesObject
.
This implementation always returns false
.equals
in class MappedAttributesObject
obj
- (Object) The object to compare with this object.true
if the specified object is equal to
this object, otherwise false
.@Deprecated public void delAttr(java.lang.String key)
BaseServletContext
delAttr
in interface BaseServletContext
key
- (String) The key for the attribute value to remove.@Deprecated public java.lang.Object getAttr(java.lang.String key)
BaseServletContext
getAttr
in interface BaseServletContext
key
- (String) The key for the desired attribute value.null
if a value for the key does not exist.@Deprecated public java.math.BigDecimal getAttrBigDecimal(java.lang.String key)
BaseServletContext
BigDecimal
.getAttrBigDecimal
in interface BaseServletContext
key
- (String) The key for the desired attribute value.null
if a value for the key does not exist or if the
key's value could not be converted to a BigDecimal
.@Deprecated public boolean getAttrBoolean(java.lang.String key)
BaseServletContext
boolean
.getAttrBoolean
in interface BaseServletContext
key
- (String) The key for the desired attribute value.false
if a value for the key does not exist or if the
key's value could not be converted to a boolean.@Deprecated public double getAttrDouble(java.lang.String key)
BaseServletContext
double
.getAttrDouble
in interface BaseServletContext
key
- (String) The key for the desired attribute value.@Deprecated public int getAttrInteger(java.lang.String key)
BaseServletContext
int
.getAttrInteger
in interface BaseServletContext
key
- (String) The key for the desired attribute value.@Deprecated public long getAttrLong(java.lang.String key)
BaseServletContext
long
.getAttrLong
in interface BaseServletContext
key
- (String) The key for the desired attribute value.@Deprecated public java.lang.String getAttrString(java.lang.String key)
BaseServletContext
String
.getAttrString
in interface BaseServletContext
key
- (String) The key for the desired attribute value.@Deprecated public void setAttr(java.lang.String key, java.lang.Object value)
BaseServletContext
setAttr
in interface BaseServletContext
key
- (String) The key associated with the value.value
- (Object) The attribute value to set.@Deprecated public java.lang.String getParam(java.lang.String name)
BaseServletContext
getParam
in interface BaseServletContext
name
- (String) The name of the desired parameter value.null
if a value for the parameter name
does not exist.@Deprecated public java.lang.String[] getParams(java.lang.String name)
BaseServletContext
getParams
in interface BaseServletContext
name
- (String) The name of the desired parameter values.null
if a value for the parameter name
does not exist.@Deprecated public java.math.BigDecimal getParamBigDecimal(java.lang.String name)
BaseServletContext
BigDecimal
.getParamBigDecimal
in interface BaseServletContext
name
- (String) The name of the desired parameter value.BigDecimal
.@Deprecated public java.util.Date getParamDate(java.lang.String name)
BaseServletContext
java.util.Date
.getParamDate
in interface BaseServletContext
name
- (String) The name of the desired parameter value.null
if a value for the parameter name does not
exist or if the parameter value could not be converted to a date.@Deprecated public double getParamDouble(java.lang.String name)
BaseServletContext
double
.getParamDouble
in interface BaseServletContext
name
- (String) The name of the desired parameter value.@Deprecated public int getParamInteger(java.lang.String name)
BaseServletContext
int
.getParamInteger
in interface BaseServletContext
name
- (String) The name of the desired parameter value.@Deprecated public long getParamLong(java.lang.String name)
BaseServletContext
long
.getParamLong
in interface BaseServletContext
name
- (String) The name of the desired parameter value.@Deprecated public java.lang.String getParamString(java.lang.String name)
BaseServletContext
String
.getParamString
in interface BaseServletContext
name
- (String) The name of the desired parameter value.@Deprecated public javax.servlet.http.HttpServletRequest getRequest()
BaseServletContext
getRequest
in interface BaseServletContext
@Deprecated public javax.servlet.http.HttpServletResponse getResponse()
BaseServletContext
getResponse
in interface BaseServletContext
@Deprecated public boolean isPost()
BaseServletContext
isPost
in interface BaseServletContext
true
if a form has been posted,
otherwise false
.public javax.servlet.http.HttpSession getSession()
getSession
in interface BaseServletContext
public UserCatalogVerifier getCatalogVerifier()
getCatalogVerifier
in FlashServletContext
.getCatalogVerifier
in interface FlashServletContext
public java.sql.Connection getDbConnection()
getDbConnection
in FlashServletContext
.getDbConnection
in interface FlashServletContext
public JDBCConnectionInfo getDbConnectionInfo()
getDbConnectionInfo
in FlashServletContext
.getDbConnectionInfo
in interface FlashServletContext
public <DBOBJCTLR extends JDBCObjectController<? extends JDBCObject<?>>> DBOBJCTLR getDbController(java.lang.Class<DBOBJCTLR> ctlrcls)
getDbController
in FlashServletContext
.getDbController
in interface FlashServletContext
ctlrcls
- (Class) The class for the desired controller.public <DBOBJ extends JDBCObject<?>> DBOBJ getDbObject(java.lang.Class<DBOBJ> objcls)
getDbObject
in FlashServletContext
.getDbObject
in interface FlashServletContext
objcls
- (Class) The class for the desired object.public UserFavoritesHandler getFavoritesHandler()
getFavoritesHandler
in FlashServletContext
.getFavoritesHandler
in interface FlashServletContext
public <ERPTYPE extends ERPInterface> ERPTYPE getInterface(java.lang.Class<ERPTYPE> type)
getInterface
in FlashServletContext
.getInterface
in interface FlashServletContext
type
- (Class) The type for the desired ERP interface. Must be
one of the constants defined in ERPFactory
.null
if unable to
create or obtain the requested ERP interface or if no interface
is defined for the given type.public User getLogonUser()
getLogonUser
in FlashServletContext
.getLogonUser
in interface FlashServletContext
public void setLogonUser(User user)
setLogonUser
in interface FlashServletContext
user
- (User) The logon user.public FlashServletRequest getServletRequest()
getServletRequest
in interface FlashServletContext
public FlashServlet.Stack getServletStack()
getServletStack
in interface FlashServletContext
public Cart getShoppingCart()
getShoppingCart
in FlashServletContext
.getShoppingCart
in interface FlashServletContext
public SecurityProfile getShoppingProfile()
isShopping
) this will either be the
default user's security profile or the logon user's security profile.isSfiShopping
) this will be the
rep's security profile.isSfiSelect
) this will be
the rep's security profile.isSiteAdmin
) this will be the admin user's
security profile.null
.getShoppingProfile
in FlashServletContext
.getShoppingProfile
in interface FlashServletContext
public User getShoppingUser()
getShoppingUser
in FlashServletContext
.
isShopping
) returns the current
logon user (same as getLogonUser
).isSfiShopping
) returns the rep's
selected user.isSfiSelect
) returns
null
.isSiteAdmin
) returns null
.null
.getShoppingUser
in FlashServletContext
.getShoppingUser
in interface FlashServletContext
public SiteActivity getSiteActivity()
getSiteActivity
in FlashServletContext
.getSiteActivity
in interface FlashServletContext
public UnitMeasureHandler getUomHandler()
getUomHandler
in FlashServletContext
.getUomHandler
in interface FlashServletContext
public boolean isCustAdmin()
isCustAdmin
in FlashServletContext
.isCustAdmin
in interface FlashServletContext
true
if the logon user is a customer
administrator, otherwise false
.public boolean isDefaultUser()
isDefaultUser
in FlashServletContext
.isDefaultUser
in interface FlashServletContext
true
if the logon user is the default
user, otherwise false
.public boolean isLoggedOn()
isLoggedOn
in FlashServletContext
.isLoggedOn
in interface FlashServletContext
true
if a successful logon has occurred,
otherwise false
.public boolean isPermitActive()
Flash.PERMIT_ENABLED
and whether any shopping is currently
taking place.isPermitActive
in interface FlashServletContext
true
if permit processing is active,
otherwise false
.public boolean isRetail()
isRetail
in FlashServletContext
.isRetail
in interface FlashServletContext
true
if the site is for a retail store,
otherwise false
.public boolean isSfiSelect()
isSfiSelect
in FlashServletContext
.isSfiSelect
in interface FlashServletContext
true
if the logon user is a sales rep
user with no selected account, otherwise false
.public boolean isSfiShopping()
isSfiShopping
in FlashServletContext
.isSfiShopping
in interface FlashServletContext
true
if the logon user is a sales rep
user with a selected account, otherwise false
.public boolean isShopping()
isShopping
in FlashServletContext
.isShopping
in interface FlashServletContext
true
if the logon user is a basic shopping
user, otherwise false
.public boolean isSiteAdmin()
isSiteAdmin
in FlashServletContext
.isSiteAdmin
in interface FlashServletContext
true
if the logon user is a site
administrator, otherwise false
.public boolean isWholesale()
isWholesale
in FlashServletContext
.isWholesale
in interface FlashServletContext
true
if the site is for a wholesale store,
otherwise false
.public void freeDbConnection()