diff --git a/ControlPlatform/driver-layer/drivers/huawei/src/main/java/com/cmcc/cmhi/huawei/impl/HuaweiDriverProvider.java b/ControlPlatform/driver-layer/drivers/huawei/src/main/java/com/cmcc/cmhi/huawei/impl/HuaweiDriverProvider.java index ca7250a11..c9cee7b6c 100644 --- a/ControlPlatform/driver-layer/drivers/huawei/src/main/java/com/cmcc/cmhi/huawei/impl/HuaweiDriverProvider.java +++ b/ControlPlatform/driver-layer/drivers/huawei/src/main/java/com/cmcc/cmhi/huawei/impl/HuaweiDriverProvider.java @@ -16,15 +16,21 @@ public class HuaweiDriverProvider { private static final Logger LOG = LoggerFactory.getLogger(HuaweiDriverProvider.class); private final DataBroker dataBroker; + private HuaweiDriverRegister register = null; //胡军 + private HuaweiNetconfSpeaker netconfSpeaker = null; //肖男 public HuaweiDriverProvider(final DataBroker dataBroker) { this.dataBroker = dataBroker; + this.register = new HuaweiDriverRegister(this.dataBroker); + this.netconfSpeaker = new HuaweiNetconfSpeaker(this.dataBroker); } /** * Method called when the blueprint container is created. */ public void init() { + //注册驱动信息 + register.register(); LOG.info("HuaweiDriverProvider Session Initiated"); } @@ -32,6 +38,8 @@ public class HuaweiDriverProvider { * Method called when the blueprint container is destroyed. */ public void close() { + //移除驱动注册信息 + register.unregister(); LOG.info("HuaweiDriverProvider Closed"); } } \ No newline at end of file diff --git a/ControlPlatform/driver-layer/drivers/huawei/src/main/java/com/cmcc/cmhi/huawei/impl/HuaweiDriverRegister.java b/ControlPlatform/driver-layer/drivers/huawei/src/main/java/com/cmcc/cmhi/huawei/impl/HuaweiDriverRegister.java new file mode 100644 index 000000000..fc522b14c --- /dev/null +++ b/ControlPlatform/driver-layer/drivers/huawei/src/main/java/com/cmcc/cmhi/huawei/impl/HuaweiDriverRegister.java @@ -0,0 +1,33 @@ +/* + * Copyright © 2019 CMCC Corporation and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package com.cmcc.cmhi.huawei.impl; + +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class HuaweiDriverRegister { + private static final Logger LOG = LoggerFactory.getLogger(HuaweiDriverRegister.class); + + private final DataBroker dataBroker; + + public HuaweiDriverRegister(DataBroker dataBroker) { + this.dataBroker = dataBroker; + } + + public void register() { + // TODO Auto-generated method stub + LOG.info("HuaweiDriverRegister has completed registration!"); + } + + public void unregister() { + // TODO Auto-generated method stub + LOG.info("HuaweiDriverRegister has completed unregistration!"); + } + +} diff --git a/ControlPlatform/driver-layer/drivers/huawei/src/main/java/com/cmcc/cmhi/huawei/impl/HuaweiNetconfSpeaker.java b/ControlPlatform/driver-layer/drivers/huawei/src/main/java/com/cmcc/cmhi/huawei/impl/HuaweiNetconfSpeaker.java new file mode 100644 index 000000000..b41a2edc4 --- /dev/null +++ b/ControlPlatform/driver-layer/drivers/huawei/src/main/java/com/cmcc/cmhi/huawei/impl/HuaweiNetconfSpeaker.java @@ -0,0 +1,20 @@ +/* + * Copyright © 2019 CMCC Corporation and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package com.cmcc.cmhi.huawei.impl; + +import org.opendaylight.controller.md.sal.binding.api.DataBroker; + +public class HuaweiNetconfSpeaker { + + private final DataBroker dataBroker; + + public HuaweiNetconfSpeaker(DataBroker dataBroker) { + this.dataBroker = dataBroker; + } + +}