1 /*******************************************************************************
2 * ============LICENSE_START========================================================================
3 * ONAP : ccsdk feature sdnr wt
4 * =================================================================================================
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6 * =================================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software distributed under the License
13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14 * or implied. See the License for the specific language governing permissions and limitations under
16 * ============LICENSE_END==========================================================================
17 ******************************************************************************/
18 package org.onap.ccsdk.features.sdnr.wt.devicemanager.types;
20 import java.util.ArrayList;
21 import java.util.List;
22 import org.eclipse.jdt.annotation.Nullable;
23 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Faultlog;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogBuilder;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SourceType;
28 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
29 import org.slf4j.Logger;
34 public class FaultData {
36 private final List<Faultlog> problemList = new ArrayList<>();
42 return problemList.size();
51 public static void debugResultList(Logger log, String value, FaultData resultList, int idxStart) {
52 // TODO Auto-generated method stub
57 * @param nodeId of device
58 * @param sequenceNumber given by device
59 * @param timeStamp of occurence
60 * @param objectReference uuid in ONF model
61 * @param problemName of object
62 * @param severity of problem
64 public void add(NodeId nodeId, @Nullable Integer sequenceNumber, @Nullable DateAndTime timeStamp,
65 @Nullable String objectReference, @Nullable String problemName, @Nullable SeverityType severity) {
66 FaultlogBuilder bFaullog = new FaultlogBuilder().setNodeId(nodeId.getValue()).setCounter(sequenceNumber)
67 .setTimestamp(timeStamp).setObjectId(objectReference).setProblem(problemName).setSeverity(severity);
68 bFaullog.setSourceType(SourceType.Netconf);
69 problemList.add(bFaullog.build());
73 * @param globalProblemList to add
75 public void addAll(FaultData globalProblemList) {
76 problemList.addAll(globalProblemList.problemList);
86 * @param idx of element to get
87 * @return Faultlog the element
89 public Faultlog get(int idx) {
90 return problemList.get(idx);
94 * Provide list with all problems of node
97 public List<Faultlog> getProblemList() {