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

      • count

        int count​(BasicUser user,
                  PhoneNature nature)
        Count the phones of the given user (hidden or not) filtered by nature if not null.
      • counters

        Map<PhoneNature,​Integer> counters​(BasicUser user)
        Same as count(BasicUser, PhoneNature) but returning a map with the counters per nature. The returned map will have a key for each phone nature, in case the user doesn't have phones for a nature then, the map will contain an entry for it with 0 as the associated value.
      • findByNumber

        MobilePhone findByNumber​(String number)
        Finds a mobile phone by number
      • 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
      • 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
      • listByUser

        List<Phone> listByUser​(@NotNull
                               @NotNull BasicUser user,
                               PhoneNature nature)
        Returns the phones of the given user filtered by nature if not null. If the logged user can not view hidden profile fields then only visible phone 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
      • 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