Juan Hernandez has submitted this change and it was merged.
Change subject: restapi: Use "SystemResource" to find root collections
......................................................................
restapi: Use "SystemResource" to find root collections
Currently the tool that generates the RSDL file scans all the JAX-RS
interfaces looking for "@Path" annotations in order to find the root
collections. For example, it expects the following class:
@Path("/clusters")
public interface ClustersResource {
...
}
But a recent patch has changed the way this is implemented, moving the
annotations to the "SystemResource", so that the way to locate root
collections is using locator methods:
@Path("/")
public interface SystemResource {
@Path("clusters")
ClustersResource getClustersResource();
@Path("datacenters")
DataCentersResource getDataCentersResource();
...
}
The tool wasn't updated to take this into account, so wasn't finding any
resource, and thus it was generating an almost empty RSDL document.
This patch changes the RSDL tool so that it scans the methods of the
"SystemResource" instead of all the JAX-RS classes.
In addition to solving the problem, this patch has also the nice side
effect that there is no longer a need to enumerate the classes available
in the classpath, so the "ReflectionHelper" class can be simplified.
Change-Id: I8762dbde9f3558f23eba56170cefe804f0ade5c4
Bug-Url:
https://bugzilla.redhat.com/1285390
Signed-off-by: Juan Hernandez <juan.hernandez(a)redhat.com>
---
M
backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/rsdl/RsdlBuilder.java
M
backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/utils/ReflectionHelper.java
D
backend/manager/modules/restapi/interface/definition/src/test/java/org/ovirt/engine/api/utils/ReflectionHelperTest.java
3 files changed, 8 insertions(+), 173 deletions(-)
Approvals:
Juan Hernandez: Verified; Looks good to me, approved
Jenkins CI: Passed CI tests
--
To view, visit
https://gerrit.ovirt.org/49308
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8762dbde9f3558f23eba56170cefe804f0ade5c4
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Ori Liel <oliel(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>