leshan icon indicating copy to clipboard operation
leshan copied to clipboard

Add custom additionalAtrributes when update

Open Fr3027 opened this issue 3 years ago • 2 comments

Sometimes we need to add additionalAttributes to update requests. Knowing that the RegistrationUpdate class already has additionalAttributes member, but in DefaultRegistrationEngine.java I found this: long delay = calculateNextUpdate(server, dmInfo.lifetime); scheduleUpdate(server, registrationID, new RegistrationUpdate(), delay); Obviously, the additionAttributes map will always be empty every time a RegistrationUpdate request is sent to the server, it would be more useful if we can build LeshanClient with updateAdditionalAttributes.

Fr3027 avatar Jul 31 '22 01:07 Fr3027

Which version are you using ?

Which kind of API, you would like:

  • LeshanClient.triggerRegistrationUpdate(Map<String, String> additionalAttributes)
  • OR LeshanClient.triggerRegistrationUpdate(RegistrationUpdate update)
  • OR something else/more ?

Waiting as a workaround, there is a DefaultRegistrationEngine.triggerRegistrationUpdate(RegistrationUpdate) So creating a custom DefaultRegistrationEngineFactory should be able to get an access to this method.

sbernard31 avatar Aug 01 '22 08:08 sbernard31

Still interested in this ? or We should close it ?

sbernard31 avatar Sep 19 '22 13:09 sbernard31