Package org.openiam.srvc.device
Interface DeviceDataWebService
-
- All Known Implementing Classes:
DeviceDataWebServiceImpl
public interface DeviceDataWebService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcountDevicesByUserId(String userId)DeviceResponsecreate(DeviceDTO deviceDTO)Responsedelete(String id)ResponsedeleteByUserId(String userId)Responsedisable(String deviceId)Responseenable(String deviceId)List<DeviceDTO>getActiveDevicesByUserId(String userId)retrieve active devices that are owned by given userDeviceDTOgetById(String id)StringResponsegetDecryptedDeviceToken(String deviceId)method is used to get decrypted device token to use it for notification sending.DeviceResponsegetDeviceByToken(String deviceToken)List<DeviceDTO>getDevicesByUserId(String userId)retrieve all devices for given userStringResponsegetHashForTokenAndTransaction(String deviceId, String transactionId)Method is used to validate response from the device for authentation attempts using push notification.ResponsemakeLoginAttemptRequestOnDevice(LoginAttemptRequest request)Send a push notification to given device with login attemptResponseregister(DeviceRegistrationRequest deviceRegistrationRequest)ResponseresetDeviceToken(String deviceId, String newDeviceToken)usually device token is permanent and alive for application installation on device, but sometime it could be renew -The app deletes Instance ID -The app is restored on a new device -The user uninstalls/reinstall the app -The user clears app data.
-
-
-
Method Detail
-
getActiveDevicesByUserId
List<DeviceDTO> getActiveDevicesByUserId(String userId)
retrieve active devices that are owned by given user- Parameters:
userId- - target user id- Returns:
DeviceDTO
-
getDevicesByUserId
List<DeviceDTO> getDevicesByUserId(String userId)
retrieve all devices for given user- Parameters:
userId- - user id- Returns:
- -
List
-
countDevicesByUserId
int countDevicesByUserId(String userId)
-
create
DeviceResponse create(DeviceDTO deviceDTO)
-
register
Response register(DeviceRegistrationRequest deviceRegistrationRequest)
-
resetDeviceToken
Response resetDeviceToken(String deviceId, String newDeviceToken)
usually device token is permanent and alive for application installation on device, but sometime it could be renew -The app deletes Instance ID -The app is restored on a new device -The user uninstalls/reinstall the app -The user clears app data.- Parameters:
deviceId- - internal OpenIAM device IdnewDeviceToken- - new token coming from the device- Returns:
- -
Responsewith statusResponseStatus.SUCCESSis reset was success andResponseStatus.FAILUREotherwise.
-
getDecryptedDeviceToken
StringResponse getDecryptedDeviceToken(String deviceId)
method is used to get decrypted device token to use it for notification sending.- Parameters:
deviceId- - id of required device- Returns:
StringResponsewithResponseStatus.SUCCESSand decrypted token inBaseDataResponse.valueif successfully decrpyted orResponseStatus.FAILUREin case of some problems;
-
getDeviceByToken
DeviceResponse getDeviceByToken(String deviceToken)
-
makeLoginAttemptRequestOnDevice
Response makeLoginAttemptRequestOnDevice(LoginAttemptRequest request)
Send a push notification to given device with login attempt- Parameters:
request-LoginAttemptRequest- Returns:
- success status in case everyting is OK.
-
getHashForTokenAndTransaction
StringResponse getHashForTokenAndTransaction(String deviceId, String transactionId) throws BasicDataServiceException
Method is used to validate response from the device for authentation attempts using push notification. Method use deviceToken (firebase token for android, concantinate it with transaction id and generate SHA-256 hash code), it's expected to get the same hash from the device, due to only OpenIAM db and device keep teal deviceToken value- Parameters:
deviceId- device - id of given devicetransactionId- - current transaction id- Returns:
- hash value
- Throws:
BasicDataServiceException
-
-