- @ApiResponse(code = 200, message = "OK") //
- })
- public ResponseEntity<String> getRics() {
- Vector<RicInfo> result = new Vector<>();
- for (Ric ric : rics.getRics()) {
- result.add(ImmutableRicInfo.builder() //
- .name(ric.name()) //
- .nodeNames(ric.getManagedNodes()) //
- .build());
+ @ApiResponse(code = 200, message = "OK", response = RicInfo.class, responseContainer = "List"), //
+ @ApiResponse(code = 404, message = "Policy type is not found", response = String.class)})
+ public ResponseEntity<String> getRics(
+ @RequestParam(name = "policyType", required = false) String supportingPolicyType) {
+
+ if ((supportingPolicyType != null) && (this.types.get(supportingPolicyType) == null)) {
+ return new ResponseEntity<>("Policy type not found", HttpStatus.NOT_FOUND);
+ }
+
+ List<RicInfo> result = new ArrayList<>();
+ synchronized (rics) {
+ for (Ric ric : rics.getRics()) {
+ if (supportingPolicyType == null || ric.isSupportingType(supportingPolicyType)) {
+ result.add(new RicInfo(ric.name(), ric.getManagedElementIds(), ric.getSupportedPolicyTypeNames()));
+ }
+ }