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 int
countDevicesByUserId(String userId)
DeviceResponse
create(DeviceDTO deviceDTO)
Response
delete(String id)
Response
deleteByUserId(String userId)
Response
disable(String deviceId)
Response
enable(String deviceId)
List<DeviceDTO>
getActiveDevicesByUserId(String userId)
retrieve active devices that are owned by given userDeviceDTO
getById(String id)
StringResponse
getDecryptedDeviceToken(String deviceId)
method is used to get decrypted device token to use it for notification sending.DeviceResponse
getDeviceByToken(String deviceToken)
List<DeviceDTO>
getDevicesByUserId(String userId)
retrieve all devices for given userStringResponse
getHashForTokenAndTransaction(String deviceId, String transactionId)
Method is used to validate response from the device for authentation attempts using push notification.Response
makeLoginAttemptRequestOnDevice(LoginAttemptRequest request)
Send a push notification to given device with login attemptResponse
register(DeviceRegistrationRequest deviceRegistrationRequest)
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.
-
-
-
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:
- -
Response
with statusResponseStatus.SUCCESS
is reset was success andResponseStatus.FAILURE
otherwise.
-
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:
StringResponse
withResponseStatus.SUCCESS
and decrypted token inBaseDataResponse.value
if successfully decrpyted orResponseStatus.FAILURE
in 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
-
-