Interface IGenericLicenseSystem

All Superinterfaces:
IBasicUserInfoDetailNames
All Known Subinterfaces:
IAppBuilderLicenseSystem, IDesignerLicenseSystem, IServerLicenseSystem

public interface IGenericLicenseSystem extends IBasicUserInfoDetailNames
The generic license system interface.
Author:
Christopher Mindus
  • 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.
      which - Which signature is specified.
      signature - The signature.
      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

      void assignCallback(ILicenseCallback callback)
      Assigns the callback for major failures.
      Parameters:
      callback - The failure callback.
    • assignFeedBack

      void assignFeedBack(IUserInterfaceFeedback<ValidateReply> feedback)
      Assigns the validation feedback (UI).
      Parameters:
      feedback - The feedback to a potential UI.
    • getSignature

      Object getSignature(Object which)
      Returns the license system signature.
      Parameters:
      which - Which signature to return.
      Returns:
      The signature.
    • save

      void save() throws LicenseException
      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

      String completeRegistration(GenericCallback<Void,String> callback) throws LicenseException
      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 by preClose(), 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 through preOpen().
    • addListener

      boolean addListener(ILicenseServerListener listener)
      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 is null.
    • removeListener

      boolean removeListener(ILicenseServerListener listener)
      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

      Map<String,String> 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 response SigninResult 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 NullPointerException
      Resets 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,String> callback) throws NullPointerException
      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 of com.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

      void performOfflineRegistration(Map<String,String> offLineDetails, Object caller)
      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

      String activate(GenericCallback<Void,String> callback)
      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

      String extendTrial(GenericCallback<Void,String> callback)
      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

      boolean setRecoveryEmail(String recoveryEmail)
      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

      String verifyEmailTaken(String email, GenericCallback<Void,String> callback)
      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

      String requestEmailVerification(String email, GenericCallback<Void,String> callback)
      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

      String verifyEmailCode(String email, String code, GenericCallback<Void,String> callback)
      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

      default ProfilePicture 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

      ProfilePicture getProfilePicture(String type)
      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 - If type is not
      IBasicUserInfoDetailNames.DETAIL_UploadedProfileImage or null,
      IBasicUserInfoDetailNames.DETAIL_LargeProfileImage; or
      IBasicUserInfoDetailNames.DETAIL_ThumbnailProfileImage.
    • setProfilePicture

      boolean setProfilePicture(ProfilePicture profilePicture)
      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.