Package org.cyclos.impl.users
Interface PhoneServiceLocal
-
- All Superinterfaces:
CRUDService<PhoneDTO,PhoneData,PhoneDataParams>,CRUDServiceLocal<Phone,PhoneDTO,PhoneData,PhoneDataParams>,CRUDWithConfirmationPasswordService<PhoneDTO,PhoneData,PhoneDataParams>,PhoneService,Service
- All Known Implementing Classes:
PhoneServiceImpl
public interface PhoneServiceLocal extends PhoneService, CRUDServiceLocal<Phone,PhoneDTO,PhoneData,PhoneDataParams>
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_EXTENSION_LENGTHMaximum land-line phone extension length
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PhonegetDefaultPhone(BasicUser user)Returns the default phone for this userPhonegetDefaultPhone(PhoneNature type, User user)Returns the default phone (landline or mobile) for the given user, or null if none foundStringgetExampleNumber(PhoneNature nature)Returns an example number for the given phone naturePhoneListDatagetPhoneListData(BasicUser user)Returns data containing all phones belonging to the given userValidatorgetValidator(PhoneDTO dto, BasicUser user)Returns the validator for the given phone and owner userbooleanisVerificationCodeSentAndNotExpired(MobilePhone mobile)Returns whether there is a valid verification code sent for the given mobile phoneList<Phone>listByUser(BasicUser user, PhoneNature nature)Returns the phones of the given user filtered by nature if not null.List<MobilePhone>listEnabledPhonesForSmsNotification(BasicUser user, boolean includeOperators)Returns all phones that should be used for SMS notifications.PhoneloadByRawNumber(User user, String rawNumber)Loads a given user's number by its raw numbervoidmarkVerified(MobilePhone phone)Marks a phone as verified WARN: This method doesn't keep trace of failed actionsStringnormalizeNumber(ConfigurationAccessor configuration, String rawNumber)Normalizes a phone number for the given configuration, returning null when not a valid numbervoidremoveAll(BasicUser basicUser)Removes all phones of the given uservoidverifyAndEnableForSms(MobilePhone phone)Marks the given phone as verified and enabled for SMS-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
Methods inherited from interface org.cyclos.impl.CRUDServiceLocal
find, findAll, getEntityClass, newEntity, remove, removeAll, saveEntity, saveSkippingEntityLog, toDTO, toEntity, validate
-
Methods inherited from interface org.cyclos.services.CRUDWithConfirmationPasswordService
getConfirmationPasswordInputForRemove, removeAllWithConfirmationPassword, removeWithConfirmationPassword, saveWithConfirmationPassword
-
Methods inherited from interface org.cyclos.services.users.PhoneService
disableForSms, enableForSms, getConfirmationPasswordInputForDisableSms, getPhoneListData, loadByNumber, sendVerificationCode, verify
-
-
-
-
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(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
-
-