+
+ private RestOutputCmHandle toRestOutputCmHandle(final NcmpServiceCmHandle ncmpServiceCmHandle) {
+ final RestOutputCmHandle restOutputCmHandle = new RestOutputCmHandle();
+ final CmHandlePublicProperties cmHandlePublicProperties = new CmHandlePublicProperties();
+ restOutputCmHandle.setCmHandle(ncmpServiceCmHandle.getCmHandleID());
+ cmHandlePublicProperties.add(ncmpServiceCmHandle.getPublicProperties());
+ restOutputCmHandle.setPublicCmHandleProperties(cmHandlePublicProperties);
+ return restOutputCmHandle;
+ }
+
+ private ResponseEntity<Map<String, Object>> populateAsyncResponse(final String topicParamInQuery) {
+ final boolean processAsynchronously = hasTopicParameter(topicParamInQuery);
+ final Map<String, Object> responseData;
+ if (processAsynchronously) {
+ responseData = getAsyncResponseData();
+ } else {
+ responseData = null;
+ }
+ return ResponseEntity.ok().body(responseData);
+ }
+
+ private static boolean hasTopicParameter(final String topicName) {
+ if (topicName == null) {
+ return false;
+ }
+ if (CpsValidator.validateTopicName(topicName)) {
+ return true;
+ }
+ throw new InvalidTopicException("Topic name " + topicName + " is invalid", "invalid topic");
+ }
+
+ private Map<String, Object> getAsyncResponseData() {
+ final Map<String, Object> asyncResponseData = new HashMap<>(1);
+ final String resourceDataRequestId = UUID.randomUUID().toString();
+ asyncResponseData.put(ASYNC_REQUEST_ID, resourceDataRequestId);
+ return asyncResponseData;
+ }
+