summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandler.java')
-rw-r--r--cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandler.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandler.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandler.java
index d40ab9b39..8b0809090 100644
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandler.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandler.java
@@ -56,6 +56,7 @@ public abstract class NcmpDatastoreRequestHandler {
* @param optionsParamInQuery the options param in query
* @param topicParamInQuery the topic param in query
* @param includeDescendants whether include descendants
+ * @param authorization contents of Authorization header, or null if not present
* @return the response entity
*/
public ResponseEntity<Object> executeRequest(final String datastoreName,
@@ -63,12 +64,13 @@ public abstract class NcmpDatastoreRequestHandler {
final String resourceIdentifier,
final String optionsParamInQuery,
final String topicParamInQuery,
- final boolean includeDescendants) {
+ final boolean includeDescendants,
+ final String authorization) {
final boolean asyncResponseRequested = topicParamInQuery != null;
if (asyncResponseRequested && notificationFeatureEnabled) {
return executeAsyncTaskAndGetResponseEntity(datastoreName, cmHandleId, resourceIdentifier,
- optionsParamInQuery, topicParamInQuery, includeDescendants);
+ optionsParamInQuery, topicParamInQuery, includeDescendants, authorization);
}
if (asyncResponseRequested) {
@@ -76,7 +78,7 @@ public abstract class NcmpDatastoreRequestHandler {
+ "will use synchronous operation.");
}
final Supplier<Object> taskSupplier = getTaskSupplierForGetRequest(datastoreName, cmHandleId,
- resourceIdentifier, optionsParamInQuery, NO_TOPIC, NO_REQUEST_ID, includeDescendants);
+ resourceIdentifier, optionsParamInQuery, NO_TOPIC, NO_REQUEST_ID, includeDescendants, authorization);
return executeTaskSync(taskSupplier);
}
@@ -99,10 +101,12 @@ public abstract class NcmpDatastoreRequestHandler {
final String resourceIdentifier,
final String optionsParamInQuery,
final String topicParamInQuery,
- final boolean includeDescendants) {
+ final boolean includeDescendants,
+ final String authorization) {
final String requestId = UUID.randomUUID().toString();
final Supplier<Object> taskSupplier = getTaskSupplierForGetRequest(datastoreName, cmHandleId,
- resourceIdentifier, optionsParamInQuery, topicParamInQuery, requestId, includeDescendants);
+ resourceIdentifier, optionsParamInQuery, topicParamInQuery, requestId, includeDescendants,
+ authorization);
return executeTaskAsync(topicParamInQuery, requestId, taskSupplier);
}
@@ -112,6 +116,7 @@ public abstract class NcmpDatastoreRequestHandler {
final String optionsParamInQuery,
final String topicParamInQuery,
final String requestId,
- final boolean includeDescendant);
+ final boolean includeDescendant,
+ final String authorization);
}