Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[leshan-dev] Refusing client registration

Hi,

During the shim refactoring I removed some unused checked exceptions.

One is problematic on ClientRegistry interface:

Client registerClient(Client client) throws ClientRegistrationException;

The ClientRegistrationException wasn't really explicit
/** * An exception raised when a client registry operation has failed. */

So I decided to remove it because nowhere in the leshan-standalone code we was throwing it.

But apparently ClientRegistrationException was used to refuse the registration (e.g. I don't know this client).

Anyway any exception (checked or runtime) received by the registration code will just produce a BAD_REQUEST return code, the only error code we can return on the bootstrap operation...

I propose to change it to:
boolean registerClient(Client client);

returning true if the registration was accepted or not.

That's also mean we don't return anymore the previous Client instance if a Client was already registered for this endpoint. I hope this feature is not used :)

Julien

Back to the top