Interface PhoneServiceLocal

    • Field Detail

      • MAX_EXTENSION_LENGTH

        static final int MAX_EXTENSION_LENGTH
        Maximum land-line phone extension length
        See Also:
        Constant Field Values
    • Method Detail

      • getDefaultPhone

        Phone getDefaultPhone​(BasicUser user)
        Returns the default phone for this user
      • getDefaultPhone

        Phone getDefaultPhone​(PhoneNature type,
                              User user)
        Returns the default phone (landline or mobile) for the given user, or null if none found
      • getExampleNumber

        String getExampleNumber​(PhoneNature nature)
        Returns an example number for the given phone nature
      • getPhoneListData

        PhoneListData getPhoneListData​(BasicUser user)
        Returns data containing all phones belonging to the given user
      • getValidator

        Validator getValidator​(PhoneDTO dto,
                               BasicUser user)
        Returns the validator for the given phone and owner user
      • isVerificationCodeSentAndNotExpired

        boolean isVerificationCodeSentAndNotExpired​(MobilePhone mobile)
        Returns whether there is a valid verification code sent for the given mobile phone
      • listByUser

        List<Phone> listByUser​(BasicUser user,
                               PhoneNature nature)
        Returns the phones of the given user filtered by nature if not null. If the current user manages the given user, hidden phones are returned
      • listEnabledPhonesForSmsNotification

        List<MobilePhone> listEnabledPhonesForSmsNotification​(BasicUser user,
                                                              boolean includeOperators)
        Returns all phones that should be used for SMS notifications. If the includeOperators flag is true, also includes any alias-operator phones which are enabled for SMS.
      • loadByRawNumber

        Phone loadByRawNumber​(User user,
                              String rawNumber)
        Loads a given user's number by its raw number
      • markVerified

        void markVerified​(MobilePhone phone)
        Marks a phone as verified WARN: This method doesn't keep trace of failed actions
      • normalizeNumber

        String normalizeNumber​(ConfigurationAccessor configuration,
                               String rawNumber)
        Normalizes a phone number for the given configuration, returning null when not a valid number
      • removeAll

        void removeAll​(BasicUser basicUser)
        Removes all phones of the given user
      • verifyAndEnableForSms

        void verifyAndEnableForSms​(MobilePhone phone)
        Marks the given phone as verified and enabled for SMS