public class UserCatalogVerifier extends DBUHandler
Modifier and Type | Field and Description |
---|---|
private UserCatalog |
ivCatalog
The catalog of products and categories used during verification.
|
private java.lang.String[] |
ivCategories
A string array of the category codes in the user's catalog.
|
private static long |
serialVersionUID
The class' serialization version id.
|
ivContext
Constructor and Description |
---|
UserCatalogVerifier()
Constructs a new instance of the user catalog verifier with a
null
servlet or thread context. |
Modifier and Type | Method and Description |
---|---|
boolean |
isProductInCatalog(Product product)
Answers if a product is in the user's catalog and, if permit processing
is active, determines if the product is in the user's set of permits.
|
boolean |
isProductInCatalog(java.lang.String prodcode)
Answers if a product is in the user's catalog and, if permit processing
is active, determines if the product is in the user's set of permits.
|
boolean |
isProductInCatalog(java.lang.String prodcode,
java.lang.String uomcode)
Answers if a product is in the user's catalog and, if permit processing
is active, determines if the product is in the user's set of permits.
|
boolean |
isProductInCategory(Product product,
java.lang.String catcode)
Answers if a product is in the user's catalog and in the given category
within the catalog and, if permit processing is active, determines if the
product is in the user's set of permits.
|
boolean |
isProductInCategory(java.lang.String prodcode,
java.lang.String uomcode,
java.lang.String catcode)
Answers if a product is in the user's catalog and in the given category
within the catalog and, if permit processing is active, determines if the
product is in the user's set of permits.
|
private void |
loadCategories()
Loads the
ivCategories instance variable with the category
codes in the user's catalog. |
void |
setContext(FlashServletContext ctx)
Sets the class' servlet context (i.e.
|
void |
verifyCartLines(Cart cart)
Verifies that each product within the given cart's set of cart lines is in
the user's catalog and/or in the user's set of permits.
|
java.util.ArrayList<Product> |
verifyProducts(java.util.ArrayList<Product> products)
Verifies that each product within the given collection of products is in the
user's catalog and/or in the user's set of permits and returns a collection
that contains only the products that pass the verification.
|
getContext
private static final long serialVersionUID
private UserCatalog ivCatalog
private java.lang.String[] ivCategories
public UserCatalogVerifier()
null
servlet or thread context.
A CONTEXT MUST BE SET BEFORE INVOKING ANY OTHER METHODS.
.public void setContext(FlashServletContext ctx)
setContext
in DBUHandler
.setContext
in interface DBUInterface
setContext
in class DBUHandler
ctx
- (FlashServletContext) The current servlet or thread context.public boolean isProductInCatalog(Product product)
product
- (Product) The product to verify.true
if the product is a valid product
in the user's catalog and/or in the user's set of permits,
otherwise false
.public boolean isProductInCatalog(java.lang.String prodcode)
prodcode
- (String) The product code to verify.true
if the product is a valid product
in the user's catalog and/or in the user's set of permits,
otherwise false
.public boolean isProductInCatalog(java.lang.String prodcode, java.lang.String uomcode)
prodcode
- (String) The product code to verify.uomcode
- (String) The unit of measure code to verify.true
if the product is a valid product
in the user's catalog and/or in the user's set of permits,
otherwise false
.public boolean isProductInCategory(Product product, java.lang.String catcode)
product
- (Product) The product to verify.catcode
- (String) The category code to verify.true
if the product is a valid product
in the user's catalog and/or in the user's set of permits,
otherwise false
.public boolean isProductInCategory(java.lang.String prodcode, java.lang.String uomcode, java.lang.String catcode)
prodcode
- (String) The product code to verify.uomcode
- (String) The unit of measure code to verify.catcode
- (String) The category code to verify.true
if the product is a valid product
in the user's catalog and/or in the user's set of permits,
otherwise false
.private void loadCategories()
ivCategories
instance variable with the category
codes in the user's catalog.public void verifyCartLines(Cart cart)
cart
- (Cart) The cart (shopping cart or favorite items) that owns
the cart lines that are to be verified.public java.util.ArrayList<Product> verifyProducts(java.util.ArrayList<Product> products)
products
- (ArrayList) The set of products to be verified.