Package org.cyclos.services.access
Interface PinService
-
- All Superinterfaces:
Service
- All Known Subinterfaces:
PinServiceLocal
- All Known Implementing Classes:
PinServiceImpl,PinServiceSecurity
public interface PinService extends Service
Service interface for device pins.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UserPinsDatagetData(UserLocatorVO locator)Returns data regarding pins for the given user (null resolves to the logged user).PinDatagetEditData(PinLocatorVO locator)Returns data for editing a pin.PasswordInputDTOgetPasswordInputForCreate()Return the password input required to create a pin for the logged user.List<PinVO>list(UserLocatorVO locator)Returns the list of device pins for the given user (null resolves to the logged user).
Manager users must have thePermission.USER_PINS_VIEWpermission.PinDetailedVOlocate(PinLocatorVO locator)Locates a device pin, either by id or principal.voidremove(PinLocatorVO locator, CurrentCredentialsForPinManage currentCredentials)Removes the given pin.voidsave(@NotNull PinDTO dto)Updates a given device pin for the logged user.CreatePinDTOset(@NotNull SetPinParams params)Creates a new pin or modify an existing for the logged user and associates it to the current principal type and password type.ValidationResultvalidate(@NotNull String value)Validates a value to be used as a pin for the logged user and the current channel.
-
-
-
Method Detail
-
getData
UserPinsData getData(UserLocatorVO locator) throws FrameworkException
Returns data regarding pins for the given user (null resolves to the logged user).- Throws:
FrameworkException
-
getEditData
PinData getEditData(PinLocatorVO locator) throws FrameworkException
Returns data for editing a pin.- Parameters:
locator- Optional if authenticated with a pin. Otherwise it must not be null.- Throws:
FrameworkException
-
getPasswordInputForCreate
PasswordInputDTO getPasswordInputForCreate() throws FrameworkException
Return the password input required to create a pin for the logged user.- Throws:
FrameworkException
-
list
List<PinVO> list(UserLocatorVO locator) throws FrameworkException
Returns the list of device pins for the given user (null resolves to the logged user).
Manager users must have thePermission.USER_PINS_VIEWpermission.- Throws:
FrameworkException
-
locate
PinDetailedVO locate(PinLocatorVO locator)
Locates a device pin, either by id or principal. For users other than the pin's owner (admin / brokers) thePermission.USER_PINS_VIEWpermission must be granted- Parameters:
locator- Optional if authenticated with a pin. Otherwise it must not be null.
-
remove
void remove(PinLocatorVO locator, CurrentCredentialsForPinManage currentCredentials) throws FrameworkException
Removes the given pin. For managers (admin / brokers) thePermission.USER_PINS_MANAGEpermission must be granted. For the pin owner the action must be confirmed with the current login password for the current channel or the current pin. Only one of these is mandatory to be given.- Parameters:
locator- Optional if authenticated with a pin. Otherwise it must not be null.- Throws:
FrameworkException
-
save
void save(@NotNull @NotNull PinDTO dto) throws FrameworkExceptionUpdates a given device pin for the logged user. It will be used from the mobile in the settings page. The given pin's name must be unique, otherwise it throws aValidationException- Throws:
FrameworkException
-
set
CreatePinDTO set(@NotNull @NotNull SetPinParams params) throws FrameworkException
Creates a new pin or modify an existing for the logged user and associates it to the current principal type and password type. The result will contain the generated principal and a salt that must be prepended to the pin entered by the user when login. In case of a modification the current pin or login password must be given.- Throws:
FrameworkException
-
validate
ValidationResult validate(@NotNull @NotNull String value) throws FrameworkException
Validates a value to be used as a pin for the logged user and the current channel.- Returns:
- null if the value is valid. Otherwise return the validation error.
- Throws:
FrameworkException
-
-