package org.opendaylight.protocol.pcep.ietf.stateful;
import java.net.InetSocketAddress;
+import org.kohsuke.MetaInfServices;
import org.opendaylight.protocol.pcep.PCEPCapability;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.ietf.stateful.app.config.rev160707.PcepIetfStatefulConfig;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.initiated.rev200720.Stateful1Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.stateful.capability.tlv.StatefulBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder;
-public class PCEPStatefulCapability implements PCEPCapability {
-
+@MetaInfServices
+public final class PCEPStatefulCapability implements PCEPCapability {
private final boolean stateful;
private final boolean active;
- private final boolean instant;
+ private final boolean intiated;
private final boolean triggeredSync;
private final boolean triggeredResync;
private final boolean deltaLspSync;
private final boolean includeDbVersion;
- public PCEPStatefulCapability(final boolean stateful, final boolean active, final boolean instant,
+ public PCEPStatefulCapability() {
+ this(true, true, true, true, true, true, true);
+ }
+
+ public PCEPStatefulCapability(final boolean stateful, final boolean active, final boolean initiated,
final boolean triggeredSync, final boolean triggeredResync, final boolean deltaLspSync,
final boolean includeDbVersion) {
this.stateful = stateful || active || triggeredSync || triggeredResync || deltaLspSync || includeDbVersion;
this.active = active;
- this.instant = instant;
+ this.intiated = initiated;
this.triggeredSync = triggeredSync;
this.triggeredResync = triggeredResync;
this.deltaLspSync = deltaLspSync;
@Override
public void setCapabilityProposal(final InetSocketAddress address, final TlvsBuilder builder) {
- if (this.stateful) {
+ if (stateful) {
builder.addAugmentation(new Tlvs1Builder()
- .setStateful(new StatefulBuilder().setLspUpdateCapability(this.active)
- .addAugmentation(new Stateful1Builder().setInitiation(this.instant).build())
+ .setStateful(new StatefulBuilder().setLspUpdateCapability(active)
+ .addAugmentation(new Stateful1Builder().setInitiation(intiated).build())
.addAugmentation(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller
.pcep.sync.optimizations.rev200720.Stateful1Builder()
- .setTriggeredInitialSync(this.triggeredSync)
- .setTriggeredResync(this.triggeredResync)
- .setDeltaLspSyncCapability(this.deltaLspSync)
- .setIncludeDbVersion(this.includeDbVersion)
+ .setTriggeredInitialSync(triggeredSync)
+ .setTriggeredResync(triggeredResync)
+ .setDeltaLspSyncCapability(deltaLspSync)
+ .setIncludeDbVersion(includeDbVersion)
.build())
.build())
.build());
@Override
public boolean isStateful() {
- return this.stateful;
+ return stateful;
}
public boolean isActive() {
- return this.active;
+ return active;
}
public boolean isInstant() {
- return this.instant;
+ return intiated;
}
public boolean isTriggeredSync() {
- return this.triggeredSync;
+ return triggeredSync;
}
public boolean isTriggeredResync() {
- return this.triggeredResync;
+ return triggeredResync;
}
public boolean isDeltaLspSync() {
- return this.deltaLspSync;
+ return deltaLspSync;
}
public boolean isIncludeDbVersion() {
- return this.includeDbVersion;
+ return includeDbVersion;
}
}