* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
/**
* @author : Ravi Mantena
- * @date 10/16/2020
- * Application: ONAP - Blueprint Generator
- * Service to create Streams
+ * @date 10/16/2020 Application: ONAP - Blueprint Generator Service to create Streams
*/
-
-
@Service
public class StreamsService {
@Autowired
private BlueprintHelperService blueprintHelperService;
- //Methos to create streams for Dmaap Blueprint
- public Map<String, Object> createStreams(Map<String, LinkedHashMap<String, Object>> inputs, String name, String type, String key, String route, char o){
- Map<String,Object> response = new HashMap<>();
+ /**
+ * Creates streams for Dmaap Blueprint
+ *
+ * @param inputs Inputs
+ * @param name Name
+ * @param type Type
+ * @param key Key
+ * @param route Route
+ * @param o For Data Router Type s
+ * @return
+ */
+ public Map<String, Object> createStreams(
+ Map<String, Map<String, Object>> inputs,
+ String name,
+ String type,
+ String key,
+ String route,
+ char o) {
+ Map<String, Object> response = new HashMap<>();
Streams streams = new Streams();
- LinkedHashMap<String, Object> stringType = new LinkedHashMap();
+ Map<String, Object> stringType = new LinkedHashMap();
stringType.put("type", "string");
streams.setName(name);
inputs.put(key + "_" + name + "_location", stringType);
streams.setLocation(location);
- if(blueprintHelperService.isDataRouterType(type)) {
- if('s' == o) {
+ if (blueprintHelperService.isDataRouterType(type)) {
+ if ('s' == o) {
GetInput username = new GetInput();
username.setBpInputName(key + "_" + name + "_username");
streams.setUsername(username);
streams.setScheme("https");
}
-
} else {
GetInput client = new GetInput();
client.setBpInputName(key + "_" + name + "_client_role");
response.put("inputs", inputs);
return response;
}
-
}