public class UserImport extends Import<User>
NOTE: A single instance of this class is cached by ImportProcessor
and used throughout the import processing.
Modifier and Type | Field and Description |
---|---|
private Customer |
ivCustomer
The current customer.
|
private User |
ivDefaultUser
The default user (User.DEFAULT_USER)
|
private boolean |
ivEmailAcctInfo
A flag indicating if emailing account info is active.
|
private AccountEmailHandler |
ivEmailHandler
An instance of the account info email handler.
|
private boolean |
ivExtendedInfo
A flag indicating if contact extended info is active.
|
private FavoritesDescriptor |
ivFavoritesDesc
A favorites descriptor object.
|
private java.util.ArrayList<FavoritesDescriptor> |
ivFavoritesDescs
A cache of all favorites descriptors.
|
private int |
ivIdMaxLen
The configured logon id maximum length.
|
private int |
ivIdMinLen
The configured logon id minimum length.
|
private int |
ivPwdMaxLen
The configured password maximum length.
|
private int |
ivPwdMinLen
The configured password minimum length.
|
private SecurityProfile |
ivSecurityProfile
A security profile object.
|
private java.util.ArrayList<SecurityProfile> |
ivSecurityProfiles
A cache of all security profiles.
|
private Customer |
ivShipto
The current ship-to customer.
|
private static long |
serialVersionUID
The class' serialization version id.
|
ACTION_ADD, ACTION_CLEAR, ACTION_DELETE, ACTION_UPDATE, ACTION_UPDATE_ADD, ivContext, ivLineNo, ivNumFields, ivObject, ivStarAll, ivTextLine, ivUseMixedCase, ivValues
Constructor and Description |
---|
UserImport()
Constructs a new user import class.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
addRecord()
Adds a new record to the Flash database.
|
protected boolean |
deleteRecord()
Deletes an existing record from the Flash database.
|
private void |
emailAccountInfo(User user)
Sends an email notification containing account info to the given user.
|
void |
housekeeping()
Garbage collection: Kills (nullifies) objects used by the import class.
|
boolean |
importData(int action,
java.util.ArrayList<java.lang.String> data,
int lineNo)
Imports a record of data values into the Flash database.
|
void |
setContext(FlashServletContext ctx)
Sets the import object's servlet context (i.e.
|
protected boolean |
updateRecord()
Updates an existing record in the Flash database.
|
private boolean |
validChanges()
Answers if the results of changing various fields are valid.
|
private boolean |
validCustomer(java.lang.String id,
boolean shipto)
Answers if a customer exists in the Flash database.
|
private boolean |
validFavoritesDescriptor(java.lang.String id)
Answers if a favorites descriptor exists in the Flash database.
|
protected boolean |
validForAdd()
Answers if appropriate data has been supplied in order to add a record
to the Flash database.
|
protected boolean |
validForDelete()
Answers if appropriate data has been supplied in order to delete a record
in the Flash database.
|
protected boolean |
validForUpdate()
Answers if appropriate data has been supplied in order to update a record
in the Flash database.
|
private boolean |
validPhone(java.lang.String phone,
java.lang.String desc,
java.lang.String setnum)
Answers if a phone number and phone description combination are valid.
|
private boolean |
validSecurityProfile(java.lang.String code)
Answers if a security profile exists in the Flash database.
|
getContext, getMixedCase, getNumFields, getProperty, getTrueAction, isDecimal, isInteger, isStarAll, isTrue, log, log, qualifyKey, qualifyMsgId, setTextLine
private static final long serialVersionUID
private int ivIdMinLen
private int ivIdMaxLen
private int ivPwdMinLen
private int ivPwdMaxLen
private boolean ivExtendedInfo
private boolean ivEmailAcctInfo
private AccountEmailHandler ivEmailHandler
private User ivDefaultUser
private FavoritesDescriptor ivFavoritesDesc
private java.util.ArrayList<FavoritesDescriptor> ivFavoritesDescs
private SecurityProfile ivSecurityProfile
private java.util.ArrayList<SecurityProfile> ivSecurityProfiles
private Customer ivCustomer
private Customer ivShipto
public void setContext(FlashServletContext ctx)
setContext
in Import
.setContext
in class Import<User>
ctx
- (FlashServletContext) The current servlet or thread context.public void housekeeping()
housekeeping
in Import
.housekeeping
in class Import<User>
public boolean importData(int action, java.util.ArrayList<java.lang.String> data, int lineNo)
importData
in Import
.importData
in class Import<User>
action
- (int) The action code (i.e. add, update, delete).data
- (ArrayList) The set of data values to be imported. Each
element corresponds to a field in the original text line.lineNo
- (int) The current line number being processedtrue
if the import of data was successful,
otherwise false
.protected boolean addRecord()
addRecord
in Import
.protected boolean deleteRecord()
deleteRecord
in Import
.deleteRecord
in class Import<User>
true
if the delete was successful,
otherwise false
.protected boolean updateRecord()
updateRecord
in Import
.updateRecord
in class Import<User>
true
if the update was successful,
otherwise false
.protected boolean validForAdd()
validForAdd
in Import
.validForAdd
in class Import<User>
true
if appropriate data has been supplied,
otherwise false
.protected boolean validForDelete()
validForDelete
in Import
.validForDelete
in class Import<User>
true
if appropriate data has been supplied,
otherwise false
.protected boolean validForUpdate()
validForUpdate
in Import
.validForUpdate
in class Import<User>
true
if appropriate data has been supplied,
otherwise false
.private boolean validChanges()
updateRecord
after all changed fields have been applied to the
user being updated (but before update actually occurs).true
if the change results are valid,
otherwise false
.private boolean validCustomer(java.lang.String id, boolean shipto)
id
- (String) The customer id for the customer to check.shipto
- (boolean) true
if the customer being checked is
a ship-to, otherwise false
.true
if the customer exists in the database,
otherwise false
.private boolean validFavoritesDescriptor(java.lang.String id)
id
- (String) The id for the favorites descriptor to check.true
if the favorites descriptor exists in the
database, otherwise false
.private boolean validPhone(java.lang.String phone, java.lang.String desc, java.lang.String setnum)
phone
- (String) The phone number to check.desc
- (String) The phone description to check.setnum
- (String) The set of phone fields being checked (1-4).true
if the field combination is valid,
otherwise false
.private boolean validSecurityProfile(java.lang.String code)
code
- (String) The code for the security profile to check.true
if the security profile exists in the
database, otherwise false
.private void emailAccountInfo(User user)
user
- (User) The user the email is to be sent to.