Add aaa-12 fix netconf node properties

RCA:
SOL:
修改人:maxiaonan
检视人:
This commit is contained in:
maxiaonan 2019-08-23 16:31:57 +08:00
parent 258ab7cdd4
commit ac4301942a
1 changed files with 4 additions and 3 deletions

View File

@ -98,6 +98,7 @@ public class HuaweiNetconfSpeaker implements DataTreeChangeListener<ConnectorInf
InstanceIdentifier<ConnectorInfo> connectPath = InstanceIdentifier.create(ConnectorInfo.class); InstanceIdentifier<ConnectorInfo> connectPath = InstanceIdentifier.create(ConnectorInfo.class);
final DataTreeIdentifier<ConnectorInfo> dataTreeIdentifier = new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, connectPath); final DataTreeIdentifier<ConnectorInfo> dataTreeIdentifier = new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, connectPath);
configurationReg = dataBroker.registerDataTreeChangeListener(dataTreeIdentifier, this); configurationReg = dataBroker.registerDataTreeChangeListener(dataTreeIdentifier, this);
LOG.info("HuaweiNetconfSpeaker Session Initiated");
} }
@ -105,9 +106,7 @@ public class HuaweiNetconfSpeaker implements DataTreeChangeListener<ConnectorInf
/**create netconf node with connect device information */ /**create netconf node with connect device information */
final NetconfNodeBuilder netconfNodeBuilder = new NetconfNodeBuilder(); final NetconfNodeBuilder netconfNodeBuilder = new NetconfNodeBuilder();
netconfNodeBuilder.setHost(new Host(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress(connectDevice.getIp().getIpv4Address()))) netconfNodeBuilder.setHost(new Host(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress(connectDevice.getIp().getIpv4Address())))
.setPort(new PortNumber(connectDevice.getPort().getValue())) .setPort(new PortNumber(connectDevice.getPort().getValue()));
.setTcpOnly(true)
.setSchemaless(true);
String username = connectDevice.getUserName(); String username = connectDevice.getUserName();
String password = connectDevice.getPassword(); String password = connectDevice.getPassword();
if (Strings.isNullOrEmpty(username) || Strings.isNullOrEmpty(password)) { if (Strings.isNullOrEmpty(username) || Strings.isNullOrEmpty(password)) {
@ -259,10 +258,12 @@ public class HuaweiNetconfSpeaker implements DataTreeChangeListener<ConnectorInf
readInfoFromDevice(nodeId); readInfoFromDevice(nodeId);
}, 0, 10000, TimeUnit.MILLISECONDS); }, 0, 10000, TimeUnit.MILLISECONDS);
if (Objects.nonNull(threads.get(nodeId))) { if (Objects.nonNull(threads.get(nodeId))) {
LOG.info("remove exist pool in thread map");
if (!threads.get(nodeId).isShutdown()) { if (!threads.get(nodeId).isShutdown()) {
threads.get(nodeId).shutdownNow(); threads.get(nodeId).shutdownNow();
} }
} }
LOG.info("put pool in thread map with key {}",nodeId);
threads.put(nodeId, pool); threads.put(nodeId, pool);
} }