diff options
Diffstat (limited to 'sdnr/wt/devicemanager/model')
15 files changed, 750 insertions, 0 deletions
diff --git a/sdnr/wt/devicemanager/model/pom.xml b/sdnr/wt/devicemanager/model/pom.xml new file mode 100644 index 000000000..d64af1a84 --- /dev/null +++ b/sdnr/wt/devicemanager/model/pom.xml @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + * ============LICENSE_START======================================================= + * ONAP : CCSDK.sdnr.wt.devicemanager.model + * ================================================================================ + * Copyright (C) 2018 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========================================================= + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.onap.ccsdk.features.sdnr.wt</groupId> + <artifactId>sdnr-wt-devicemanager-model</artifactId> + <version>0.7.0-SNAPSHOT</version> + <name>ccsdk-features-sdnr-wt :: ${project.artifactId}</name> + <packaging>bundle</packaging> + + <parent> + <groupId>org.onap.ccsdk.parent</groupId> + <artifactId>binding-parent</artifactId> + <version>1.5.1-SNAPSHOT</version> + <relativePath/> + </parent> + + <properties> + <maven.javadoc.skip>true</maven.javadoc.skip> + </properties> + + <licenses> + <license> + <name>Apache License, Version 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0</url> + </license> + </licenses> + + <dependencies> + <dependency> + <groupId>org.opendaylight.netconf</groupId> + <artifactId>sal-netconf-connector</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.onap.ccsdk.features.sdnr.wt</groupId> + <artifactId>sdnr-wt-data-provider-model</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.onap.ccsdk.features.sdnr.wt</groupId> + <artifactId>sdnr-wt-netconfnode-state-service-model</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <configuration> + <excludes> + <exclude>**/gen/**</exclude> + <exclude>**/generated-sources/**</exclude> + <exclude>**/yang-gen-sal/**</exclude> + <exclude>**/pax/**</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/DcaeForwarder.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/DcaeForwarder.java new file mode 100644 index 000000000..9dae4f354 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/DcaeForwarder.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * ============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; + +/** + * @author herbert + * + */ +public interface DcaeForwarder extends DeviceManagerService { + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/DeviceManagerService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/DeviceManagerService.java new file mode 100644 index 000000000..c6dde426a --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/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; + +/** + * 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/DeviceManagerServiceProvider.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/DeviceManagerServiceProvider.java new file mode 100644 index 000000000..dbb31ec02 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/DeviceManagerServiceProvider.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * ============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; + +import org.eclipse.jdt.annotation.NonNull; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; + +public interface DeviceManagerServiceProvider { + + /** Generic interface to provide services for smooth migration **/ + @NonNull <L extends DeviceManagerService> L getService(Class<L> clazz) throws UnkownDevicemanagerServiceException; + + /** Get a dataprovider**/ + @NonNull DataProvider getDataProvider(); + //@NonNull WebSocketServiceClient getWebSocketServiceClient(); + //@NonNull DcaeForwarder getDcaeForwarder(); + //@NonNull DevicemanagerNotificationDelayService getDevicemanagerNotificationDelayService(); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/DeviceMonitoredNe.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/DeviceMonitoredNe.java new file mode 100644 index 000000000..aab90aeab --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/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; + +/** + * @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/FactoryRegistration.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/FactoryRegistration.java new file mode 100644 index 000000000..ed51c8de1 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/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; + +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/InventoryProvider.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/InventoryProvider.java new file mode 100644 index 000000000..d68037b81 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/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; + +import org.onap.ccsdk.features.sdnr.wt.devicemanager.legacy.InventoryInformation; + +/** + * Provide Inventory information + * @author herbert + * + */ +public interface InventoryProvider extends NetworkElementService { + + public InventoryInformation getInventoryInformation(); + + public InventoryInformation getInventoryInformation(String layerProtocolFilter); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/NetconfNetworkElementService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/NetconfNetworkElementService.java new file mode 100644 index 000000000..df9d34745 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/NetconfNetworkElementService.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * ============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; + +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.concepts.Registration; + +public interface NetconfNetworkElementService extends Registration { + + /** Register factory class for network-element handler **/ + @NonNull <L extends NetworkElementFactory> FactoryRegistration<L> registerNetworkElementFactory(@NonNull L factory); + + /** Get Devicemanager service **/ + DeviceManagerServiceProvider getServiceProvider(); + + /** Write to centrla 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/NetworkElement.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/NetworkElement.java new file mode 100644 index 000000000..e0fafb3e0 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/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; + +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 { + + /** 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/NetworkElementFactory.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/NetworkElementFactory.java new file mode 100644 index 000000000..3ce932846 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/NetworkElementFactory.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * ============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; + +import java.util.Optional; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.INetconfAcessor; + +public interface NetworkElementFactory { + + Optional<NetworkElement> create(INetconfAcessor acessor, DeviceManagerServiceProvider serviceProvider); + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/NetworkElementService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/NetworkElementService.java new file mode 100644 index 000000000..eb9db97be --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/NetworkElementService.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; + +/** + * Marker interface for service interface of a network element + */ +public interface NetworkElementService { + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/UnkownDevicemanagerServiceException.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/UnkownDevicemanagerServiceException.java new file mode 100644 index 000000000..034b0fc4c --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/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; + +public class UnkownDevicemanagerServiceException extends Exception { + + private static final long serialVersionUID = 1L; + + public UnkownDevicemanagerServiceException(String string, Class<?> serviceInterface) { + super(string+" "+serviceInterface.getName()); + } + + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/WebSocketServiceClient.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/WebSocketServiceClient.java new file mode 100644 index 000000000..480dd04f2 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/WebSocketServiceClient.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; + +/** + * Handle status changes and notifications + */ +public interface WebSocketServiceClient extends DeviceManagerService { + +} diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/legacy/InventoryInformation.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/legacy/InventoryInformation.java new file mode 100644 index 000000000..a3281f873 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/legacy/InventoryInformation.java @@ -0,0 +1,130 @@ +/******************************************************************************* + * ============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.legacy; + +import java.util.ArrayList; +import java.util.List; + +public class InventoryInformation { + + private static final String UNKNOWN = "unknown"; + private static final List<String> EMPTY = new ArrayList<>(); + private static final InventoryInformation DEFAULT = new InventoryInformation(); + + private String type; + private String model; + private String vendor; + private String deviceIpv4; + private String deviceIpv6; + private List<String> interfaceUuidList; + + public InventoryInformation() + { + this.type=UNKNOWN; + this.model=UNKNOWN; + this.vendor=UNKNOWN; + this.deviceIpv4=UNKNOWN; + this.deviceIpv6=UNKNOWN; + this.interfaceUuidList=EMPTY; + } + + public InventoryInformation(InventoryInformation 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 InventoryInformation( + 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 InventoryInformation setType(String type) { + this.type = type != null ? type : UNKNOWN; + return this; + } + + public InventoryInformation setModel(String model) { + this.model = model != null ? model : UNKNOWN; + return this; + } + + public InventoryInformation setVendor(String vendor) { + this.vendor = vendor != null ? vendor : UNKNOWN; + return this; + } + + public InventoryInformation setDeviceIpv4(String deviceIpv4) { + this.deviceIpv4 = deviceIpv4 != null ? deviceIpv4 : UNKNOWN; + return this; + } + + public InventoryInformation setDeviceIpv6(String deviceIpv6) { + this.deviceIpv6 = deviceIpv6 != null ? deviceIpv6 : UNKNOWN ; + return this; + } + + public InventoryInformation setInterfaceUuidList(List<String> interfaceUuidList) { + this.interfaceUuidList = interfaceUuidList != null ? interfaceUuidList : EMPTY; + return this; + } + + public static InventoryInformation 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/yang/devicemanager.yang b/sdnr/wt/devicemanager/model/src/main/yang/devicemanager.yang new file mode 100644 index 000000000..b1dea1357 --- /dev/null +++ b/sdnr/wt/devicemanager/model/src/main/yang/devicemanager.yang @@ -0,0 +1,157 @@ +module devicemanager { + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:devicemanager"; + prefix "devicemanager"; + + import data-provider { prefix "data-provider"; } + + description + "DeviceManager Api Module"; + + revision "2019-01-09" { + description + "Initial revision"; + } + + rpc set-maintenance-mode{ + description + "Set maintenance mode for network element"; + input{ + uses data-provider:maintenance-entity; + } + output { + uses data-provider:maintenance-entity; + } + } + rpc get-maintenance-mode{ + description + "Get maintenance mode Configuration"; + input{ + leaf mountpoint-name{ + mandatory true; + type string; + description + "Mountpoint-name as key of node"; + } + } + output { + uses data-provider:maintenance-entity; + } + } + rpc test-maintenance-mode{ + description + "Send test pattern similar to notification that are test from algorithm"; + input{ + leaf mountpoint-name { + mandatory true; + type string; + description "mountpoint for test"; + } + leaf object-id-ref { + mandatory true; + type string; + description "object id for test"; + } + leaf problem-name { + mandatory true; + type string; + description "problem for test"; + } + leaf test-date { + mandatory true; + type string; + description "point in time used for the test"; + } + + } + output { + leaf result-string { + mandatory true; + type string; + description "Describin if mountpoint was found and result of maintenance mode testing"; + } + uses data-provider:maintenance-entity; + } + } + rpc show-required-network-element { + description + "Get information for required network element"; + + input { + leaf mountpoint-name { + mandatory true; + type string; + description + "Mountpoint-name as key of the node to be displayed."; + } + } + output { + container required-network-element { + leaf mountpoint-name { + type string; + description + "The name of the mountpoint"; + } + leaf status { + type string; + description + "Status: pre-provisoning, installed, end-of-life (Later enum)"; + } + leaf description { + type string; + description "Device description"; + } + } + } + } + + rpc get-required-network-element-keys { + description + "Returns a list of netconf nodes for each data store space"; + + output { + leaf-list mountpoint-names { + type string; + description + "List of required-network-element keys that are the mountpoint-names"; + } + } + } + + rpc clear-current-fault-by-nodename { + description + "try to clear alarms and sync the alarm with the devices currently connected"; + input { + leaf-list nodenames { + type string; + description + "list of network-elements to clear alarms for nodenames, if list empty then all"; + } + } + output { + leaf-list nodenames { + type string; + description + "list of network-elements alarms cleared"; + } + } + } + rpc push-fault-notification { + description + "Forward fault problem notification of a network-element"; + input { + uses data-provider:object-change-reference; + uses data-provider:fault; + } + } + rpc push-attribute-change-notification { + description + "Forward attribute change notification of a network-element"; + input { + uses data-provider:object-change-reference; + uses data-provider:attribute-change; + } + } +} + |