summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java')
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java41
1 files changed, 18 insertions, 23 deletions
diff --git a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java
index 182bdd84..b66e5c1b 100644
--- a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java
+++ b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java
@@ -37,16 +37,16 @@ import org.onap.cps.ncmp.dmi.exception.DmiException;
import org.onap.cps.ncmp.dmi.exception.ModuleResourceNotFoundException;
import org.onap.cps.ncmp.dmi.exception.ModulesNotFoundException;
import org.onap.cps.ncmp.dmi.exception.ResourceDataNotFound;
-import org.onap.cps.ncmp.dmi.model.CmHandleOperation;
-import org.onap.cps.ncmp.dmi.model.CreatedCmHandle;
-import org.onap.cps.ncmp.dmi.model.ModuleReference;
-import org.onap.cps.ncmp.dmi.model.ModuleSchemaProperties;
-import org.onap.cps.ncmp.dmi.model.ModuleSchemas;
import org.onap.cps.ncmp.dmi.model.ModuleSet;
import org.onap.cps.ncmp.dmi.model.ModuleSetSchemas;
import org.onap.cps.ncmp.dmi.model.YangResource;
import org.onap.cps.ncmp.dmi.model.YangResources;
import org.onap.cps.ncmp.dmi.service.client.NcmpRestClient;
+import org.onap.cps.ncmp.dmi.service.model.CmHandleOperation;
+import org.onap.cps.ncmp.dmi.service.model.CreatedCmHandle;
+import org.onap.cps.ncmp.dmi.service.model.ModuleReference;
+import org.onap.cps.ncmp.dmi.service.model.ModuleSchemaProperties;
+import org.onap.cps.ncmp.dmi.service.model.ModuleSchemas;
import org.onap.cps.ncmp.dmi.service.operation.SdncOperations;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -60,13 +60,12 @@ public class DmiServiceImpl implements DmiService {
private NcmpRestClient ncmpRestClient;
private ObjectMapper objectMapper;
private DmiPluginProperties dmiPluginProperties;
- private static final String CONTENT_QUERY_PASSTHROUGH_OPERATIONAL = "content=all";
- private static final String CONTENT_QUERY_PASSTHROUGH_RUNNING = "content=config";
+ private static final String RESTCONF_CONTENT_PASSTHROUGH_OPERATIONAL_QUERY_PARAM = "content=all";
+ private static final String REST_CONF_CONTENT_PASSTHROUGH_RUNNING_QUERY_PARAM = "content=config";
private static final String RESPONSE_CODE = "response code : ";
private static final String MESSAGE = " message : ";
private static final String IETF_NETCONF_MONITORING_OUTPUT = "ietf-netconf-monitoring:output";
-
/**
* Constructor.
*
@@ -178,34 +177,30 @@ public class DmiServiceImpl implements DmiService {
@Override
public Object getResourceDataOperationalForCmHandle(final @NotNull String cmHandle,
final @NotNull String resourceIdentifier,
- final String acceptParam,
- final String fieldsQuery,
- final Integer depthQuery,
+ final String acceptParamInHeader,
+ final String optionsParamInQuery,
final Map<String, String> cmHandlePropertyMap) {
// not using cmHandlePropertyMap of onap dmi impl , other dmi impl might use this.
final ResponseEntity<String> responseEntity = sdncOperations.getResouceDataForOperationalAndRunning(cmHandle,
resourceIdentifier,
- fieldsQuery,
- depthQuery,
- acceptParam,
- CONTENT_QUERY_PASSTHROUGH_OPERATIONAL);
+ optionsParamInQuery,
+ acceptParamInHeader,
+ RESTCONF_CONTENT_PASSTHROUGH_OPERATIONAL_QUERY_PARAM);
return prepareAndSendResponse(responseEntity, cmHandle);
}
@Override
public Object getResourceDataPassThroughRunningForCmHandle(final @NotNull String cmHandle,
final @NotNull String resourceIdentifier,
- final String acceptParam,
- final String fieldsQuery,
- final Integer depthQuery,
+ final String acceptParamInHeader,
+ final String optionsParamInQuery,
final Map<String, String> cmHandlePropertyMap) {
// not using cmHandlePropertyMap of onap dmi impl , other dmi impl might use this.
final ResponseEntity<String> responseEntity = sdncOperations.getResouceDataForOperationalAndRunning(cmHandle,
resourceIdentifier,
- fieldsQuery,
- depthQuery,
- acceptParam,
- CONTENT_QUERY_PASSTHROUGH_RUNNING);
+ optionsParamInQuery,
+ acceptParamInHeader,
+ REST_CONF_CONTENT_PASSTHROUGH_RUNNING_QUERY_PARAM);
return prepareAndSendResponse(responseEntity, cmHandle);
}
@@ -269,4 +264,4 @@ public class DmiServiceImpl implements DmiService {
return responseBodyAsJsonObject.getAsJsonObject(IETF_NETCONF_MONITORING_OUTPUT).getAsJsonPrimitive("data")
.toString();
}
-} \ No newline at end of file
+}