diff options
author | herbert <herbert.eiselt@highstreet-technologies.com> | 2020-01-30 12:08:35 +0100 |
---|---|---|
committer | Herbert Eiselt <herbert.eiselt@highstreet-technologies.com> | 2020-02-01 12:42:06 +0000 |
commit | 149a57edf72762c7e0eb4062851c06356e6a75ab (patch) | |
tree | 0f6bf0087a2a82c637bb249ab09561f58202b969 /sdnr/wt/devicemanager/model/src/main/java | |
parent | 8fb01420d6e5b5c3284da57292e28ce40874aaf4 (diff) |
SDN-R add updated devicemanager
add updated devicemanager and specific devicemanagers
Issue-ID: SDNC-1039
Signed-off-by: herbert <herbert.eiselt@highstreet-technologies.com>
Change-Id: I16f4c8d78da95ab12dbb50e50dfb561a85e8d6a2
Signed-off-by: herbert <herbert.eiselt@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager/model/src/main/java')
25 files changed, 1222 insertions, 0 deletions
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/factory/FactoryRegistration.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/factory/FactoryRegistration.java new file mode 100644 index 000000000..c83f706cc --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/factory/FactoryRegistration.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * ============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.ne.factory; + +import org.opendaylight.yangtools.concepts.ObjectRegistration; + +public interface FactoryRegistration<T> extends ObjectRegistration<T> { +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/factory/NetworkElementFactory.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/factory/NetworkElementFactory.java new file mode 100644 index 000000000..12048e929 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/factory/NetworkElementFactory.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * ============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.ne.factory; + +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; + +public interface NetworkElementFactory { + + Optional<NetworkElement> create(@NonNull NetconfAccessor acessor, @NonNull DeviceManagerServiceProvider serviceProvider); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/DeviceMonitoredNe.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/DeviceMonitoredNe.java new file mode 100644 index 000000000..e386ad342 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/DeviceMonitoredNe.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * ============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.ne.service; + +/** + * @author herbert + * + */ +public interface DeviceMonitoredNe extends NetworkElementService { + + /** + * Prepare subsequent check calls + */ + public void prepareCheck(); + + /** + * Test connection to mediator, by getting data that have to be called from NE + * @return true if connection working, false if not + */ + public boolean checkIfConnectionToMediatorIsOk(); + + /** + * Test connection to NE via mediator, by getting data that have to be called from NE + * @return true if connection working, false if not + */ + public boolean checkIfConnectionToNeIsOk(); + + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/InventoryProvider.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/InventoryProvider.java new file mode 100644 index 000000000..4275e0a77 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/InventoryProvider.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * ============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.ne.service; + +import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.InventoryInformationDcae; + +/** + * Provide Inventory information + * @author herbert + * + */ +public interface InventoryProvider extends NetworkElementService { + + public InventoryInformationDcae getInventoryInformation(); + + public InventoryInformationDcae getInventoryInformation(String layerProtocolFilter); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/NetworkElement.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/NetworkElement.java new file mode 100644 index 000000000..180ca4301 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/NetworkElement.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * ============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.ne.service; + +import java.util.Optional; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementDeviceType; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; + +public interface NetworkElement extends NetworkElementService { + + /** Register networkelement at all services **/ + void register(); + + /** Deregister networkelement at all services **/ + void deregister(); + + /** Do a warmstart of the handler e.g.clean up database and refresh alarm status **/ + void warmstart(); + + /** node-id also nodeName, mountpointName. Uuid. **/ + NodeId getNodeId(); + + /** self selected device type **/ + NetworkElementDeviceType getDeviceType(); + + /** Provide optional service interface. + * Services: + * InventoryProvider.class + * DeviceMonitoredNe.class + **/ + <L extends NetworkElementService> Optional<L> getService(Class<L> clazz); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/NetworkElementService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/NetworkElementService.java new file mode 100644 index 000000000..e5dc99230 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/NetworkElementService.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * ============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.ne.service; + +import java.util.Optional; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; + +/** + * Marker interface for service interface of a network element + */ +public interface NetworkElementService { + + /** provide acessor **/ + Optional<NetconfAccessor> getAcessor(); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/PerformanceDataProvider.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/PerformanceDataProvider.java new file mode 100644 index 000000000..3a69e48ba --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/PerformanceDataProvider.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * ============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.ne.service; + +import java.util.Optional; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp; + +/** + * Identify the NE as provider for performance data according to microwave model. + */ + +public interface PerformanceDataProvider extends NetworkElementService { + + public void resetPMIterator(); + + public boolean hasNext(); + + public void next(); + + public Optional<PerformanceDataLtp> getLtpHistoricalPerformanceData(); + + public String pmStatusToString(); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/AaiService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/AaiService.java new file mode 100644 index 000000000..61011a950 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/AaiService.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * ============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.service; + +/** + * Forward to Active and Available Inventory + */ +public interface AaiService extends DeviceManagerService { + + /** + * @param mountPointNodeName + */ + void onDeviceRegistered(String mountPointNodeName); + + /** + * @param mountPointNodeName + */ + void onDeviceUnregistered(String mountPointNodeName); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/DeviceManagerService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/DeviceManagerService.java new file mode 100644 index 000000000..e6cba4866 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/DeviceManagerService.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * ============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.service; + +/** + * Marker Interface for common devicemanager services + */ +public interface DeviceManagerService { + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/DeviceManagerServiceProvider.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/DeviceManagerServiceProvider.java new file mode 100644 index 000000000..6d70742db --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/DeviceManagerServiceProvider.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * ============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.service; + +import org.eclipse.jdt.annotation.NonNull; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; + +public interface DeviceManagerServiceProvider { + + /** @return Get a dataprovider**/ + @NonNull DataProvider getDataProvider(); + + /** @return Get notification service **/ + @NonNull NotificationService getNotificationService(); + + /** @return Get service for handling fault **/ + @NonNull FaultService getFaultService(); + + /** @return Get service for handling fault **/ + @NonNull EquipmentService getEquipmentService(); + + /** @return Get Active and available inventory service */ + @NonNull AaiService getAaiService(); + + /** @return MaintenanceService object for maintenance service */ + @NonNull MaintenanceService getMaintenanceService(); + + /** @return related service instance */ + @NonNull + PerformanceManager getPerformanceManagerService(); + + /** @return Event Handling service */ + @NonNull + EventHandlingService getEventHandlingService(); +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/EquipmentService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/EquipmentService.java new file mode 100644 index 000000000..2762c4519 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/EquipmentService.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * ============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.service; + +import org.eclipse.jdt.annotation.NonNull; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerService; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.EquipmentData; + +/** + * @author herbert + * + */ +public interface EquipmentService extends DeviceManagerService { + + /** + * Write equipment to database + * @param equipment with all equipment entities (card, subrack) of device + */ + void writeEquipment(@NonNull EquipmentData equipment); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/EventHandlingService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/EventHandlingService.java new file mode 100644 index 000000000..1af2106d7 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/EventHandlingService.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * ============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.service; + +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementDeviceType; + +/** + * Event Forwarding for central event management by devicemanager + */ +public interface EventHandlingService { + + /** + * @param mountPointNodeName + * @param deviceType + */ + void connectIndication(String mountPointNodeName, NetworkElementDeviceType deviceType); + + /** + * @param mountPointNodeName + */ + void deRegistration(String mountPointNodeName); + + /** + * + * @param registrationName + * @param attribute + * @param attributeNewValue + * @param nNode + */ + void updateRegistration(String registrationName, String attribute, String attributeNewValue, NetconfNode nNode); + + /** + * @param nodeIdString + * @param nNode + */ + void registration(String nodeIdString, NetconfNode nNode); + + /** + * @param objectId + * @param msg + * @param value + */ + void writeEventLog(String objectId, String msg, String value); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/FaultService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/FaultService.java new file mode 100644 index 000000000..3ea2ac395 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/FaultService.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * ============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.service; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +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.rev190801.FaultlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; + +/** + * + */ +public interface FaultService extends DeviceManagerService { + + /** Notify fault information to devicemanager + * @param faultNotification to send + */ + void faultNotification(@NonNull FaultlogEntity faultNotification); + + /** + * Fault notification + * @param nodeId of node + * @param counter provided + * @param timeStamp provided + * @param objectId provided + * @param problem provided + * @param severity provided + */ + void faultNotification(@NonNull NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp, @Nullable String objectId, + @Nullable String problem, @Nullable SeverityType severity); + + /** + * Remove current problems of node + * @param nodeId of node + * @return number of removed entries + */ + int removeAllCurrentProblemsOfNode(@NonNull NodeId nodeId); + + /** + * Write initial list of problems of node + * @param nodeId of node + * @param resultList + */ + void initCurrentProblemStatus(@NonNull NodeId nodeId, FaultData resultList); + + /** + * @param nodeId of node + * @param objectId of element to be removed + * @return number of removed items + */ + int removeObjectsCurrentProblemsOfNode(@NonNull NodeId nodeId, @NonNull String objectId); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/MaintenanceService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/MaintenanceService.java new file mode 100644 index 000000000..60bf24476 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/MaintenanceService.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * ============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.service; + +public interface MaintenanceService extends DeviceManagerService { + + /** + * Verify maintenance state of given object according to the filter settings. + * The object is specified by the criteria provided in the parameters. + * The data _id (uuid) is equal to the mountpointReference. + * @param mountpointReference used as reference, to query the data from database. + * @param objectIdRef first level id in onf core model, delivered by notification objectid + * @param problem problem name of device, delivered in problem notification + * @return boolean indication + */ + boolean isONFObjectInMaintenance(String mountpointReference, String objectIdRef, String problem); + + /** + * @param mountPointNodeName + */ + void createIfNotExists(String mountPointNodeName); + + /** + * @param mountPointNodeName + */ + void deleteIfNotRequired(String mountPointNodeName); + + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NetconfNetworkElementService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NetconfNetworkElementService.java new file mode 100644 index 000000000..ecc80ba4d --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NetconfNetworkElementService.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * ============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.service; + +import org.eclipse.jdt.annotation.NonNull; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.factory.FactoryRegistration; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.factory.NetworkElementFactory; +import org.opendaylight.yangtools.concepts.Registration; + +public interface NetconfNetworkElementService extends Registration, DeviceManagerService { + + /** Register factory class for network-element handler **/ + @NonNull <L extends NetworkElementFactory> FactoryRegistration<L> registerNetworkElementFactory(@NonNull L factory); + + /** Get Devicemanager service **/ + DeviceManagerServiceProvider getServiceProvider(); + + /** Write to central devicemanager eventlog **/ + void writeToEventLog(String objectId, String msg, String value); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NotificationService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NotificationService.java new file mode 100644 index 000000000..9bd81da53 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NotificationService.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * ============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.service; + +import org.eclipse.jdt.annotation.NonNull; +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.rev190801.EventlogEntity; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; + +/** + * Central notification management of devicemanager + */ +public interface NotificationService extends DeviceManagerService { + + + /** Event notification to devicemanager. Can be change, create or remove indication **/ + void eventNotification(@NonNull EventlogEntity eventNotification); + + /** create notification for an object **/ + void creationNotification(NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp, @Nullable String objectId); + + /** create notification of object **/ + void deletionNotification(NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp, + @Nullable String objectId); + + /** change notification of attribute of object + * @param nodeId of device + * @param counter provided + * @param timeStamp provided + * @param objectId provided + * @param attributeName provided + * @param newValue provided + */ + void changeNotification(NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp, + @Nullable String objectId, @Nullable String attributeName, @Nullable String newValue); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/PerformanceManager.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/PerformanceManager.java new file mode 100644 index 000000000..d05ecf1bd --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/PerformanceManager.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * ============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.service; + +import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement; + +/** + * @author herbert + * + */ +public interface PerformanceManager extends DeviceManagerService { + + /** + * @param mountPointNodeName + * @param ne + */ + void registration(String mountPointNodeName, NetworkElement ne); + + /** + * @param mountPointNodeName + */ + void deRegistration(String mountPointNodeName); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/EquipmentData.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/EquipmentData.java new file mode 100644 index 000000000..b5f196c9a --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/EquipmentData.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * ============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 java.util.ArrayList; +import java.util.List; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Inventory; + +/** + * Inventory means here equipment related information. This could be card, subrack. + * + */ +public class EquipmentData { + + private final @NonNull List<Inventory> equipmentList; + + public EquipmentData() { + equipmentList = new ArrayList<>(); + } + + public void clear() { + equipmentList.clear(); + } + + /** + * @param entity with one elements data + */ + public void add(Inventory entity) { + equipmentList.add(entity); + } + + /** + * @return true for empty list or false if elements in the list. + */ + public boolean isEmpty() { + return equipmentList.isEmpty(); + } + + /** + * @param i index + * @return Inventory from index + */ + public Inventory get(int i) { + return equipmentList.get(i); + } + + /** + * Get list with all equipment + * @return list with equipment + */ + public List<Inventory> getList() { + return equipmentList; + } + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/EventlogNotificationBuilder.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/EventlogNotificationBuilder.java new file mode 100644 index 000000000..756027f6e --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/EventlogNotificationBuilder.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * ============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.rev190801.EventlogBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; + +/** + * Add specific constructor + */ +public class EventlogNotificationBuilder extends EventlogBuilder { + + public EventlogNotificationBuilder(NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp, + @Nullable String objectId, @Nullable String attributeName, @Nullable String newValue) { + + setNodeId(nodeId.getValue()); + if (counter != null) { + setCounter(counter); + } + if (timeStamp != null) { + setTimestamp(timeStamp); + } + setObjectId(objectId); + setAttributeName(attributeName); + setNewValue(newValue); + + } + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultData.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultData.java new file mode 100644 index 000000000..389a550b1 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultData.java @@ -0,0 +1,101 @@ +/******************************************************************************* + * ============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 java.util.ArrayList; +import java.util.List; +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.rev190801.Faultlog; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SourceType; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.slf4j.Logger; + +/** + * Fault information + */ +public class FaultData { + + private final List<Faultlog> problemList = new ArrayList<>(); + + /** + * @return + */ + public int size() { + return problemList.size(); + } + + /** + * @param log + * @param value + * @param resultList + * @param idxStart + */ + public static void debugResultList(Logger log, String value, FaultData resultList, int idxStart) { + // TODO Auto-generated method stub + + } + + /** + * @param nodeId of device + * @param sequenceNumber given by device + * @param timeStamp of occurence + * @param objectReference uuid in ONF model + * @param problemName of object + * @param severity of problem + */ + public void add(NodeId nodeId, @Nullable Integer sequenceNumber, @Nullable DateAndTime timeStamp, + @Nullable String objectReference, @Nullable String problemName, @Nullable SeverityType severity) { + FaultlogBuilder bFaullog = new FaultlogBuilder().setNodeId(nodeId.getValue()).setCounter(sequenceNumber) + .setTimestamp(timeStamp).setObjectId(objectReference).setProblem(problemName).setSeverity(severity); + bFaullog.setSourceType(SourceType.Netconf); + problemList.add(bFaullog.build()); + } + + /** + * @param globalProblemList to add + */ + public void addAll(FaultData globalProblemList) { + problemList.addAll(globalProblemList.problemList); + } + + /** + * + */ + public void clear() { + } + + /** + * @param idx of element to get + * @return Faultlog the element + */ + public Faultlog get(int idx) { + return problemList.get(idx); + } + + /** + * Provide list with all problems of node + * @return list + */ + public List<Faultlog> getProblemList() { + return problemList; + } + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultNotificationBuilder2.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultNotificationBuilder2.java new file mode 100644 index 000000000..933f6770e --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultNotificationBuilder2.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * ============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.rev190801.FaultlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.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); + } + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InternalConnectionStatus.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InternalConnectionStatus.java new file mode 100644 index 000000000..6407570a4 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InternalConnectionStatus.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * ============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.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus.ConnectionStatus; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionLogStatus; + +public class InternalConnectionStatus { + public static ConnectionLogStatus statusFromNodeStatus(ConnectionStatus nodeStatus) { + switch(nodeStatus) { + case Connected: + return ConnectionLogStatus.Connected; + case Connecting: + return ConnectionLogStatus.Connecting; + case UnableToConnect: + return ConnectionLogStatus.UnableToConnect; + default: + return ConnectionLogStatus.Undefined; + } + } +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InventoryInformationDcae.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InventoryInformationDcae.java new file mode 100644 index 000000000..a29f8d444 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InventoryInformationDcae.java @@ -0,0 +1,133 @@ +/******************************************************************************* + * ============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 java.util.ArrayList; +import java.util.List; + +/** + * Inventory information of a device, used by DCAE + */ +public class InventoryInformationDcae { + + private static final String UNKNOWN = "unknown"; + private static final List<String> EMPTY = new ArrayList<>(); + private static final InventoryInformationDcae DEFAULT = new InventoryInformationDcae(); + + private String type; + private String model; + private String vendor; + private String deviceIpv4; + private String deviceIpv6; + private List<String> interfaceUuidList; + + public InventoryInformationDcae() + { + this.type=UNKNOWN; + this.model=UNKNOWN; + this.vendor=UNKNOWN; + this.deviceIpv4=UNKNOWN; + this.deviceIpv6=UNKNOWN; + this.interfaceUuidList=EMPTY; + } + + public InventoryInformationDcae(InventoryInformationDcae inventoryInformation) { + this.type=inventoryInformation.type; + this.model=inventoryInformation.model; + this.vendor=inventoryInformation.vendor; + this.deviceIpv4=inventoryInformation.deviceIpv4; + this.deviceIpv6=inventoryInformation.deviceIpv6; + this.interfaceUuidList=new ArrayList<>(inventoryInformation.interfaceUuidList); + } + + public InventoryInformationDcae( + String type, String model, String vendor, String deviceIpv4, + String deviceIpv6, List<String> interfaceUuidList) { + setType(type); + setModel(model); + setVendor(vendor); + setDeviceIpv4(deviceIpv4); + setDeviceIpv6(deviceIpv6); + setInterfaceUuidList(interfaceUuidList); + } + + public String getType() { + return type; + } + + public String getModel() { + return model; + } + + public String getVendor() { + return vendor; + } + + public String getDeviceIpv4() { + return deviceIpv4; + } + + public String getDeviceIpv6() { + return deviceIpv6; + } + + public List<String> getInterfaceUuidList() { + return interfaceUuidList; + } + + public InventoryInformationDcae setType(String type) { + this.type = type != null ? type : UNKNOWN; + return this; + } + + public InventoryInformationDcae setModel(String model) { + this.model = model != null ? model : UNKNOWN; + return this; + } + + public InventoryInformationDcae setVendor(String vendor) { + this.vendor = vendor != null ? vendor : UNKNOWN; + return this; + } + + public InventoryInformationDcae setDeviceIpv4(String deviceIpv4) { + this.deviceIpv4 = deviceIpv4 != null ? deviceIpv4 : UNKNOWN; + return this; + } + + public InventoryInformationDcae setDeviceIpv6(String deviceIpv6) { + this.deviceIpv6 = deviceIpv6 != null ? deviceIpv6 : UNKNOWN ; + return this; + } + + public InventoryInformationDcae setInterfaceUuidList(List<String> interfaceUuidList) { + this.interfaceUuidList = interfaceUuidList != null ? interfaceUuidList : EMPTY; + return this; + } + + public static InventoryInformationDcae getDefault() { + return DEFAULT; + } + + @Override + public String toString() { + return "InventoryInformation [type=" + type + ", model=" + model + ", vendor=" + vendor + ", deviceIpv4=" + + deviceIpv4 + ", deviceIpv6=" + deviceIpv6 + ", interfaceUuidList=" + interfaceUuidList + "]"; + } + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/PerformanceDataLtp.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/PerformanceDataLtp.java new file mode 100644 index 000000000..8eef46779 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/PerformanceDataLtp.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * ============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 java.util.ArrayList; +import java.util.List; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntityBuilder; + +/** + * @author herbert + * + */ +public class PerformanceDataLtp { + + private final List<PmdataEntity> pmList = new ArrayList<>(); + + public void add(PmdataEntity entry) { + pmList.add(entry); + } + + public void add(PmdataEntityBuilder entryBuilder) { + pmList.add(entryBuilder.build()); + } + + /** + * @return int number of elements + */ + public int size() { + return pmList.size(); + } + + public List<PmdataEntity> getList() { + return pmList; + } + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/util/UnkownDevicemanagerServiceException.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/util/UnkownDevicemanagerServiceException.java new file mode 100644 index 000000000..ce1250141 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/util/UnkownDevicemanagerServiceException.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * ============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.util; + +public class UnkownDevicemanagerServiceException extends Exception { + + private static final long serialVersionUID = 1L; + + public UnkownDevicemanagerServiceException(String string, Class<?> serviceInterface) { + super(string+" "+serviceInterface.getName()); + } + + +} |