eclipse-californium / californium.tools

Californium project
Other
59 stars 57 forks source link

Requesting change of the access modifiers in RDNodeResource #25

Open navoda opened 7 years ago

navoda commented 7 years ago

Hi, There are some private methods that I need to extend and override in RDNodeResource class for project specializing purposes.

Eg: The complete request payload is handled by the private method updateEndpointResources, which makes it impossible to extract any additional information from the payload.

Can you change them to public or any other access modifiers that can be override?

sophokles73 commented 7 years ago

@navoda,

is the stuff that is currently done in updateEndpointResources all wrong and you need to do something completely different or do you just need an extension hook that will be called from there and which you can implement by subclassing? I am asking because I would like to better understand which functionality should be provided by RDNodeResource and what kind of extensibility is required..

navoda commented 7 years ago

The whole RDNodeResource class should be changed into more generalized mode.

I will describe a scenario briefly, for you to understand the matter;

The RD receives a registration request for a specific endpoint with the resource list to add with their resource types. Currently RDNodeResource adds these resources to the endpoint as sub resources (which is fine) but all the resource types are hard-coded to be instances of RDTagResource -> This is done by the function addNodeResources. But I need those resources to be various types of resources with-respect to their rt (resource type) attribute. But the attributes are set by the function updateEndpointResources only after executing addNodeResources which already add resources as 'new RDTagResources'. Making it impossible to make the changes afterward.

I think this is actually an issue of process order and poor generalization of the RDNodeResource class. But I can get a temporary solution for my project, if the class is more flexible for override facility in a subclass.

I would really like if I can send a PR with a better solution for the matter. But right now I'm facing some issues with signing a CLA.

sophokles73 commented 7 years ago

Can you give me your email address that you used for your Eclipse account? I will try to reach out to staff there I know regarding this problem ...

navoda commented 7 years ago

@sophokles73 [mpnavoda@gmail.com](), this is the same email I use for GitHub.