diff options
Diffstat (limited to 'sdnr/wt/devicemanager/model/src/main')
14 files changed, 530 insertions, 54 deletions
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 index 97eb099aa..b1dea1357 100644 --- a/sdnr/wt/devicemanager/model/src/main/yang/devicemanager.yang +++ b/sdnr/wt/devicemanager/model/src/main/yang/devicemanager.yang @@ -4,6 +4,8 @@ module devicemanager { namespace "urn:opendaylight:params:xml:ns:yang:devicemanager"; prefix "devicemanager"; + import data-provider { prefix "data-provider"; } + description "DeviceManager Api Module"; @@ -12,63 +14,14 @@ module devicemanager { "Initial revision"; } - grouping maintenance-mode-g { - leaf mountpoint-name{ - mandatory true; - type string; - description - "Mountpoint-name as key of node"; - } - leaf node-name { - mandatory true; - type string; - description - "Node-name as node"; - } - list filter { - container definition { - leaf object-id-ref { - mandatory true; - type string; - description - "object id to filter on"; - } - leaf problem { - mandatory true; - type string; - description - "name of the problem to filter"; - } - } - leaf description { - mandatory true; - type string; - description - "Node-name as node"; - } - leaf start-date { - mandatory true; - type string; - description - "begin of maintenance-mode"; - } - leaf end-date { - mandatory true; - type string; - description - "end of maintenance-mode"; - } - } - } - rpc set-maintenance-mode{ description "Set maintenance mode for network element"; input{ - uses maintenance-mode-g; + uses data-provider:maintenance-entity; } output { - uses maintenance-mode-g; + uses data-provider:maintenance-entity; } } rpc get-maintenance-mode{ @@ -83,7 +36,7 @@ module devicemanager { } } output { - uses maintenance-mode-g; + uses data-provider:maintenance-entity; } } rpc test-maintenance-mode{ @@ -118,7 +71,7 @@ module devicemanager { type string; description "Describin if mountpoint was found and result of maintenance mode testing"; } - uses maintenance-mode-g; + uses data-provider:maintenance-entity; } } rpc show-required-network-element { @@ -184,6 +137,21 @@ module devicemanager { } } } - + 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; + } + } } |