*******************************************************************************/
package org.onap.slice.analysis.ms.configdb;
-import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.ParameterizedTypeReference;
-import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
/**
}
}
-}
\ No newline at end of file
+}
public ResponseEntity<HttpStatus> healthCheck() {
return new ResponseEntity<>(HttpStatus.OK);
}
-}
\ No newline at end of file
+}
package org.onap.slice.analysis.ms.dmaap;
+/**
+ * Interface for NotificationCallback
+ *
+ */
public interface NotificationCallback {
public abstract void activateCallBack(String msg);
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
private CambriaBatchingPublisher cambriaBatchingPublisher;
-
/**
* Parameterized constructor.
*/
* sends notification to dmaap.
*/
public int sendNotification(String msg) throws IOException {
-
return cambriaBatchingPublisher.send("", msg);
-
}
}
private static Logger log = LoggerFactory.getLogger(PmNotificationCallback.class);
+ /**
+ * Triggers on handleNofitication method
+ */
@Override
public void activateCallBack(String msg) {
handleNotification(msg);
return "CUModel [gNBCUName=" + gNBCUName + ", nearRTRICId=" + nearRTRICId + ", cellCUList=" + cellCUList + "]";
}
+ /**
+ * Returns a hashcode value for the object
+ */
@Override
public int hashCode() {
final int prime = 31;
return result;
}
+ /**
+ * Checks whether the object matches with the CUModel
+ */
@Override
public boolean equals(Object obj) {
if (this == obj)
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
private Integer cellLocalId;
private ConfigData configData;
+ /**
+ * Returns a hashcode value for the object
+ */
@Override
public int hashCode() {
final int prime = 31;
return result;
}
+ /**
+ * Checks whether the object matches with the CellCUList
+ */
@Override
public boolean equals(Object obj) {
if (this == obj)
this.lastUpdatedTS = lastUpdatedTS;
}
+ /**
+ * Returns a hashcode value for the object
+ */
@Override
public int hashCode() {
final int prime = 31;
return result;
}
+ /**
+ * Checks whether the object matches with ConfigData
+ */
@Override
public boolean equals(Object obj) {
if (this == obj)
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Model class for configuration policy
*
*/
-
public class ConfigPolicy {
private static ConfigPolicy instance = null;
public String toString() {
return "ConfigPolicy [config=" + config + "]";
}
+
}
return "MLOutputModel [snssai=" + snssai + ", data=" + data + "]";
}
+ /**
+ * Returns a hashcode value for the object
+ */
@Override
public int hashCode() {
final int prime = 31;
return result;
}
+ /**
+ * Checks whether the object matches with the MLOutputModel
+ */
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
}
-
}
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
private String measurementObjectId;
private Map<String, Integer> pmData;
+ /**
+ * Returns the index of the MeasurementObject
+ */
public static int findIndex(String measurementObjectId, List<MeasurementObject> list) {
int index = -1;
int len = list.size();
}
+ /**
+ * Returns a hachcode value for the object
+ */
@Override
public int hashCode() {
final int prime = 31;
return result;
}
+ /**
+ * Checks whether the object matches with the MeasurementObject
+ */
@Override
public boolean equals(Object obj) {
if (this == obj)
return measuredObject;
}
+ /**
+ * Returns a hashcode value for the object
+ */
@Override
public int hashCode() {
final int prime = 31;
return result;
}
+ /**
+ * Checks whether the object matches with the SubCounter
+ */
@Override
public boolean equals(Object obj) {
if (this == obj)
/**
* Model class for the CellsModel Object
*/
-
@JsonIgnoreProperties(ignoreUnknown = true)
public class CellsModel {
private String cellLocalId;
-
public String getCellLocalId() {
return cellLocalId;
}
return "CellsModel [cellLocalId=" + cellLocalId + "]";
}
-
-
}
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*******************************************************************************/
package org.onap.slice.analysis.ms.models.configdb;
-
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
private String gNBDUId;
-
public String getgNBDUId() {
return gNBDUId;
}
return "NetworkFunctionModel [gNBDUId=" + gNBDUId + "]";
}
-
-
-
-
}
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
public void setPerf3gppFields(Perf3gppFields perf3gppFields) {
this.perf3gppFields = perf3gppFields;
}
+
}
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
public void setMeasResults(List<MeasResult> measResults) {
this.measResults = measResults;
}
+
}
this.scriptName = scriptName;
}
-
}
private String networkType;
private AdditionalProperties<?> additionalProperties;
-
public String getName() {
return name;
}
-
public void setName(String name) {
this.name = name;
}
-
public String getServiceInstanceID() {
return serviceInstanceID;
}
-
public void setServiceInstanceID(String serviceInstanceId) {
this.serviceInstanceID = serviceInstanceId;
}
-
public String getGlobalSubscriberId() {
return globalSubscriberId;
}
-
public void setGlobalSubscriberId(String globalSubscriberId) {
this.globalSubscriberId = globalSubscriberId;
}
-
public String getSubscriptionServiceType() {
return subscriptionServiceType;
}
-
public void setSubscriptionServiceType(String subscriptionServiceType) {
this.subscriptionServiceType = subscriptionServiceType;
}
-
public String getNetworkType() {
return networkType;
}
-
public void setNetworkType(String networkType) {
this.networkType = networkType;
}
-
public AdditionalProperties<?> getAdditionalProperties() {
return additionalProperties;
}
-
public void setAdditionalProperties(AdditionalProperties<?> additionalProperties) {
this.additionalProperties = additionalProperties;
}
super();
}
+ /**
+ * Sends post request to Aai
+ */
public <T> ResponseEntity<T> sendPostRequest(String requestUrl, String requestBody,
ParameterizedTypeReference<T> responseType) {
HttpHeaders headers = new HttpHeaders();
return super.sendPostRequest(headers, requestUrl, requestBody, responseType);
}
+ /**
+ * Sends get request to Aai
+ */
public <T> ResponseEntity<T> sendGetRequest(String requestUrl, ParameterizedTypeReference<T> responseType) {
HttpHeaders headers = new HttpHeaders();
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
headers.set("X-TransactionId", "get_aai_subscr");
return super.sendGetRequest(headers, requestUrl, responseType);
}
+
}
headers.setContentType(MediaType.APPLICATION_JSON);
return super.sendGetRequest(headers, requestUrl, responseType);
}
+
}
headers.setContentType(MediaType.APPLICATION_JSON);
return super.sendGetRequest(headers, requestUrl, responseType);
}
-}
+}
/**
* Post Request Template.
*/
-
public <T> ResponseEntity<T> sendPostRequest(HttpHeaders headers, String requestUrl, String requestBody,
ParameterizedTypeReference<T> responseType) {
HttpEntity<Object> requestEntity = new HttpEntity<>(requestBody, headers);
/**
* Get Request Template.
*/
-
public <T> ResponseEntity<T> sendGetRequest(HttpHeaders headers, String requestUrl,
ParameterizedTypeReference<T> responseType) {
HttpEntity<Void> requestEntity = new HttpEntity<>(headers);
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
log.debug("find average for samples {}", samples);
int numOfSamples = samples.size();
List<MeasurementObject> result = new ArrayList<>();
- if(!samples.isEmpty()) {
for(List<MeasurementObject> sample : samples) {
for(MeasurementObject cellMeasObj : sample) {
int index = MeasurementObject.findIndex(cellMeasObj.getMeasurementObjectId(), result);
}
}
}
- }
return findAvg(result, numOfSamples);
}
}
return result;
}
-}
+}
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
- /**
- * Checks whether enough samples are available for the network functions
- */
+ /**
+ * Checks whether enough samples are available for the network functions
+ */
public boolean checkForEnoughSamples(List<String> nfs, String snssai) {
for(String nf : nfs) {
if(! pmDataQueue.checkSamplesInQueue(new SubCounter(nf, snssai), samples)) {
}
policyService.sendOnsetMessageToPolicy(snssai, addProps, serviceDetails);
}
-}
+}
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
result.put("snssai", pmNameArr[2]);
return result;
}
-}
\ No newline at end of file
+
+}
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
}
+
}
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
private static Logger log = LoggerFactory.getLogger(PolicyService.class);
private ObjectMapper objectMapper = new ObjectMapper();
+ /**
+ * Initialization
+ */
@PostConstruct
public void init() {
Configuration configuration = Configuration.getInstance();
}
log.info("Throughput computed for RIC {}", ricToThroughputMapping);
}
+
}
@Configuration
public class AppConfig {
-
-
/**
* Rest Template bean.
*/
byteArrayHttpMessageConverter.setSupportedMediaTypes(supportedApplicationTypes);
return byteArrayHttpMessageConverter;
}
+
}
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
public static <T> T getBean(Class<T> beanClass) {
return context.getBean(beanClass);
}
+
}
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020 Wipro Limited.
+ * Copyright (C) 2020-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.