- private String createInputJsonString(SdncOscAdapterInput inputParams) {
- JSONObject inputJson = new JSONObject();
- inputJson.put("input", new JSONObject(gson.toJson(inputParams)));
- return inputJson.toString();
- }
-
- private Mono<String> getValueFromResponse(String response, String key) {
- logger.debug("A1 client: response = {}", response);
- try {
- JSONObject outputJson = new JSONObject(response);
- JSONObject responseParams = outputJson.getJSONObject("output");
- if (!responseParams.has(key)) {
- return Mono.just("");
- }
- String value = responseParams.get(key).toString();
- return Mono.just(value);
- } catch (JSONException ex) { // invalid json
- return Mono.error(ex);
- }
- }
+ @Override
+ public Mono<String> getPolicyStatus(Policy policy) {
+ SdncOscAdapterInput inputParams = ImmutableSdncOscAdapterInput.builder() //
+ .nearRtRicUrl(ricConfig.baseUrl()) //
+ .policyId(policy.id()) //
+ .build();
+ String inputJsonString = JsonHelper.createInputJsonString(inputParams);
+ logger.debug("POST getPolicyStatus inputJsonString = {}", inputJsonString);