import java.util.Optional;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
/**
* Identify the NE as provider for performance data according to microwave model.
public void next();
- public Optional<PerformanceDataLtp> getLtpHistoricalPerformanceData();
+ public Optional<PerformanceDataLtp> getLtpHistoricalPerformanceData() throws InconsistentPMDataException;
public String pmStatusToString();
+++ /dev/null
-/*
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt
- * =================================================================================================
- * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. 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. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- * ============LICENSE_END==========================================================================
- */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.types;
-
-import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
-
-/**
- * Add specific constructor
- */
-public class FaultNotificationBuilder2 extends FaultlogBuilder {
-
- public FaultNotificationBuilder2(NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp,
- @Nullable String objectId, @Nullable String problem, @Nullable SeverityType severity,
- SourceType sourceType) {
-
- setNodeId(nodeId.getValue());
- if (counter != null) {
- setCounter(counter);
- }
- if (timeStamp != null) {
- setTimestamp(timeStamp);
- }
- setObjectId(objectId);
- setProblem(problem);
- setSeverity(severity);
- setSourceType(sourceType);
- }
-
-}
--- /dev/null
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.util;
+
+public class InconsistentPMDataException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public InconsistentPMDataException() {
+ super();
+ }
+
+ public InconsistentPMDataException(String message) {
+ super(message);
+ }
+
+ public InconsistentPMDataException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public InconsistentPMDataException(Throwable cause) {
+ super(cause);
+ }
+}
--- /dev/null
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.util;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class PmUtil {
+
+ private static final Logger LOG = LoggerFactory.getLogger(PmUtil.class);
+
+ static public <T extends DataObject> @NonNull T throwIfDataObjectNull(@Nullable T dataObject, String msg)
+ throws InconsistentPMDataException {
+ if (dataObject == null) {
+ LOG.debug(msg);
+ throw new InconsistentPMDataException(msg);
+ }
+ return dataObject;
+ }
+}
import org.onap.ccsdk.features.sdnr.wt.devicemanager.toggleAlarmFilter.NotificationDelayFilter;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.toggleAlarmFilter.NotificationDelayedListener;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.EquipmentData;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.EventlogNotificationBuilder;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity;
* the License.
* ============LICENSE_END==========================================================================
*/
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.types;
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.eventdatahandler;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
/**
* Constructor of PM Task
- *
+ *
* @param seconds seconds to call PM Task
* @param microwaveHistoricalPerformanceWriterService DB Service to load PM data to
* @param netconfNetworkElementService to write into log
public PerformanceManagerTask(long seconds, DataProvider microwaveHistoricalPerformanceWriterService,
NetconfNetworkElementService netconfNetworkElementService) {
- LOG.debug("Init task {}", PerformanceManagerTask.class.getSimpleName());
+ LOG.info("Init task {} handling time {} seconds", PerformanceManagerTask.class.getSimpleName(), seconds);
this.seconds = seconds;
this.databaseService = microwaveHistoricalPerformanceWriterService;
this.scheduler = Executors.newSingleThreadScheduledExecutor();
try {
scheduler.awaitTermination(10, TimeUnit.SECONDS);
} catch (InterruptedException e) {
- LOG.debug("Schdule stopped.", e);
+ LOG.debug("Scheduler stopped.", e);
// Restore interrupted state...
Thread.currentThread().interrupt();
}
/**
* Add NE/Mountpoint to PM Processig
- *
+ *
* @param mountPointNodeName to be added
* @param ne that is connected to the mountpoint
*/
/**
* Remove mountpoint/NE from PM process
- *
+ *
* @param mountPointNodeName that has to be removed
*/
public void deRegistration(String mountPointNodeName) {
}
}
-
/*--------------------------------------------------------------
* Task to read PM data from NE
*/
}
LOG.debug("{} start {} Start with mountpoint {}", LOGMARKER, tickCounter, mountpointName);
- //Proceed to next NE/Interface
+ // Proceed to next NE/Interface
getNextInterface(mountpointName);
LOG.debug("{} {} Next interface to handle {}", LOGMARKER, tickCounter,
databaseService.doWritePerformanceData(allPm.get().getList());
}
LOG.debug("{} {} PM List end.", LOGMARKER, tickCounter);
- } catch (Exception e) {
- StringBuffer msg = new StringBuffer();
- msg.append(e.getMessage());
- msg.append(" - ");
- msg.append(e.getCause().toString());
- msg.append(" - ");
- msg.append(actualNE.pmStatusToString());
- String msgString = msg.toString();
- LOG.warn("{} {} PM read/write failed. Write log entry {}", LOGMARKER, tickCounter, msgString);
- netconfNetworkElementService.writeToEventLog(mountpointName, "PM Problem", msgString);
+ } catch (Throwable e) {
+ LOG.debug("{} {} PM Exception", LOGMARKER, tickCounter);
+ String msg = new StringBuffer().append(e.getMessage()).toString();
+ LOG.warn("{} {} PM read/write failed. Write log entry {}", LOGMARKER, tickCounter, msg);
+ netconfNetworkElementService.writeToEventLog(mountpointName, "PM Problem", msg);
}
}
}
}
}
- } //while
+ } // while
if (actualNE != null && !queue.containsValue(actualNE)) {
LOG.debug("{} {} NE Removed duringprocessing B", LOGMARKER, tickCounter);