Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop Endpoint Info fallback if there are Endpoints specified in scope #2173

Merged

Conversation

lorthirk
Copy link

@lorthirk lorthirk commented Nov 9, 2018

This PR changes the way EndpointInfoServiceImpl uses the fallback mechanism, reflecting on parent accounts only if the current one has no entries.

Related Issue
N/A

Description of the solution adopted
Before this one, when an Endpoint wasn't found in an account, the query was repeated for parent account, scaling up the hierarchy up to the root. This meant that a query could return no entries for a specific filter, even if there were endpoints available that didn't match the filter, and scale up the hierarchy.

Now, before activating the fallback mechanism, an additional query is performed to be sure that the current account contains no endpoints at all.

Screenshots
N/A

Any side note on the changes made
N/A

Signed-off-by: Claudio Mezzasalma <claudio.mezzasalma@eurotech.com>
@lorthirk lorthirk requested a review from Coduz November 9, 2018 15:40
@codecov
Copy link

codecov bot commented Nov 9, 2018

Codecov Report

Merging #2173 into develop will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2173      +/-   ##
=============================================
+ Coverage      57.51%   57.53%   +0.01%     
  Complexity      1584     1584              
=============================================
  Files           1063     1063              
  Lines          25939    25939              
  Branches        2294     2294              
=============================================
+ Hits           14919    14923       +4     
+ Misses         10044    10040       -4     
  Partials         976      976
Impacted Files Coverage Δ Complexity Δ
...pse/kapua/broker/core/pool/JmsConsumerWrapper.java 60% <0%> (-10%) 0% <0%> (ø)
.../broker/core/plugin/KapuaSecurityBrokerFilter.java 75.32% <0%> (+0.32%) 0% <0%> (ø) ⬇️
...plugin/authentication/UserAuthenticationLogic.java 73.39% <0%> (+1.83%) 0% <0%> (ø) ⬇️
...ua/broker/core/listener/DeviceMessageListener.java 48.88% <0%> (+6.66%) 0% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3168a33...c2f35f6. Read the comment docs.

Also removed duplicated code

Signed-off-by: Claudio Mezzasalma <claudio.mezzasalma@eurotech.com>
@Coduz Coduz added the Bug This is a bug or an unexpected behaviour. Fix it! label Nov 15, 2018
@Coduz Coduz merged commit be450d9 into eclipse-kapua:develop Nov 15, 2018
@lorthirk lorthirk deleted the change-stop_endpoint_fallback_condition branch January 25, 2019 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug or an unexpected behaviour. Fix it!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants