use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.speaker.entity.id.tlv.SpeakerEntityId in project bgpcep by opendaylight.
the class SessionStateImpl method init.
public synchronized void init(final PCEPSessionState session) {
requireNonNull(session);
this.pcepSessionState = session;
final Open localOpen = session.getLocalOpen();
if (localOpen.getTlvs() != null && localOpen.getTlvs().getAugmentation(Tlvs3.class) != null) {
final SpeakerEntityId entityId = localOpen.getTlvs().getAugmentation(Tlvs3.class).getSpeakerEntityId();
if (entityId != null) {
this.localPref = new LocalPrefBuilder(session.getLocalPref()).addAugmentation(PcepEntityIdStatsAug.class, new PcepEntityIdStatsAugBuilder(entityId).build()).build();
}
} else {
this.localPref = session.getLocalPref();
}
this.peerPref = session.getPeerPref();
this.sessionUpDuration.start();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.speaker.entity.id.tlv.SpeakerEntityId in project bgpcep by opendaylight.
the class SpeakerEntityIdTlvParser method serializeTlv.
@Override
public void serializeTlv(final Tlv tlv, final ByteBuf buffer) {
Preconditions.checkArgument(tlv instanceof SpeakerEntityId, "Tlv object is not instance of SpeakerEntityId.");
final ByteBuf body = Unpooled.buffer();
body.writeBytes(((SpeakerEntityId) tlv).getSpeakerEntityIdValue());
TlvUtil.formatTlv(TYPE, body, buffer);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.speaker.entity.id.tlv.SpeakerEntityId in project bgpcep by opendaylight.
the class SyncOptimizationsOpenObjectParser method addTlv.
@Override
public void addTlv(final TlvsBuilder tbuilder, final Tlv tlv) {
super.addTlv(tbuilder, tlv);
final Tlvs3Builder syncOptTlvsBuilder = new Tlvs3Builder();
if (tbuilder.getAugmentation(Tlvs3.class) != null) {
final Tlvs3 t = tbuilder.getAugmentation(Tlvs3.class);
if (t.getLspDbVersion() != null) {
syncOptTlvsBuilder.setLspDbVersion(t.getLspDbVersion());
}
if (t.getSpeakerEntityId() != null) {
syncOptTlvsBuilder.setSpeakerEntityId(t.getSpeakerEntityId());
}
}
if (tlv instanceof LspDbVersion) {
syncOptTlvsBuilder.setLspDbVersion((LspDbVersion) tlv);
}
if (tlv instanceof SpeakerEntityId) {
syncOptTlvsBuilder.setSpeakerEntityId((SpeakerEntityId) tlv);
}
tbuilder.addAugmentation(Tlvs3.class, syncOptTlvsBuilder.build());
}
Aggregations