private NetconfSessionEndImpl(NetconfSessionEndBuilder base) { this._killedBy = base.getKilledBy(); this._sessionId = base.getSessionId(); this._sourceHost = base.getSourceHost(); this._terminationReason = base.getTerminationReason(); this._username = base.getUsername(); switch (base.augmentation.size()) { case 0: this.augmentation = Collections.emptyMap(); break; case 1: final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionEnd>>, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionEnd>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionEnd>>, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionEnd>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public NetconfSessionEndBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionEnd>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionEnd> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
private void publishEndedSession(DataObject dataObject) { Preconditions.checkArgument(dataObject instanceof Session); Session session = (Session) dataObject; final NetconfSessionEnd sessionEnd = new NetconfSessionEndBuilder() .setSessionId(new SessionIdOrZeroType(session.getSessionId())) .setSourceHost(session.getSourceHost().getIpAddress()) .setUsername(session.getUsername()) .build(); baseNotificationPublisherRegistration.onSessionEnded(sessionEnd); }