Class SignUpConfiguration
- java.lang.Object
-
- com.smartfoxserver.v2.components.signup.SignUpConfiguration
-
public class SignUpConfiguration extends java.lang.Object
Provides all the necessary settings for the SignUpAssistant Component- See Also:
SignUpAssistantComponent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SignUpConfiguration.EmailConfig
Configures the options related to sending an email response, after a successful user registration.static class
SignUpConfiguration.PasswordRecovery
Configures the Password Recovery feature of the SignUp Assistant.
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
activationCodeField
(Optional) The name of the field used to store the auto-generate activation code.int
activationCodeLength
(Optional) If the activationCodeField is used this property will indicate the length of the activation hash code.boolean
checkForDuplicateEmails
Checks that a user is not registering with an existing email address.boolean
checkForDuplicateUserNames
Checks that a user is not registering with an existing user name.IDBManager
customDbManager
(Optional) A custom Database Manager in case you don't want to use the default Zone's DB Manager.java.lang.String
emailField
The name of the field used to store the user's email.SignUpConfiguration.EmailConfig
emailResponse
Configure the automated email responsesjava.util.Map<SignUpErrorCodes,java.lang.String>
errorMessages
A map of customizable error messages associated with the the SignUpAssistant default error codes.java.util.List<java.lang.String>
extraFields
(Optional) A list of other field names to be stored in the user account.java.lang.String
idField
The name of the field used as the main table Id.boolean
isEmailRequired
Determines whether or not an email address is mandatory for signing up.boolean
logSQL
(Debug Only) logs every SQL query for testing / debugging purposes.int
maxEmailLength
Maximum length of the email field.int
maxPasswordLength
Maximum length of the user password.int
maxUserNameLength
Maximum length of the user name.int
minPasswordLength
Minimum length of the user password.int
minUserNameLength
Minimum length of the user name.java.lang.String
passwordField
The name of the field used to store the user password.PasswordMode
passwordMode
Indicates how the password should be stored in the databaseSignUpConfiguration.PasswordRecovery
passwordRecovery
Configures the Password Recovery serviceISignUpAssistantPlugin
postProcessPlugin
ADVANCEDISignUpAssistantPlugin
preProcessPlugin
ADVANCEDjava.lang.String
signUpTable
The name of the Database table used for storing the user registrations.java.lang.String
userIsActiveField
(Optional) If the activationCodeField is used this property will indicate which field to use to keep track of the User's account activation.java.lang.String
usernameField
The name of the field used to store the user name.
-
Constructor Summary
Constructors Constructor Description SignUpConfiguration()
-
-
-
Field Detail
-
errorMessages
public final java.util.Map<SignUpErrorCodes,java.lang.String> errorMessages
A map of customizable error messages associated with the the SignUpAssistant default error codes. Developers can customize their messages starting from the default templates provided.NOTE: It is important to maintain the same exact number of place holders ( %s ) in the translated messages so that parameters are correctly inserted at runtime. Failing to do this will cause unexpected runtime exceptions.
The CUSTOM_ERROR code can be used by pre/post process Plugins to throw custom errors.
Error code Default message MISSING_USERNAME User name is required USERNAME_TOO_SHORT User name is too short, min. amount of characters is %s USERNAME_TOO_LONG User name is too long, max. amount of characters is %s USERNAME_ALREADY_IN_USE Username: %s is already in use MISSING_PASSWORD Password is required PASSWORD_TOO_SHORT Password is too short, min. amount of characters is %s PASSWORD_TOO_LONG Password is too long, max. amount of characters is %s MISSING_EMAIL An email is required INVALID_EMAIL Email address: %s is invalid EMAIL_ALREADY_IN_USE Email address: %s is already in use RECOVER_NO_USER Password recovery error, username %s was not found ACTIVATION_NO_ID Invalid Activation. Session doesn't contain a database ID ACTIVATION_INVALID_CODE Invalid Activation Code received GENERIC_DB_ERROR Unexpected Database Error. Please contact our support CUSTOM_ERROR %s - See Also:
SignUpErrorCodes
-
customDbManager
public IDBManager customDbManager
(Optional) A custom Database Manager in case you don't want to use the default Zone's DB Manager.- See Also:
SFSDBManager
-
signUpTable
public java.lang.String signUpTable
The name of the Database table used for storing the user registrations. Default = 'users'
-
idField
public java.lang.String idField
The name of the field used as the main table Id. The field is expected to be an auto-increment Int or Long. Default = 'id'
-
usernameField
public java.lang.String usernameField
The name of the field used to store the user name. Default = 'username'
-
passwordField
public java.lang.String passwordField
The name of the field used to store the user password. Default = 'password'
-
emailField
public java.lang.String emailField
The name of the field used to store the user's email. Default = 'email'
-
passwordMode
public PasswordMode passwordMode
Indicates how the password should be stored in the database- See Also:
PasswordMode
-
activationCodeField
public java.lang.String activationCodeField
(Optional) The name of the field used to store the auto-generate activation code. Default = null.By setting this field the Activation process will generate a unique activation code that will be sent via email to the User. The client will be able to activate his account by providing the secret code. Without an activation the login will be forbidden.
See also: userIsActiveField
-
activationCodeLength
public int activationCodeLength
(Optional) If the activationCodeField is used this property will indicate the length of the activation hash code. Default length = 32- Since:
- SFS2X 2.13
-
userIsActiveField
public java.lang.String userIsActiveField
(Optional) If the activationCodeField is used this property will indicate which field to use to keep track of the User's account activation. The required database field must be of string type and will contain a Y or N character to indicate the state of the activation.
-
extraFields
public java.util.List<java.lang.String> extraFields
(Optional) A list of other field names to be stored in the user account. Default is nullSupposing you specify three extra fields called "Country", "Avatar" and "Language" you will need to send those parameters from the client by using the same field names as the keys of the SFSObject sent to the Extension.
-
preProcessPlugin
public ISignUpAssistantPlugin preProcessPlugin
ADVANCEDAllows developers to add and extra plugin class in the SignUp process to manipulate objects BEFORE the SignUp data is verified and stored in the database. This can be useful to add custom validations for extra fields or enforcing other signup rules.
Default is null (no pre-processing is done)
- See Also:
ISignUpAssistantPlugin
-
postProcessPlugin
public ISignUpAssistantPlugin postProcessPlugin
ADVANCEDAllows developers to add and extra plugin class in the SignUp process to manipulate objects AFTER the SignUo data has been stored and before the client email is sent. This can be useful to add customizations to the email text or add extra parameters to the client's response object.
Default is null (no post-processing is done)
- See Also:
ISignUpAssistantPlugin
-
checkForDuplicateUserNames
public boolean checkForDuplicateUserNames
Checks that a user is not registering with an existing user name. Default = true
-
checkForDuplicateEmails
public boolean checkForDuplicateEmails
Checks that a user is not registering with an existing email address. Default = true
-
isEmailRequired
public boolean isEmailRequired
Determines whether or not an email address is mandatory for signing up. Default = true
-
emailResponse
public SignUpConfiguration.EmailConfig emailResponse
Configure the automated email responses- See Also:
SignUpConfiguration.EmailConfig
-
minUserNameLength
public int minUserNameLength
Minimum length of the user name. Default = 4 characters
-
maxUserNameLength
public int maxUserNameLength
Maximum length of the user name. Default = 30 characters
-
minPasswordLength
public int minPasswordLength
Minimum length of the user password. Default = 6 characters
-
maxPasswordLength
public int maxPasswordLength
Maximum length of the user password. Default = 30 characters
-
maxEmailLength
public int maxEmailLength
Maximum length of the email field. Default = 50 characters
-
logSQL
public boolean logSQL
(Debug Only) logs every SQL query for testing / debugging purposes. Never leave this turned on in production. Default = false
-
passwordRecovery
public SignUpConfiguration.PasswordRecovery passwordRecovery
Configures the Password Recovery service- See Also:
SignUpConfiguration.PasswordRecovery
-
-