leshan
leshan copied to clipboard
Add custom additionalAtrributes when update
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.
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.
Still interested in this ? or We should close it ?