Package com.iizix.license
Interface IGenericLicenseSystem
- All Superinterfaces:
IBasicUserInfoDetailNames
- All Known Subinterfaces:
IAppBuilderLicenseSystem
,IDesignerLicenseSystem
,IServerLicenseSystem
The generic license system interface.
- Author:
- Christopher Mindus
Field Summary
Fields inherited from interface com.iizix.user.IBasicUserInfoDetailNames
DETAIL_AdditionalEmail, DETAIL_Address, DETAIL_Address_2, DETAIL_Address_3, DETAIL_City, DETAIL_CompanyDivision, DETAIL_CompanyName, DETAIL_Country, DETAIL_CroppedUploadedProfileImage, DETAIL_DBAdministrationUserName, DETAIL_DeveloperGroupID, DETAIL_DeveloperID, DETAIL_Email, DETAIL_EmailVerify, DETAIL_FirstName, DETAIL_FixedPassword, DETAIL_FullName, DETAIL_HomeFax, DETAIL_HomeMobile, DETAIL_HomePhone, DETAIL_JobTitle, DETAIL_LargeProfileImage, DETAIL_LastName, DETAIL_LocalizedFirstName, DETAIL_LocalizedFullName, DETAIL_LocalizedLastName, DETAIL_LocalizedMiddleName, DETAIL_LocalizedTitle, DETAIL_MiddleName, DETAIL_Phone, DETAIL_Phone_2, DETAIL_PinCode, DETAIL_RecoveryAnswer, DETAIL_RecoveryQuestion, DETAIL_StateProvince, DETAIL_ThumbnailProfileImage, DETAIL_Title, DETAIL_UploadedProfileImage, DETAIL_UploadedProfileImageCrop, DETAIL_WorkFax, DETAIL_WorkMobile, DETAIL_WorkPhone, DETAIL_ZipCode, detailsSet, profilePictureDetailsList
Method Summary
Modifier and TypeMethodDescriptionactivate
(GenericCallback<Void, String> callback) Activates the license.boolean
addListener
(ILicenseServerListener listener) Adds a dispose listener for license server communication.void
assignCallback
(ILicenseCallback callback) Assigns the callback for major failures.void
assignFeedBack
(IUserInterfaceFeedback<ValidateReply> feedback) Assigns the validation feedback (UI).completeRegistration
(GenericCallback<Void, String> callback) Completes the registration.void
dispose()
Disposes of the license system.extendTrial
(GenericCallback<Void, String> callback) Requests an additional 7 days extension for the trial.Gets the database administrator user name used when creating the license.Gets the DETAIL_* map.Gets the unique installation ID.default ProfilePicture
Gets the "uploaded" profile picture.getProfilePicture
(String type) Gets the profile picture.getSignature
(Object which) Returns the license system signature.Gets the signed in user.long
Gets the trial duration.long
Gets the trial extension time in milliseconds.long
Gets the trial started time.long[]
In case there is a time period the license is valid, this method returns the beginning (including) and ending time (excluding) in milliseconds since the epoch.boolean
initialize
(PropFactory serverFactory, Object caller, Object signature, Object which, File dir) Initializes the license system.boolean
Returns the connection state to the license server.boolean
Returns if the installation is in trial mode.void
performOfflineRegistration
(Map<String, String> offLineDetails, Object caller) Performs offline registration.void
preClose()
Requests disconnection from the license server, this will end when no more communication tasks in progress, and there are no pending open requests throughpreOpen()
.void
preOpen()
Opens connection to license server in order to be fast in response later on...boolean
removeListener
(ILicenseServerListener listener) Removes a dispose listener for the client session.boolean
Removes all the profile pictures.requestEmailVerification
(String email, GenericCallback<Void, String> callback) Requests to send an email to verify the email.resetPassword
(String email, GenericCallback<Void, String> callback) Resets the password for a user by sending a mail.void
save()
Saves the license file.boolean
setProfilePicture
(ProfilePicture profilePicture) Sets a profile picture.boolean
setRecoveryEmail
(String recoveryEmail) Adds, removes or changes the additional email for recovery.signIn
(String email, String password, String newPassword, BiFunction<SigninResult, String, Void> callback) Sign in user.boolean
signOut()
Signs out of the License System.signUp
(String email, String password, Map<String, String> details, GenericCallback<Void, String> callback) Sign up user.validate()
Validates the license.verifyEmailCode
(String email, String code, GenericCallback<Void, String> callback) Verifies a code for an email sent to the user.verifyEmailTaken
(String email, GenericCallback<Void, String> callback) Verifies if an email is taken for sign in.
Method Details
initialize
boolean initialize(PropFactory serverFactory, Object caller, Object signature, Object which, File dir) Initializes the license system.- Parameters:
serverFactory
- The server factory.caller
- The licensed caller instance.signature
- The signature.which
- Which signature is specified.dir
- Directory where to store data.- Returns:
- true for success, false if the license fails initialization and requires shut-down of the caller.
dispose
void dispose()Disposes of the license system.assignCallback
Assigns the callback for major failures.- Parameters:
callback
- The failure callback.
assignFeedBack
Assigns the validation feedback (UI).- Parameters:
feedback
- The feedback to a potential UI.
getSignature
Returns the license system signature.- Parameters:
which
- Which signature to return.- Returns:
- The signature.
save
Saves the license file. If the license system has not been initialized, nothing will happen.- Throws:
LicenseException
- If the file failed to be saved.
completeRegistration
Completes the registration.- Parameters:
callback
- The callback with the response String parameter: null for OK, otherwise the message string.- Returns:
- An immediate error message, or null for callback to be invoked later.
- Throws:
LicenseException
- For License System errors.
isConnected
boolean isConnected()Returns the connection state to the license server.- Returns:
- true if connected to the license server, false otherwise.
preOpen
void preOpen()Opens connection to license server in order to be fast in response later on... Multiple calls to this method can be done, must each call MUST be followed bypreClose()
, otherwise the communication link to the license server will remain open.preClose
void preClose()Requests disconnection from the license server, this will end when no more communication tasks in progress, and there are no pending open requests throughpreOpen()
.addListener
Adds a dispose listener for license server communication. Calling this method multiple times with the same listener will have no effect (but to return false).- Parameters:
listener
- The listener to add.- Returns:
- true if the listener was added, false otherwise.
- Throws:
NullPointerException
- If the listener isnull
.
removeListener
Removes a dispose listener for the client session.- Parameters:
listener
- The listener to remove.- Returns:
- true if listener is successfully removed, false otherwise.
validate
ValidateReply validate()Validates the license.- Returns:
- The validation result, never null.
getInstallationID
String getInstallationID()Gets the unique installation ID. This installation ID is dependent on the installation location, the hardware it is installed on, etc. Each developer ID is allowed to have up to 10 such installations. There are functions to remove registered installations in the IIZI License App.- Returns:
- An installation ID that is unique for each IIZI installation, even on the same machine.
getDetails
Gets the DETAIL_* map.See the DETAIL_* values in
IBasicUserInfoDetailNames
.- Returns:
- A new map, or null if license file is not loaded.
getValidityPeriod
long[] getValidityPeriod()In case there is a time period the license is valid, this method returns the beginning (including) and ending time (excluding) in milliseconds since the epoch.In case there is no beginning or ending set, the array consists of a
zero
entry. If there is no time period limitation at all, this method returns an array with of size 2 with zero's.- Returns:
- The time limitation as an array, index 0 (zero) is the start of the period (inclusive). If
zero
there is no start period specified. The index 1 (one) is the end of the period (exclusive), and set to zero, there is no end period.
isTrialMode
boolean isTrialMode()Returns if the installation is in trial mode.- Returns:
- true if in trial mode, false if it has been registered and no longer in trial mode.
Note: "Trial Mode" may still remain if this is a paid subscription, even if registered.
getTrialDuration
long getTrialDuration()Gets the trial duration.- Returns:
- The trial duration in milliseconds, -1L for no trial!
getTrialStarted
long getTrialStarted()Gets the trial started time.- Returns:
- The trial start in milliseconds since the epoch, -1L for no trial!
getTrialExtension
long getTrialExtension()Gets the trial extension time in milliseconds.- Returns:
- The trial extension time in milliseconds, zero for none.
signIn
String signIn(String email, String password, String newPassword, BiFunction<SigninResult, String, Void> callback) Sign in user. The details for the user replaces the current settings in the license file if sign in is successful (once the password has been changed if that was required).- Parameters:
email
- The email string (lower case, trimmed).password
- The password (the password is not sent in the clear, event using TLS).newPassword
- New password for user once validated, null for no change.callback
- The callback with the responseSigninResult
and a String for error, null String for success.- Returns:
- null for OK, otherwise an error string.
- Throws:
NullPointerException
- If any of the parameters are null.
resetPassword
String resetPassword(String email, GenericCallback<Void, String> callback) throws NullPointerExceptionResets the password for a user by sending a mail.- Parameters:
email
- The email string (lower case, trimmed).callback
- The callback with the response String parameter: null for OK, otherwise the message string.- Returns:
- null for OK, otherwise an error string.
- Throws:
NullPointerException
- If any of the parameters are null.
signUp
String signUp(String email, String password, Map<String, String> details, GenericCallback<Void, throws NullPointerExceptionString> callback) Sign up user.- Parameters:
email
- The email string (lower case, trimmed).password
- The password (the password is not sent in the clear, event using TLS).details
- Details for the user according to standard ofcom.iizix.server.db.BasicUserInfo
.callback
- The callback with the response String parameter: null for OK, otherwise the message string.- Returns:
- null for OK, otherwise an error string.
- Throws:
NullPointerException
- If any of the parameters are null.
performOfflineRegistration
Performs offline registration.- Parameters:
offLineDetails
- The details for offline registration.caller
- The caller.- Throws:
IllegalArgumentException
- If details and caller do not match, or the license system is online.SecurityException
- If called from wrong party.
activate
Activates the license.- Parameters:
callback
- The callback for the activation result. The String in the callback argument is null for success, or an error message.- Returns:
- null for OK, empty string for no need for activation, otherwise an error string. The callback will be invoked only if the return code is null.
extendTrial
Requests an additional 7 days extension for the trial.- Parameters:
callback
- The callback for the activation result. The String in the callback argument is null for success, or an error message.- Returns:
- null for OK, empty string for no need for trial extension, otherwise an error string. The callback will be invoked only if the return code is null.
getSignedInUser
String getSignedInUser()Gets the signed in user.- Returns:
- The user that is signed in, or null if nobody is signed in.
signOut
boolean signOut()Signs out of the License System.- Returns:
- true for success, false if no user is logged in.
setRecoveryEmail
Adds, removes or changes the additional email for recovery. This routine also handles email verification requirements to the license server.- Parameters:
recoveryEmail
- The new or updated recovery email address, null to remove it.- Returns:
- true for success, false for no change.
verifyEmailTaken
Verifies if an email is taken for sign in.- Parameters:
email
- The email string (lower case, trimmed).callback
- The callback with the response String parameter: null for OK, otherwise the message string.- Returns:
- null for OK, otherwise an error string.
- Throws:
NullPointerException
- If any of the parameters are null.
requestEmailVerification
Requests to send an email to verify the email.- Parameters:
email
- The email string (lower case, trimmed).callback
- The callback with the response String parameter: null for OK, otherwise the message string.- Returns:
- null for OK, otherwise an error string.
- Throws:
NullPointerException
- If any of the parameters are null.
verifyEmailCode
Verifies a code for an email sent to the user.- Parameters:
email
- The email string (lower case, trimmed).code
- The code from the email verification mail.callback
- The callback with the response String parameter: null for OK, otherwise the message string.- Returns:
- null for OK, otherwise an error string.
- Throws:
NullPointerException
- If any of the parameters are null.
removeProfilePictures
boolean removeProfilePictures()Removes all the profile pictures.- Returns:
- true for changed, false for no change.
getProfilePicture
Gets the "uploaded" profile picture. It is up to the caller to clean-up potential temporary directory and/or file.- Returns:
- The profile picture instance, or null if none is present.
getProfilePicture
Gets the profile picture. It is up to the caller to clean-up potential temporary directory and/or file.- Parameters:
type
- The type of image: DETAIL_UploadedProfileImage, DETAIL_LargeProfileImage, DETAIL_ThumbnailProfileImage, or null for the largest available.- Returns:
- The profile picture instance, or null if none is present.
- Throws:
IllegalArgumentException
- Iftype
is notIBasicUserInfoDetailNames.DETAIL_UploadedProfileImage
ornull
,IBasicUserInfoDetailNames.DETAIL_LargeProfileImage
; orIBasicUserInfoDetailNames.DETAIL_ThumbnailProfileImage
.
setProfilePicture
Sets a profile picture.- Parameters:
profilePicture
- The profile picture to set.- Returns:
- true for changed, false for no change.
getDatabaseAdministratorUser
String getDatabaseAdministratorUser()Gets the database administrator user name used when creating the license.- Returns:
- The database administrator user name, or null if none is available.