protected PathConstraints constraints = null;
/* Priority Queue and HashMap to manage path computation */
- protected PriorityQueue<CspfPath> priorityQueue;
- protected HashMap<Long, CspfPath> processedPath;
+ protected final PriorityQueue<CspfPath> priorityQueue = new PriorityQueue<>();
+ protected final HashMap<Long, CspfPath> processedPath = new HashMap<>();
- protected AbstractPathComputation(ConnectedGraph graph) {
+ protected AbstractPathComputation(final ConnectedGraph graph) {
this.graph = graph;
- priorityQueue = new PriorityQueue<CspfPath>();
- processedPath = new HashMap<Long, CspfPath>();
}
/**
* @return Constrained Path Builder with status set to 'OnGoing' if
* initialization success, 'Failed' otherwise
*/
- protected ConstrainedPathBuilder initializePathComputation(VertexKey src, VertexKey dst) {
+ protected ConstrainedPathBuilder initializePathComputation(final VertexKey src, final VertexKey dst) {
ConstrainedPathBuilder cpathBuilder = new ConstrainedPathBuilder().setStatus(ComputationStatus.InProgress);
/* Check that source and destination vertexKey are not identical */
*
* @return True if Edge must be prune, False if Edge must be keep
*/
- protected boolean pruneEdge(ConnectedEdge edge, CspfPath path) {
+ protected boolean pruneEdge(final ConnectedEdge edge, final CspfPath path) {
/* Check that Constraints are initialized */
if (constraints == null) {
LOG.warn("Constraints not set");
}
/* Edge could point to an unknown Vertex e.g. with inter-domain link */
- if ((edge.getDestination() == null) || (edge.getDestination().getVertex() == null)) {
+ if (edge.getDestination() == null || edge.getDestination().getVertex() == null) {
LOG.debug("No Destination");
return true;
}
/* Check that Edge belongs to the requested address family */
switch (constraints.getAddressFamily()) {
case Ipv4:
- if ((attributes.getRemoteAddress() == null)
- || (attributes.getRemoteAddress().getIpv4Address() == null)) {
+ if (attributes.getRemoteAddress() == null
+ || attributes.getRemoteAddress().getIpv4Address() == null) {
LOG.debug("No Ipv4 address");
return true;
}
break;
case Ipv6:
- if ((attributes.getRemoteAddress() == null)
- || (attributes.getRemoteAddress().getIpv6Address() == null)) {
+ if (attributes.getRemoteAddress() == null
+ || attributes.getRemoteAddress().getIpv6Address() == null) {
LOG.debug("No Ipv6 address");
return true;
}
/* Check that Edge respect Loss constraint */
if (constraints.getLoss() != null) {
- if ((attributes.getLoss() == null)
- || (attributes.getLoss().getValue().intValue() > constraints.getLoss().getValue().intValue())) {
+ if (attributes.getLoss() == null
+ || attributes.getLoss().getValue().intValue() > constraints.getLoss().getValue().intValue()) {
return true;
}
}
/* Check that Edge meet Bandwidth constraint */
if (constraints.getBandwidth() != null) {
- if ((attributes.getMaxLinkBandwidth() == null) || (attributes.getMaxResvLinkBandwidth() == null)
- || (attributes.getUnreservedBandwidth() == null)
- || (attributes.getUnreservedBandwidth().get(constraints.getClassType().intValue()) == null)) {
+ if (attributes.getMaxLinkBandwidth() == null || attributes.getMaxResvLinkBandwidth() == null
+ || attributes.getUnreservedBandwidth() == null
+ || attributes.getUnreservedBandwidth().get(constraints.getClassType().intValue()) == null) {
return true;
} else {
Long bandwidth = constraints.getBandwidth().getValue().longValue();
}
/* Check that Edge belongs to admin group */
- if ((constraints.getAdminGroup() != null)
- && !(constraints.getAdminGroup().equals(attributes.getAdminGroup()))) {
+ if (constraints.getAdminGroup() != null
+ && !constraints.getAdminGroup().equals(attributes.getAdminGroup())) {
LOG.debug("Not in the requested admin-group");
return true;
}
* @return MPLS Label if Connected Vertex is Segment Routing aware, Null
* otherwise
*/
- protected @Nullable MplsLabel getIpv4NodeSid(ConnectedVertex cvertex) {
+ protected @Nullable MplsLabel getIpv4NodeSid(final ConnectedVertex cvertex) {
/*
* Check that Vertex is Segment Routing aware
*/
- if ((cvertex.getVertex() == null) || (cvertex.getVertex().getSrgb() == null)) {
+ if (cvertex.getVertex() == null || cvertex.getVertex().getSrgb() == null) {
return null;
}
/*
return null;
}
for (Prefix prefix : cvertex.getPrefixes()) {
- if ((prefix.getPrefixSid() == null) || (prefix.isNodeSid() == null)) {
+ if (prefix.getPrefixSid() == null || prefix.getNodeSid() == null) {
continue;
}
- if (prefix.isNodeSid() && prefix.getPrefix().getIpv4Prefix() != null) {
+ if (prefix.getNodeSid() && prefix.getPrefix().getIpv4Prefix() != null) {
return new MplsLabel(Uint32.valueOf(prefix.getPrefixSid().intValue()));
}
}
* @return MPLS Label if Connected Vertex is Segment Routing aware, Null
* otherwise
*/
- protected @Nullable MplsLabel getIpv6NodeSid(ConnectedVertex cvertex) {
+ protected @Nullable MplsLabel getIpv6NodeSid(final ConnectedVertex cvertex) {
/*
* Check that Vertex is Segment Routing aware
*/
- if ((cvertex.getVertex() == null) || (cvertex.getVertex().getSrgb() == null)) {
+ if (cvertex.getVertex() == null || cvertex.getVertex().getSrgb() == null) {
return null;
}
/*
return null;
}
for (Prefix prefix : cvertex.getPrefixes()) {
- if ((prefix.getPrefixSid() == null) || (prefix.isNodeSid() == null)) {
+ if (prefix.getPrefixSid() == null || prefix.getNodeSid() == null) {
continue;
}
- if (prefix.isNodeSid() && prefix.getPrefix().getIpv6Prefix() != null) {
+ if (prefix.getNodeSid() && prefix.getPrefix().getIpv6Prefix() != null) {
return new MplsLabel(Uint32.valueOf(prefix.getPrefixSid().intValue()));
}
}
*
* @return Path Description
*/
- protected List<PathDescription> getPathDescription(List<ConnectedEdge> edges) {
- ArrayList<PathDescription> list = new ArrayList<PathDescription>();
+ protected List<PathDescription> getPathDescription(final List<ConnectedEdge> edges) {
+ ArrayList<PathDescription> list = new ArrayList<>();
for (ConnectedEdge edge : edges) {
PathDescription pathDesc = null;
.augmentation(NeighborAfiSafiStateAugmentation.class);
addHeader(table, "AFI state");
table.addRow().addContent("Family", afiSafi.getAfiSafiName().getSimpleName());
- table.addRow().addContent("Active", state.isActive());
+ table.addRow().addContent("Active", state.getActive());
final Prefixes prefixes = state.getPrefixes();
if (prefixes == null) {
return;
"The extended community %s is not EsiLabelExtendedCommunityCaseCase type.", extendedCommunity);
final EsiLabelExtendedCommunity extCom = ((EsiLabelExtendedCommunityCase) extendedCommunity)
.getEsiLabelExtendedCommunity();
- byteAggregator.writeBoolean(extCom.isSingleActiveMode());
+ byteAggregator.writeBoolean(extCom.getSingleActiveMode());
byteAggregator.writeZero(RESERVED);
byteAggregator.writeBytes(byteBufForMplsLabel(extCom.getEsiLabel()));
}
final Layer2AttributesExtendedCommunity extCom = ((Layer2AttributesExtendedCommunityCase) extendedCommunity)
.getLayer2AttributesExtendedCommunity();
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(PRIMARY_PE_OFFSET, extCom.isPrimaryPe());
- flags.set(BACKUP_PE_OFFSET, extCom.isBackupPe());
- flags.set(CONTROL_WORD_OFFSET, extCom.isControlWord());
+ flags.set(PRIMARY_PE_OFFSET, extCom.getPrimaryPe());
+ flags.set(BACKUP_PE_OFFSET, extCom.getBackupPe());
+ flags.set(CONTROL_WORD_OFFSET, extCom.getControlWord());
final byte[] res = flags.array();
byte aux = 0;
"The extended community %s is not MacMobilityExtendedCommunityCase type.", extendedCommunity);
final MacMobilityExtendedCommunity extCom = ((MacMobilityExtendedCommunityCase) extendedCommunity)
.getMacMobilityExtendedCommunity();
- byteAggregator.writeBoolean(extCom.isStatic());
+ byteAggregator.writeBoolean(extCom.getStatic());
byteAggregator.writeZero(RESERVED);
byteAggregator.writeInt(extCom.getSeqNumber().intValue());
}
private static String stringFragment(final Fragment fragment) {
final StringBuilder buffer = new StringBuilder();
- if (fragment.isDoNot()) {
+ if (fragment.getDoNot()) {
buffer.append("'DO NOT' ");
}
- if (fragment.isFirst()) {
+ if (fragment.getFirst()) {
buffer.append("'IS FIRST' ");
}
- if (fragment.isLast()) {
+ if (fragment.getLast()) {
buffer.append("'IS LAST' ");
}
- if (fragment.isIsA()) {
+ if (fragment.getIsA()) {
buffer.append("'IS A' ");
}
return buffer.toString();
public static final int DESTINATION_PORT_VALUE = 5;
@Override
- public void serializeType(FlowspecType fsType, ByteBuf output) {
+ public void serializeType(final FlowspecType fsType, final ByteBuf output) {
Preconditions.checkArgument(fsType instanceof DestinationPortCase, "DestinationPortCase class is mandatory!");
output.writeByte(DESTINATION_PORT_VALUE);
NumericTwoByteOperandParser.INSTANCE.serialize(((DestinationPortCase) fsType).getDestinationPorts(), output);
}
@Override
- public FlowspecType parseType(ByteBuf buffer) {
+ public FlowspecType parseType(final ByteBuf buffer) {
requireNonNull(buffer, "input buffer is null, missing data to parse.");
return new DestinationPortCaseBuilder().setDestinationPorts(parseDestinationPort(buffer)).build();
}
builder.setOp(op);
final short length = AbstractOperandParser.parseLength(b);
builder.setValue(ByteArray.bytesToInt(ByteArray.readBytes(nlri, length)));
- end = op.isEndOfList();
+ end = op.getEndOfList();
ports.add(builder.build());
}
return ports;
final NumericOperand op = NumericOneByteOperandParser.INSTANCE.parse(b);
builder.setOp(op);
builder.setValue(new Dscp(ByteBufUtils.readUint8(nlri)));
- end = op.isEndOfList();
+ end = op.getEndOfList();
dscps.add(builder.build());
}
return dscps;
final NumericOperand op = NumericOneByteOperandParser.INSTANCE.parse(b);
builder.setOp(op);
builder.setValue(ByteBufUtils.readUint8(nlri));
- end = op.isEndOfList();
+ end = op.getEndOfList();
codes.add(builder.build());
}
return codes;
final NumericOperand op = NumericOneByteOperandParser.INSTANCE.parse(b);
builder.setOp(op);
builder.setValue(ByteBufUtils.readUint8(nlri));
- end = op.isEndOfList();
+ end = op.getEndOfList();
icmps.add(builder.build());
}
return icmps;
final NumericOperand op = NumericOneByteOperandParser.INSTANCE.parse(b);
builder.setOp(op);
builder.setValue(ByteBufUtils.readUint8(nlri));
- end = op.isEndOfList();
+ end = op.getEndOfList();
ips.add(builder.build());
}
return ips;
builder.setOp(op);
final short length = AbstractOperandParser.parseLength(b);
builder.setValue(ByteArray.bytesToLong(ByteArray.readBytes(nlri, length)));
- end = op.isEndOfList();
+ end = op.getEndOfList();
labels.add(builder.build());
}
return labels;
final NumericOperand op = NumericOneByteOperandParser.INSTANCE.parse(b);
builder.setOp(op);
builder.setValue(ByteBufUtils.readUint8(nlri));
- end = op.isEndOfList();
+ end = op.getEndOfList();
headers.add(builder.build());
}
return headers;
public static final int PACKET_LENGTH_VALUE = 10;
@Override
- public void serializeType(FlowspecType fsType, ByteBuf output) {
+ public void serializeType(final FlowspecType fsType, final ByteBuf output) {
Preconditions.checkArgument(fsType instanceof PacketLengthCase, "PacketLengthCase class is mandatory!");
output.writeByte(PACKET_LENGTH_VALUE);
NumericTwoByteOperandParser.INSTANCE.serialize(((PacketLengthCase) fsType).getPacketLengths(), output);
}
@Override
- public FlowspecType parseType(ByteBuf buffer) {
+ public FlowspecType parseType(final ByteBuf buffer) {
requireNonNull(buffer, "input buffer is null, missing data to parse.");
return new PacketLengthCaseBuilder().setPacketLengths(parsePacketLength(buffer)).build();
}
builder.setOp(op);
final short length = AbstractOperandParser.parseLength(b);
builder.setValue(ByteArray.bytesToInt(ByteArray.readBytes(nlri, length)));
- end = op.isEndOfList();
+ end = op.getEndOfList();
packetLengths.add(builder.build());
}
return packetLengths;
public static final int PORT_VALUE = 4;
@Override
- public void serializeType(FlowspecType fsType, ByteBuf output) {
+ public void serializeType(final FlowspecType fsType, final ByteBuf output) {
Preconditions.checkArgument(fsType instanceof PortCase, "PortCase class is mandatory!");
output.writeByte(PORT_VALUE);
NumericTwoByteOperandParser.INSTANCE.serialize(((PortCase) fsType).getPorts(), output);
}
@Override
- public FlowspecType parseType(ByteBuf buffer) {
+ public FlowspecType parseType(final ByteBuf buffer) {
requireNonNull(buffer, "input buffer is null, missing data to parse.");
return new PortCaseBuilder().setPorts(parsePort(buffer)).build();
}
builder.setOp(op);
final short length = AbstractOperandParser.parseLength(b);
builder.setValue(ByteArray.bytesToInt(ByteArray.readBytes(nlri, length)));
- end = op.isEndOfList();
+ end = op.getEndOfList();
ports.add(builder.build());
}
return ports;
public static final int SOURCE_PORT_VALUE = 6;
@Override
- public void serializeType(FlowspecType fsType, ByteBuf output) {
+ public void serializeType(final FlowspecType fsType, final ByteBuf output) {
Preconditions.checkArgument(fsType instanceof SourcePortCase, "SourcePortCase class is mandatory!");
output.writeByte(SOURCE_PORT_VALUE);
NumericTwoByteOperandParser.INSTANCE.serialize(((SourcePortCase) fsType).getSourcePorts(), output);
}
@Override
- public FlowspecType parseType(ByteBuf buffer) {
+ public FlowspecType parseType(final ByteBuf buffer) {
requireNonNull(buffer, "input buffer is null, missing data to parse.");
return new SourcePortCaseBuilder().setSourcePorts(parseSourcePort(buffer)).build();
}
builder.setOp(op);
final short length = AbstractOperandParser.parseLength(b);
builder.setValue(ByteArray.bytesToInt(ByteArray.readBytes(nlri, length)));
- end = op.isEndOfList();
+ end = op.getEndOfList();
ports.add(builder.build());
}
return ports;
builder.setOp(op);
final short length = AbstractOperandParser.parseLength(b);
builder.setValue(ByteArray.bytesToInt(ByteArray.readBytes(nlri, length)));
- end = op.isEndOfList();
+ end = op.getEndOfList();
flags.add(builder.build());
}
return flags;
} else {
Ipv6Util.writeIpv6Address(nextHopAddress.getIpv6AddressNoZone(), byteAggregator);
}
- byteAggregator.writeShort(Boolean.TRUE.equals(redirect.isCopy()) ? 1 : 0);
+ byteAggregator.writeShort(Boolean.TRUE.equals(redirect.getCopy()) ? 1 : 0);
}
@Override
.getTrafficActionExtendedCommunity();
byteAggregator.writeZero(RESERVED);
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(SAMPLE_BIT, trafficAction.isSample());
- flags.set(TERMINAL_BIT, trafficAction.isTerminalAction());
+ flags.set(SAMPLE_BIT, trafficAction.getSample());
+ flags.set(TERMINAL_BIT, trafficAction.getTerminalAction());
flags.toByteBuf(byteAggregator);
}
final BitmaskOperand op = BitmaskOperandParser.INSTANCE.parse(b);
builder.setOp(op);
builder.setValue(parseFragment(nlri.readByte()));
- end = op.isEndOfList();
+ end = op.getEndOfList();
fragments.add(builder.build());
}
return fragments;
final boolean endOfList, final ByteBuf buffer) {
final BitArray operandValues = new BitArray(OPERAND_LENGTH);
operandValues.set(END_OF_LIST, endOfList);
- operandValues.set(AND_BIT, operand.isAndBit());
- operandValues.set(LESS_THAN, operand.isLessThan());
- operandValues.set(GREATER_THAN, operand.isGreaterThan());
- operandValues.set(EQUAL, operand.isEquals());
+ operandValues.set(AND_BIT, operand.getAndBit());
+ operandValues.set(LESS_THAN, operand.getLessThan());
+ operandValues.set(GREATER_THAN, operand.getGreaterThan());
+ operandValues.set(EQUAL, operand.getEquals());
final byte byteLength = (byte) (Integer.numberOfTrailingZeros(length) << LENGTH_SHIFT);
buffer.writeByte(operandValues.toByte() | byteLength);
}
@Override
public String toString(final NumericOperand operand, final boolean isFirst) {
final StringBuilder buffer = new StringBuilder();
- if (operand.isAndBit()) {
+ if (operand.getAndBit()) {
buffer.append("and ");
} else if (!isFirst) {
buffer.append("or ");
}
- if (operand.isLessThan()) {
+ if (operand.getLessThan()) {
buffer.append("is less than ");
- if (operand.isEquals()) {
+ if (operand.getEquals()) {
buffer.append("or equals to ");
}
return buffer.toString();
}
- if (operand.isGreaterThan()) {
+ if (operand.getGreaterThan()) {
buffer.append("is greater than ");
- if (operand.isEquals()) {
+ if (operand.getEquals()) {
buffer.append("or equals to ");
}
return buffer.toString();
}
- if (operand.isEquals()) {
+ if (operand.getEquals()) {
buffer.append("equals to ");
}
return buffer.toString();
final ByteBuf buffer) {
final BitArray bs = new BitArray(OPERAND_LENGTH);
bs.set(END_OF_LIST, endOfList);
- bs.set(AND_BIT, op.isAndBit());
- bs.set(MATCH, op.isMatch());
- bs.set(NOT, op.isNot());
+ bs.set(AND_BIT, op.getAndBit());
+ bs.set(MATCH, op.getMatch());
+ bs.set(NOT, op.getNot());
final byte len = (byte) (Integer.numberOfTrailingZeros(length) << LENGTH_SHIFT);
buffer.writeByte(bs.toByte() | len);
}
@Override
public String toString(final BitmaskOperand op, final boolean isFirst) {
final StringBuilder buffer = new StringBuilder();
- if (!op.isAndBit() && !isFirst) {
+ if (!op.getAndBit() && !isFirst) {
buffer.append("or ");
}
- if (op.isAndBit()) {
+ if (op.getAndBit()) {
buffer.append("and ");
}
- if (op.isMatch()) {
+ if (op.getMatch()) {
buffer.append("does ");
- if (op.isNot()) {
+ if (op.getNot()) {
buffer.append("not ");
}
buffer.append("match ");
- } else if (op.isNot()) {
+ } else if (op.getNot()) {
buffer.append("is not ");
}
return buffer.toString();
@Override
protected final byte serializeFragment(final Fragment fragment) {
final BitArray bs = new BitArray(Byte.SIZE);
- bs.set(DONT_FRAGMENT, fragment.isDoNot());
- bs.set(FIRST_FRAGMENT, fragment.isFirst());
- bs.set(IS_A_FRAGMENT, fragment.isIsA());
- bs.set(LAST_FRAGMENT, fragment.isLast());
+ bs.set(DONT_FRAGMENT, fragment.getDoNot());
+ bs.set(FIRST_FRAGMENT, fragment.getFirst());
+ bs.set(IS_A_FRAGMENT, fragment.getIsA());
+ bs.set(LAST_FRAGMENT, fragment.getLast());
return bs.toByte();
}
}
protected final byte serializeFragment(final Fragment fragment) {
final BitArray bs = new BitArray(Byte.SIZE);
bs.set(DONT_FRAGMENT, Boolean.FALSE);
- bs.set(FIRST_FRAGMENT, fragment.isFirst());
- bs.set(IS_A_FRAGMENT, fragment.isIsA());
- bs.set(LAST_FRAGMENT, fragment.isLast());
+ bs.set(FIRST_FRAGMENT, fragment.getFirst());
+ bs.set(IS_A_FRAGMENT, fragment.getIsA());
+ bs.set(LAST_FRAGMENT, fragment.getLast());
return bs.toByte();
}
}
final Ipv6SidTlv ipv6Tlv = (Ipv6SidTlv) tlv;
bytes.writeZero(RESERVED);
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(PROCESS_IPV6_HEADER_FLAG, ipv6Tlv.isProcessIpv6HeadAbility());
+ flags.set(PROCESS_IPV6_HEADER_FLAG, ipv6Tlv.getProcessIpv6HeadAbility());
flags.toByteBuf(bytes);
}
final ByteBuf serialized = Unpooled.buffer(3);
this.handler.serializeBgpPrefixSidTlv(tlv.build(), serialized);
assertArrayEquals(this.expected, serialized.array());
- assertTrue(this.handler.parseBgpPrefixSidTlv(serialized).isProcessIpv6HeadAbility());
+ assertTrue(this.handler.parseBgpPrefixSidTlv(serialized).getProcessIpv6HeadAbility());
}
@Test
if (mplsProtocolMask != null) {
final ByteBuf mplsProtocolMaskBuf = Unpooled.buffer(1);
final BitArray mask = new BitArray(FLAGS_SIZE);
- mask.set(LDP_BIT, mplsProtocolMask.isLdp());
- mask.set(RSVP_BIT, mplsProtocolMask.isRsvpte());
+ mask.set(LDP_BIT, mplsProtocolMask.getLdp());
+ mask.set(RSVP_BIT, mplsProtocolMask.getRsvpte());
mask.toByteBuf(mplsProtocolMaskBuf);
TlvUtil.writeTLV(MPLS_PROTOCOL, mplsProtocolMaskBuf, byteAggregator);
}
if (nodeFlagBits != null) {
final ByteBuf nodeFlagBuf = Unpooled.buffer(1);
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(OVERLOAD_BIT, nodeFlagBits.isOverload());
- flags.set(ATTACHED_BIT, nodeFlagBits.isAttached());
- flags.set(EXTERNAL_BIT, nodeFlagBits.isExternal());
- flags.set(ABBR_BIT, nodeFlagBits.isAbr());
- flags.set(ROUTER_BIT, nodeFlagBits.isRouter());
- flags.set(V6_BIT, nodeFlagBits.isV6());
+ flags.set(OVERLOAD_BIT, nodeFlagBits.getOverload());
+ flags.set(ATTACHED_BIT, nodeFlagBits.getAttached());
+ flags.set(EXTERNAL_BIT, nodeFlagBits.getExternal());
+ flags.set(ABBR_BIT, nodeFlagBits.getAbr());
+ flags.set(ROUTER_BIT, nodeFlagBits.getRouter());
+ flags.set(V6_BIT, nodeFlagBits.getV6());
flags.toByteBuf(nodeFlagBuf);
TlvUtil.writeTLV(NODE_FLAG_BITS, nodeFlagBuf, byteAggregator);
}
if (prefixAtrributes.getIgpBits() != null) {
final BitArray igpBit = new BitArray(FLAGS_SIZE);
final IgpBits igpBits = prefixAtrributes.getIgpBits();
- igpBit.set(UP_DOWN_BIT, igpBits.getUpDown().isUpDown() || igpBits.isIsIsUpDown());
- igpBit.set(OSPF_NO_UNICAST, igpBits.isOspfNoUnicast());
- igpBit.set(OSPF_LOCAL_ADDRESS, igpBits.isOspfLocalAddress());
- igpBit.set(OSPF_PROPAGATE_ADDRESS, igpBits.isOspfPropagateNssa());
+ igpBit.set(UP_DOWN_BIT, igpBits.getUpDown().getUpDown() || igpBits.getIsIsUpDown());
+ igpBit.set(OSPF_NO_UNICAST, igpBits.getOspfNoUnicast());
+ igpBit.set(OSPF_LOCAL_ADDRESS, igpBits.getOspfLocalAddress());
+ igpBit.set(OSPF_PROPAGATE_ADDRESS, igpBits.getOspfPropagateNssa());
TlvUtil.writeTLV(IGP_FLAGS, Unpooled.wrappedBuffer(igpBit.array()), byteAggregator);
}
serializeRouteTags(prefixAtrributes.getRouteTags(), byteAggregator);
final BitArray bitFlags = new BitArray(FLAGS_SIZE);
if (flags instanceof IsisBindingFlagsCase) {
final IsisBindingFlagsCase isisFlags = (IsisBindingFlagsCase) flags;
- bitFlags.set(AFI, isisFlags.isAddressFamily());
- bitFlags.set(MIRROR_CONTEXT, isisFlags.isMirrorContext());
- bitFlags.set(SPREAD_TLV, isisFlags.isSpreadTlv());
- bitFlags.set(LEAKED, isisFlags.isLeakedFromLevel2());
- bitFlags.set(ATTACHED, isisFlags.isAttachedFlag());
+ bitFlags.set(AFI, isisFlags.getAddressFamily());
+ bitFlags.set(MIRROR_CONTEXT, isisFlags.getMirrorContext());
+ bitFlags.set(SPREAD_TLV, isisFlags.getSpreadTlv());
+ bitFlags.set(LEAKED, isisFlags.getLeakedFromLevel2());
+ bitFlags.set(ATTACHED, isisFlags.getAttachedFlag());
} else if (flags instanceof OspfBindingFlagsCase) {
final OspfBindingFlagsCase ospfFlags = (OspfBindingFlagsCase) flags;
- bitFlags.set(MIRROR_CONTEXT_OSPF, ospfFlags.isMirroring());
+ bitFlags.set(MIRROR_CONTEXT_OSPF, ospfFlags.getMirroring());
}
return bitFlags;
}
public static void serializeSrRange(final SrRange srRange, final ByteBuf aggregator) {
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(INNER_AREA, srRange.isInterArea());
+ flags.set(INNER_AREA, srRange.getInterArea());
flags.toByteBuf(aggregator);
aggregator.writeZero(RESERVED);
aggregator.writeShort(srRange.getRangeSize().toJava());
final BitArray bitFlags = new BitArray(FLAGS_BITS_SIZE);
if (flags instanceof OspfAdjFlagsCase) {
final OspfAdjFlags ospfFlags = ((OspfAdjFlagsCase) flags).getOspfAdjFlags();
- bitFlags.set(BACKUP_OSPF, ospfFlags.isBackup());
- bitFlags.set(SET_OSPF, ospfFlags.isSet());
+ bitFlags.set(BACKUP_OSPF, ospfFlags.getBackup());
+ bitFlags.set(SET_OSPF, ospfFlags.getSet());
SidLabelIndexParser.setFlags(sidLabelIndex, bitFlags, VALUE_OSPF, LOCAL_OSPF);
} else if (flags instanceof IsisAdjFlagsCase) {
final IsisAdjFlags isisFlags = ((IsisAdjFlagsCase) flags).getIsisAdjFlags();
- bitFlags.set(ADDRESS_FAMILY_FLAG, isisFlags.isAddressFamily());
- bitFlags.set(BACKUP_ISIS, isisFlags.isBackup());
- bitFlags.set(SET_ISIS, isisFlags.isSet());
+ bitFlags.set(ADDRESS_FAMILY_FLAG, isisFlags.getAddressFamily());
+ bitFlags.set(BACKUP_ISIS, isisFlags.getBackup());
+ bitFlags.set(SET_ISIS, isisFlags.getSet());
SidLabelIndexParser.setFlags(sidLabelIndex, bitFlags, VALUE_ISIS, LOCAL_ISIS);
} else if (flags == null) {
SidLabelIndexParser.setFlags(sidLabelIndex, bitFlags, VALUE_EPE, LOCAL_EPE);
public static void serializeSrCapabilities(final SrCapabilities caps, final ByteBuf buffer) {
final BitArray bs = new BitArray(FLAGS_SIZE);
- bs.set(MPLS_IPV4, caps.isMplsIpv4());
- bs.set(MPLS_IPV6, caps.isMplsIpv6());
- bs.set(SR_IPV6, caps.isSrIpv6());
+ bs.set(MPLS_IPV4, caps.getMplsIpv4());
+ bs.set(MPLS_IPV6, caps.getMplsIpv6());
+ bs.set(SR_IPV6, caps.getSrIpv6());
bs.toByteBuf(buffer);
buffer.writeZero(RESERVERED);
RFC8294ByteBufUtils.writeUint24(buffer, caps.getRangeSize());
SidLabelIndexParser.setFlags(sidLabelIndex, bitFlags, VALUE, LOCAL);
if (flags instanceof OspfPrefixFlagsCase) {
final OspfPrefixFlags ospfFlags = ((OspfPrefixFlagsCase) flags).getOspfPrefixFlags();
- bitFlags.set(NO_PHP_OSPF, ospfFlags.isNoPhp());
- bitFlags.set(MAPPING_SERVER, ospfFlags.isMappingServer());
- bitFlags.set(EXPLICIT_NULL, ospfFlags.isExplicitNull());
+ bitFlags.set(NO_PHP_OSPF, ospfFlags.getNoPhp());
+ bitFlags.set(MAPPING_SERVER, ospfFlags.getMappingServer());
+ bitFlags.set(EXPLICIT_NULL, ospfFlags.getExplicitNull());
} else if (flags instanceof IsisPrefixFlagsCase) {
final IsisPrefixFlags isisFlags = ((IsisPrefixFlagsCase) flags).getIsisPrefixFlags();
- bitFlags.set(RE_ADVERTISEMENT, isisFlags.isReadvertisement());
- bitFlags.set(NODE_SID, isisFlags.isNodeSid());
- bitFlags.set(NO_PHP, isisFlags.isNoPhp());
- bitFlags.set(EXPLICIT_NULL, isisFlags.isExplicitNull());
+ bitFlags.set(RE_ADVERTISEMENT, isisFlags.getReadvertisement());
+ bitFlags.set(NODE_SID, isisFlags.getNodeSid());
+ bitFlags.set(NO_PHP, isisFlags.getNoPhp());
+ bitFlags.set(EXPLICIT_NULL, isisFlags.getExplicitNull());
}
return bitFlags;
}
"Wrong BindingSubTlv instance expected", bindingSubTlv);
final UnnumberedInterfaceIdBackupEro unnumberedBackup =
((UnnumberedInterfaceIdBackupEroCase) bindingSubTlv).getUnnumberedInterfaceIdBackupEro();
- TlvUtil.writeTLV(BACKUP_UNNUMBERED_ERO, serializeUnnumberedIdEro(unnumberedBackup.isLoose(),
+ TlvUtil.writeTLV(BACKUP_UNNUMBERED_ERO, serializeUnnumberedIdEro(unnumberedBackup.getLoose(),
unnumberedBackup.getRouterId(), unnumberedBackup.getInterfaceId()), aggregator);
}
}
checkArgument(bindingSubTlv instanceof Ipv4EroBackupCase, "Wrong BindingSubTlv instance expected",
bindingSubTlv);
final Ipv4EroBackup ipv4Backup = ((Ipv4EroBackupCase) bindingSubTlv).getIpv4EroBackup();
- TlvUtil.writeTLV(getType(), Ipv4EroParser.serializeIpv4EroCase(ipv4Backup.isLoose(), ipv4Backup.getAddress()),
+ TlvUtil.writeTLV(getType(), Ipv4EroParser.serializeIpv4EroCase(ipv4Backup.getLoose(), ipv4Backup.getAddress()),
aggregator);
}
}
checkArgument(bindingSubTlv instanceof Ipv4EroCase, "Wrong BindingSubTlv instance expected",
bindingSubTlv);
final Ipv4Ero ipv4Ero = ((Ipv4EroCase) bindingSubTlv).getIpv4Ero();
- TlvUtil.writeTLV(getType(), serializeIpv4EroCase(ipv4Ero.isLoose(), ipv4Ero.getAddress()), aggregator);
+ TlvUtil.writeTLV(getType(), serializeIpv4EroCase(ipv4Ero.getLoose(), ipv4Ero.getAddress()), aggregator);
}
static Ipv4EroCase parseIpv4EroCase(final ByteBuf buffer) {
checkArgument(bindingSubTlv instanceof Ipv6EroBackupCase, "Wrong BindingSubTlv instance expected",
bindingSubTlv);
final Ipv6EroBackup ipv6Backup = ((Ipv6EroBackupCase) bindingSubTlv).getIpv6EroBackup();
- TlvUtil.writeTLV(getType(), Ipv6EroParser.serializeIpv6EroCase(ipv6Backup.isLoose(), ipv6Backup.getAddress()),
+ TlvUtil.writeTLV(getType(), Ipv6EroParser.serializeIpv6EroCase(ipv6Backup.getLoose(), ipv6Backup.getAddress()),
aggregator);
}
}
checkArgument(bindingSubTlv instanceof Ipv6EroCase, "Wrong BindingSubTlv instance expected",
bindingSubTlv);
final Ipv6Ero ipv6Ero = ((Ipv6EroCase) bindingSubTlv).getIpv6Ero();
- TlvUtil.writeTLV(getType(), serializeIpv6EroCase(ipv6Ero.isLoose(), ipv6Ero.getAddress()), aggregator);
+ TlvUtil.writeTLV(getType(), serializeIpv6EroCase(ipv6Ero.getLoose(), ipv6Ero.getAddress()), aggregator);
}
public static Ipv6EroCase parseIpv6EroCase(final ByteBuf buffer) {
"Wrong BindingSubTlv instance expected", bindingSubTlv);
final UnnumberedInterfaceIdEro unnumberedEro =
((UnnumberedInterfaceIdEroCase) bindingSubTlv).getUnnumberedInterfaceIdEro();
- TlvUtil.writeTLV(getType(), serializeUnnumberedIdEro(unnumberedEro.isLoose(), unnumberedEro.getRouterId(),
+ TlvUtil.writeTLV(getType(), serializeUnnumberedIdEro(unnumberedEro.getLoose(), unnumberedEro.getRouterId(),
unnumberedEro.getInterfaceId()), aggregator);
}
assertNotNull(ls.getUnreservedBandwidth());
assertEquals(8, ls.getUnreservedBandwidth().size());
assertEquals(LinkProtectionType.Dedicated1to1, ls.getLinkProtection());
- assertTrue(ls.getMplsProtocol().isLdp());
- assertTrue(ls.getMplsProtocol().isRsvpte());
+ assertTrue(ls.getMplsProtocol().getLdp());
+ assertTrue(ls.getMplsProtocol().getRsvpte());
assertEquals(Uint32.TEN, ls.getMetric().getValue());
assertEquals(2, ls.getSharedRiskLinkGroups().size());
assertEquals(305419896, ls.getSharedRiskLinkGroups().get(0).getValue().intValue());
assertEquals(2, ls.getTopologyIdentifier().size());
assertEquals(42, ls.getTopologyIdentifier().get(0).getValue().intValue());
- assertTrue(ls.getNodeFlags().isOverload());
- assertFalse(ls.getNodeFlags().isAttached());
- assertTrue(ls.getNodeFlags().isExternal());
- assertTrue(ls.getNodeFlags().isAbr());
- assertTrue(ls.getNodeFlags().isRouter());
- assertTrue(ls.getNodeFlags().isV6());
+ assertTrue(ls.getNodeFlags().getOverload());
+ assertFalse(ls.getNodeFlags().getAttached());
+ assertTrue(ls.getNodeFlags().getExternal());
+ assertTrue(ls.getNodeFlags().getAbr());
+ assertTrue(ls.getNodeFlags().getRouter());
+ assertTrue(ls.getNodeFlags().getV6());
assertEquals("12K-2", ls.getDynamicHostname());
assertEquals(2, ls.getIsisAreaId().size());
assertNotNull(ls);
assertNotNull(ls.getSrRange());
- assertFalse(ls.getSrRange().isInterArea());
+ assertFalse(ls.getSrRange().getInterArea());
assertEquals(1, ls.getSrRange().getSubTlvs().size());
assertNotNull(ls.getSrBindingSidLabels());
final IgpBits ispBits = ls.getIgpBits();
- assertTrue(ispBits.getUpDown().isUpDown());
- assertTrue(ispBits.isIsIsUpDown());
- assertTrue(ispBits.isOspfNoUnicast());
- assertTrue(ispBits.isOspfLocalAddress());
- assertTrue(ispBits.isOspfPropagateNssa());
+ assertTrue(ispBits.getUpDown().getUpDown());
+ assertTrue(ispBits.getIsIsUpDown());
+ assertTrue(ispBits.getOspfNoUnicast());
+ assertTrue(ispBits.getOspfLocalAddress());
+ assertTrue(ispBits.getOspfPropagateNssa());
assertEquals(2, ls.getRouteTags().size());
assertArrayEquals(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78 }, ls.getRouteTags().get(0)
.getValue());
}
private static void serializeFlag(final PmsiTunnel pmsiTunnelAttribute, final ByteBuf body) {
- body.writeBoolean(pmsiTunnelAttribute.isLeafInformationRequired());
+ body.writeBoolean(pmsiTunnelAttribute.getLeafInformationRequired());
}
@Override
}
return result.get().getExtCommunityMember()
.stream().map(ge -> new ExtendedCommunitiesBuilder().setExtendedCommunity(ge.getExtendedCommunity())
- .setTransitive(ge.isTransitive()).build()).collect(Collectors.toList());
+ .setTransitive(ge.getTransitive()).build()).collect(Collectors.toList());
}
}
// TODO: consider using Maps.filterValues(attributes.getUnrecognizedAttributes(),
// UnrecognizedAttributes::isTransitive)) ?
builder.setUnrecognizedAttributes(attributes.getUnrecognizedAttributes().values().stream()
- .filter(UnrecognizedAttributes::isTransitive)
+ .filter(UnrecognizedAttributes::getTransitive)
.collect(ImmutableMap.toImmutableMap(UnrecognizedAttributes::key, Function.identity())));
}
final List<ExtendedCommunities> oldExt = attributes.getExtendedCommunities();
if (oldExt != null) {
builder.setExtendedCommunities(oldExt.stream()
- .filter(ExtendedCommunity::isTransitive)
+ .filter(ExtendedCommunity::getTransitive)
.collect(Collectors.toList()));
}
return builder.build();
final Inline inline = (Inline) setExtCommunityMethod;
final List<ExtendedCommunities> list = inline.getExtCommunityMember()
.stream().map(ge -> new ExtendedCommunitiesBuilder().setExtendedCommunity(ge.getExtendedCommunity())
- .setTransitive(ge.isTransitive()).build()).collect(Collectors.toList());
+ .setTransitive(ge.getTransitive()).build()).collect(Collectors.toList());
return inlineSetExtComm(attributes, list, options);
}
return referenceSetExtComm(attributes, ((Reference) setExtCommunityMethod).getExtCommunitySetRef(), options);
final Integer safival = this.safiReg.numberForClass(safi);
Preconditions.checkArgument(safival != null, "Unhandled subsequent address family " + safi);
bytes.writeByte(safival);
- if (t.getAfiFlags() != null && t.getAfiFlags().isForwardingState()) {
+ if (t.getAfiFlags() != null && t.getAfiFlags().getForwardingState()) {
bytes.writeByte(AFI_FLAG_FORWARDING_STATE);
} else {
bytes.writeByte(0);
final int timeval = time.toJava();
Preconditions.checkArgument(timeval >= 0 && timeval <= MAX_RESTART_TIME, "Restart time is " + time);
final GracefulRestartCapability.RestartFlags flags = grace.getRestartFlags();
- if (flags != null && flags.isRestartState()) {
+ if (flags != null && flags.getRestartState()) {
bytes.writeShort(RESTART_FLAG_STATE | timeval);
} else {
bytes.writeShort(timeval);
final Tables table = new TablesBuilder()
.setAfi(afi)
.setSafi(safi)
- .setAfiFlags(new Tables.AfiFlags(Boolean.valueOf(afiFlags == AFI_FLAG_FORWARDING_STATE)))
+ .setAfiFlags(new Tables.AfiFlags(afiFlags == AFI_FLAG_FORWARDING_STATE))
.setLongLivedStaleTime(new Uint24(Uint32.valueOf(staleTime)))
.build();
tables.add(table);
final Integer safival = this.safiReg.numberForClass(safi);
checkArgument(safival != null, "Unhandled subsequent address family %s", safi);
buffer.writeByte(safival);
- if (table.getAfiFlags() != null && table.getAfiFlags().isForwardingState()) {
+ if (table.getAfiFlags() != null && table.getAfiFlags().getForwardingState()) {
buffer.writeByte(AFI_FLAG_FORWARDING_STATE);
} else {
buffer.writeByte(0);
* 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 org.opendaylight.protocol.bgp.parser.impl.message.update;
import io.netty.buffer.ByteBuf;
for (final UnrecognizedAttributes unrecognizedAttr : unrecognizedAttrs.values()) {
LOG.trace("Serializing unrecognized attribute of type {}", unrecognizedAttr.getType());
int flags = AttributeUtil.OPTIONAL;
- if (unrecognizedAttr.isPartial()) {
+ if (unrecognizedAttr.getPartial()) {
flags |= AttributeUtil.PARTIAL;
}
- if (unrecognizedAttr.isTransitive()) {
+ if (unrecognizedAttr.getTransitive()) {
flags |= AttributeUtil.TRANSITIVE;
}
AttributeUtil.formatAttribute(flags, unrecognizedAttr.getType().toJava(),
final CParameters tlv4 = new CParametersBuilder().setAs4BytesCapability(
new As4BytesCapabilityBuilder().setAsNumber(new AsNumber(Uint32.valueOf(40))).build()).build();
- assertFalse(tlv3.getRestartFlags().isRestartState());
+ assertFalse(tlv3.getRestartFlags().getRestartState());
assertEquals(0, tlv3.getRestartTime().intValue());
if (serializer == null) {
return;
}
- byteAggregator.writeByte(Shorts.checkedCast(serializer.getType(extendedCommunity.isTransitive())));
+ byteAggregator.writeByte(Shorts.checkedCast(serializer.getType(extendedCommunity.getTransitive())));
byteAggregator.writeByte(Shorts.checkedCast(serializer.getSubType()));
serializer.serializeExtendedCommunity(extendedCommunity.getExtendedCommunity(), byteAggregator);
}
final ExtendedCommunities parsedExtendedCommunity =
this.register.parseExtendedCommunity(Unpooled.copiedBuffer(new byte[] {0, 0, 0, 0, 0, 0, 0, 0}));
verify(this.parser).parseExtendedCommunity(any(ByteBuf.class));
- Assert.assertTrue(parsedExtendedCommunity.isTransitive());
+ Assert.assertTrue(parsedExtendedCommunity.getTransitive());
//no value parser
assertNull(parsedExtendedCommunity.getExtendedCommunity());
}
final UnrecognizedAttributesKey expectedAttribKey =
new UnrecognizedAttributesKey(unrecogAttrib.getType());
- assertTrue(unrecogAttrib.isPartial());
- assertTrue(unrecogAttrib.isTransitive());
+ assertTrue(unrecogAttrib.getPartial());
+ assertTrue(unrecogAttrib.getTransitive());
assertArrayEquals(ByteArray.cutBytes(attributeBytes, NON_VALUE_BYTES), unrecogAttrib.getValue());
assertEquals(NON_EXISTENT_TYPE, unrecogAttrib.getType().shortValue());
assertEquals(expectedAttribKey, unrecogAttrib.key());
} else {
forwardingTables = advertisedTables.values().stream()
.filter(table -> table.getAfiFlags() != null)
- .filter(table -> table.getAfiFlags().isForwardingState())
+ .filter(table -> table.getAfiFlags().getForwardingState())
.map(table -> new TablesKey(table.getAfi(), table.getSafi()))
.collect(Collectors.toSet());
}
final GracefulRestart gr = afiSafi.getGracefulRestart();
if (gr != null) {
final Config config = gr.getConfig();
- if (config != null && Boolean.TRUE.equals(config.isEnabled())) {
+ if (config != null && Boolean.TRUE.equals(config.getEnabled())) {
final Class<? extends AfiSafiType> afiSafiName = afiSafi.getAfiSafiName();
if (afiSafiName != null) {
final TablesKey tablesKey = tableTypeRegistry.getTableKey(afiSafiName);
}
private static SendReceive toSendReceiveMode(final BgpNeighborAddPathsConfig addPath) {
- if (addPath.isReceive() && addPath.getSendMax() != null) {
+ if (addPath.getReceive() && addPath.getSendMax() != null) {
return SendReceive.Both;
}
if (addPath.getSendMax() != null) {
private static boolean isRrClient(final BgpNeighborGroup neighbor) {
final RouteReflector routeReflector = neighbor.getRouteReflector();
if (routeReflector != null && routeReflector.getConfig() != null) {
- return routeReflector.getConfig().isRouteReflectorClient();
+ return routeReflector.getConfig().getRouteReflectorClient();
}
return false;
}
if (transport != null) {
final Config config = transport.getConfig();
if (config != null) {
- final Boolean passive = config.isPassiveMode();
+ final Boolean passive = config.getPassiveMode();
if (passive != null) {
return Optional.of(!passive);
}
}
final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.error.handling
.Config config = errorHandling.getConfig();
- return config == null ? Optional.empty() : Optional.of(config.isTreatAsWithdraw());
+ return config == null ? Optional.empty() : Optional.of(config.getTreatAsWithdraw());
}
}
for (final Tables table : tables.values()) {
if (table.getAfi().equals(tableType.getAfi()) && table.getSafi().equals(tableType.getSafi())) {
found = true;
- assertEquals(Boolean.TRUE, table.getAttributes().isUptodate());
+ assertEquals(Boolean.TRUE, table.getAttributes().getUptodate());
}
}
assertTrue(found);
assertNotNull(params);
final GracefulRestartCapability gracefulCapability = params.getGracefulRestartCapability();
assertNotNull(gracefulCapability);
- assertTrue(gracefulCapability.getRestartFlags().isRestartState());
+ assertTrue(gracefulCapability.getRestartFlags().getRestartState());
assertEquals(RESTART_TIME, gracefulCapability.getRestartTime().intValue());
final var tables = gracefulCapability.getTables();
assertNotNull(tables);
assertEquals(2, tables.size());
tables.values().forEach(table -> {
- assertTrue(isSameKey(IPV4_KEY, table.key()) && table.getAfiFlags().isForwardingState()
- || isSameKey(IPV6_KEY, table.key()) && !table.getAfiFlags().isForwardingState());
+ assertTrue(isSameKey(IPV4_KEY, table.key()) && table.getAfiFlags().getForwardingState()
+ || isSameKey(IPV6_KEY, table.key()) && !table.getAfiFlags().getForwardingState());
});
}
assertEquals(2, tables.size());
assertEquals(STALE_TIME, tables.values().iterator().next().getLongLivedStaleTime().getValue().intValue());
tables.values().forEach(table -> {
- assertTrue(isSameKey(IPV4_KEY, table.key()) && table.getAfiFlags().isForwardingState()
- || isSameKey(IPV6_KEY, table.key()) && !table.getAfiFlags().isForwardingState());
+ assertTrue(isSameKey(IPV4_KEY, table.key()) && table.getAfiFlags().getForwardingState()
+ || isSameKey(IPV6_KEY, table.key()) && !table.getAfiFlags().getForwardingState());
});
}
}
builder.setSrlgs(srlgs);
}
- if (la.getSrAdjIds() != null) {
- for (SrAdjIds adj : la.getSrAdjIds()) {
- if (adj.getSidLabelIndex() instanceof LocalLabelCase) {
- boolean backup = false;
- if (adj.getFlags() instanceof OspfAdjFlags) {
- backup = ((OspfAdjFlags) adj.getFlags()).isBackup();
- }
- if (adj.getFlags() instanceof IsisAdjFlags) {
- backup = ((IsisAdjFlags) adj.getFlags()).isBackup();
- }
- if (!backup) {
- builder.setAdjSid(((LocalLabelCase) adj.getSidLabelIndex()).getLocalLabel().getValue());
- } else {
- builder.setBackupAdjSid(((LocalLabelCase) adj.getSidLabelIndex()).getLocalLabel().getValue());
- }
+ for (SrAdjIds adj : la.nonnullSrAdjIds()) {
+ if (adj.getSidLabelIndex() instanceof LocalLabelCase) {
+ boolean backup = false;
+ if (adj.getFlags() instanceof OspfAdjFlags) {
+ backup = ((OspfAdjFlags) adj.getFlags()).getBackup();
+ }
+ if (adj.getFlags() instanceof IsisAdjFlags) {
+ backup = ((IsisAdjFlags) adj.getFlags()).getBackup();
+ }
+ if (!backup) {
+ builder.setAdjSid(((LocalLabelCase) adj.getSidLabelIndex()).getLocalLabel().getValue());
+ } else {
+ builder.setBackupAdjSid(((LocalLabelCase) adj.getSidLabelIndex()).getLocalLabel().getValue());
}
}
}
.build());
}
if (na.getNodeFlags() != null) {
- if (na.getNodeFlags().isAbr()) {
+ if (na.getNodeFlags().getAbr()) {
builder.setVertexType(VertexType.Abr);
}
- if (na.getNodeFlags().isExternal()) {
+ if (na.getNodeFlags().getExternal()) {
builder.setVertexType(VertexType.AsbrOut);
}
} else {
builder.setPrefixSid(((SidCase) pa.getSrPrefix().getSidLabelIndex()).getSid());
if (pa.getSrPrefix().getFlags() instanceof IsisPrefixFlagsCase) {
builder.setNodeSid(
- ((IsisPrefixFlagsCase) pa.getSrPrefix().getFlags()).getIsisPrefixFlags().isNodeSid());
+ ((IsisPrefixFlagsCase) pa.getSrPrefix().getFlags()).getIsisPrefixFlags().getNodeSid());
} else {
/*
* Seems that OSPF Flags are not accessible. Assuming that the
}
final Flags prefixFlags = srPrefix.getFlags();
if (prefixFlags instanceof IsisPrefixFlagsCase) {
- return !Boolean.FALSE.equals(((IsisPrefixFlagsCase) prefixFlags).getIsisPrefixFlags().isNodeSid());
+ return !Boolean.FALSE.equals(((IsisPrefixFlagsCase) prefixFlags).getIsisPrefixFlags().getNodeSid());
}
return true;
}
// TODO: what should we do with in.getOspfRouterId()?
final NodeFlagBits nf = na.getNodeFlags();
- if (nf.isAbr() != null) {
- ab.setRouterType(new AbrBuilder().setAbr(nf.isAbr() ? Empty.getInstance() : null).build());
- } else if (nf.isExternal() != null) {
- ab.setRouterType(new InternalBuilder().setInternal(nf.isExternal() ? null : Empty.getInstance())
+ if (nf.getAbr() != null) {
+ ab.setRouterType(new AbrBuilder().setAbr(nf.getAbr() ? Empty.getInstance() : null).build());
+ } else if (nf.getExternal() != null) {
+ ab.setRouterType(new InternalBuilder().setInternal(nf.getExternal() ? null : Empty.getInstance())
.build());
}
}
public static ChannelInitializer<AbstractChannel> createChannelWithDecoder(
final @NonNull BmpSessionFactory sessionFactory, final @NonNull BmpHandlerFactory hf,
final @NonNull BmpSessionListenerFactory slf) {
- return new ChannelInitializer<AbstractChannel>() {
+ return new ChannelInitializer<>() {
@Override
protected void initChannel(final AbstractChannel ch) throws Exception {
ch.pipeline().addLast(hf.getDecoders());
public static ChannelInitializer<AbstractChannel> createChannelWithEncoder(
final @NonNull BmpSessionFactory sessionFactory, final @NonNull BmpHandlerFactory hf,
final @NonNull BmpSessionListenerFactory slf) {
- return new ChannelInitializer<AbstractChannel>() {
+ return new ChannelInitializer<>() {
@Override
protected void initChannel(final AbstractChannel ch) throws Exception {
ch.pipeline().addLast(hf.getEncoders());
public static ServerBootstrap createServerBootstrap(final @NonNull BmpSessionFactory sessionFactory,
final @NonNull BmpHandlerFactory hf, final @NonNull BmpSessionListenerFactory slf,
final @NonNull CreateChannel createChannel, final @NonNull EventLoopGroup bossGroup,
- final @NonNull EventLoopGroup workerGroup, final @NonNull KeyMapping keys, boolean tryEpollSocket) {
+ final @NonNull EventLoopGroup workerGroup, final @NonNull KeyMapping keys, final boolean tryEpollSocket) {
final ServerBootstrap serverBootstrap = new ServerBootstrap();
serverBootstrap.childHandler(createChannel.create(sessionFactory, hf, slf));
final @NonNull BmpHandlerFactory hf, final @NonNull CreateChannel createChannel,
final @NonNull BmpSessionListenerFactory slf, final @NonNull InetSocketAddress remoteAddress,
final @Nullable SocketAddress localAddress, final @NonNull EventLoopGroup workerGroup,
- final int connectTimeout, final @NonNull KeyMapping keys, boolean reuseAddress, boolean tryEpollSocket) {
+ final int connectTimeout, final @NonNull KeyMapping keys, final boolean reuseAddress,
+ final boolean tryEpollSocket) {
final Bootstrap bootstrap = new Bootstrap();
bootstrap.option(ChannelOption.SO_REUSEADDR, reuseAddress);
bootstrap.option(ChannelOption.SO_KEEPALIVE, true);
private void connectMonitoredRouters(final BmpDispatcher pdispatcher) {
if (this.monitoredRouters != null) {
for (final MonitoredRouter mr : this.monitoredRouters) {
- if (mr.isActive()) {
+ if (mr.getActive()) {
requireNonNull(mr.getAddress());
requireNonNull(mr.getPort());
final String s = mr.getAddress().getIpv4AddressNoZone().getValue();
final Tables prePolicyTable = peer.getPrePolicyRib().nonnullTables().values().iterator().next();
assertEquals(Ipv4AddressFamily.class, prePolicyTable.getAfi());
assertEquals(UnicastSubsequentAddressFamily.class, prePolicyTable.getSafi());
- assertFalse(prePolicyTable.getAttributes().isUptodate());
+ assertFalse(prePolicyTable.getAttributes().getUptodate());
assertNotNull(peer.getPostPolicyRib());
assertEquals(1, peer.getPostPolicyRib().nonnullTables().size());
final Tables postPolicyTable = peer.getPrePolicyRib().nonnullTables().values().iterator().next();
assertEquals(Ipv4AddressFamily.class, postPolicyTable.getAfi());
assertEquals(UnicastSubsequentAddressFamily.class, postPolicyTable.getSafi());
- assertFalse(postPolicyTable.getAttributes().isUptodate());
+ assertFalse(postPolicyTable.getAttributes().getUptodate());
assertNotNull(peer.getPeerSession());
final PeerSession peerSession = peer.getPeerSession();
readDataOperational(getDataBroker(), peerIId.child(PrePolicyRib.class), prePolicyRib -> {
assertFalse(prePolicyRib.getTables().isEmpty());
final Tables tables = prePolicyRib.getTables().values().iterator().next();
- assertTrue(tables.getAttributes().isUptodate());
+ assertTrue(tables.getAttributes().getUptodate());
assertEquals(3, ((Ipv4RoutesCase) tables.getRoutes()).getIpv4Routes().getIpv4Route().size());
return tables;
});
readDataOperational(getDataBroker(), peerIId.child(PostPolicyRib.class), postPolicyRib -> {
assertFalse(postPolicyRib.getTables().isEmpty());
final Tables tables = postPolicyRib.getTables().values().iterator().next();
- assertTrue(tables.getAttributes().isUptodate());
+ assertTrue(tables.getAttributes().getUptodate());
assertEquals(3, ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet
.rev180329.bmp.monitor.monitor.router.peer.post.policy.rib.tables.routes.Ipv4RoutesCase)
tables.getRoutes()).getIpv4Routes().getIpv4Route().size());
Preconditions.checkArgument(message instanceof PeerDownNotification,
"An instance of PeerDownNotification is required");
final PeerDownNotification peerDown = (PeerDownNotification) message;
- if (peerDown.isLocalSystemClosed()) {
+ if (peerDown.getLocalSystemClosed()) {
if (peerDown.getData() instanceof FsmEventCode) {
buffer.writeByte(REASON_TWO.getValue());
ByteBufUtils.writeOrZero(buffer, ((FsmEventCode) peerDown.getData()).getFsmEventCode());
final PeerUpNotificationBuilder peerUpNot = new PeerUpNotificationBuilder()
.setPeerHeader(parsePerPeerHeader(bytes));
- if (peerUpNot.getPeerHeader().isIpv4()) {
+ if (peerUpNot.getPeerHeader().getIpv4()) {
bytes.skipBytes(Ipv6Util.IPV6_LENGTH - Ipv4Util.IP4_LENGTH);
peerUpNot.setLocalAddress(new IpAddressNoZone(Ipv4Util.addressForByteBuf(bytes)));
} else {
bytes.skipBytes(PEER_DISTINGUISHER_SIZE);
break;
}
- if (phBuilder.isIpv4()) {
+ if (phBuilder.getIpv4()) {
bytes.skipBytes(Ipv6Util.IPV6_LENGTH - Ipv4Util.IP4_LENGTH);
phBuilder.setAddress(new IpAddressNoZone(Ipv4Util.addressForByteBuf(bytes)));
} else {
output.writeByte(peerType.getIntValue());
final BitArray flags = new BitArray(FLAGS_SIZE);
flags.set(L_FLAG_POS, peerHeader.getAdjRibInType().getIntValue() != 0);
- flags.set(V_FLAG_POS, !peerHeader.isIpv4());
+ flags.set(V_FLAG_POS, !peerHeader.getIpv4());
flags.toByteBuf(output);
final PeerDistinguisher peerDistinguisher = peerHeader.getPeerDistinguisher();
switch (peerType) {
output.writeZero(PEER_DISTINGUISHER_SIZE);
break;
}
- if (peerHeader.isIpv4()) {
+ if (peerHeader.getIpv4()) {
output.writeZero(Ipv6Util.IPV6_LENGTH - Ipv4Util.IP4_LENGTH);
Ipv4Util.writeIpv4Address(peerHeader.getAddress().getIpv4AddressNoZone(), output);
} else {
throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + bytes.readableBytes()
+ "; Expected multiple of " + BW_LENGTH + ".");
}
- final BandwidthUsageBuilder builder = new BandwidthUsageBuilder();
- builder.setIgnore(header.isIgnore());
- builder.setProcessingRule(header.isProcessingRule());
+ final BandwidthUsageBuilder builder = new BandwidthUsageBuilder()
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule());
final List<Bandwidth> bwSamples = new ArrayList<>(bytes.readableBytes() / BW_LENGTH);
while (bytes.isReadable()) {
bwSamples.add(new Bandwidth(ByteArray.readBytes(bytes, BW_LENGTH)));
for (final Bandwidth bw : bwSample) {
writeFloat32(bw, body);
}
- ObjectUtil.formatSubobject(getObjectType(), getObjectClass(), object.isProcessingRule(), object.isIgnore(),
+ ObjectUtil.formatSubobject(getObjectType(), getObjectClass(), object.getProcessingRule(), object.getIgnore(),
body, buffer);
}
}
"Wrong instance of Message. Passed instance of %s. Need PcerrMessage.", message.getClass());
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcerr.message
.PcerrMessage err = ((PcerrMessage) message).getPcerrMessage();
- Preconditions.checkArgument(err.getErrors() != null && !err.getErrors().isEmpty(),
+ Preconditions.checkArgument(err.getErrors() != null && !err.nonnullErrors().isEmpty(),
"Errors should not be empty.");
final ByteBuf buffer = Unpooled.buffer();
serializeCases(err, buffer);
- for (final Errors e : err.getErrors()) {
+ for (final Errors e : err.nonnullErrors()) {
serializeObject(e.getErrorObject(), buffer);
}
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcerr.message
.PcerrMessage err, final ByteBuf buffer) {
if (err.getErrorType() instanceof RequestCase) {
- final List<Rps> rps = ((RequestCase) err.getErrorType()).getRequest().getRps();
- for (final Rps r : rps) {
+ for (final Rps r : ((RequestCase) err.getErrorType()).getRequest().nonnullRps()) {
serializeObject(r.getRp(), buffer);
}
}
state = State.ERROR_IN;
} else if (obj instanceof Rp) {
final Rp o = (Rp) obj;
- if (o.isProcessingRule()) {
+ if (o.getProcessingRule()) {
errors.add(createErrorMsg(PCEPErrors.P_FLAG_NOT_SET, Optional.empty()));
return null;
}
serializeObject(monRepMsg.getPccIdReq(), body);
if (monRepMsg.getMonitoringMetricsList() instanceof GeneralMetricsList) {
final GeneralMetricsList gml = (GeneralMetricsList) monRepMsg.getMonitoringMetricsList();
- if (gml.getMetricPce() != null) {
- for (final MetricPce metricPce : gml.getMetricPce()) {
- serializeMetricPce(metricPce, body);
- }
+ for (final MetricPce metricPce : gml.nonnullMetricPce()) {
+ serializeMetricPce(metricPce, body);
}
} else if (monRepMsg.getMonitoringMetricsList() instanceof SpecificMetricsList) {
final SpecificMetricsList sml = (SpecificMetricsList) monRepMsg.getMonitoringMetricsList();
- if (sml.getSpecificMetrics() != null) {
- for (final SpecificMetrics specificMetrics : sml.getSpecificMetrics()) {
- serializeObject(specificMetrics.getRp(), body);
- if (specificMetrics.getMetricPce() != null) {
- for (final MetricPce metricPce : specificMetrics.getMetricPce()) {
- serializeMetricPce(metricPce, body);
- }
- }
+ for (final SpecificMetrics specificMetrics : sml.nonnullSpecificMetrics()) {
+ serializeObject(specificMetrics.getRp(), body);
+ for (final MetricPce metricPce : specificMetrics.nonnullMetricPce()) {
+ serializeMetricPce(metricPce, body);
}
}
}
case INIT:
if (obj instanceof Rp) {
final Rp rp = (Rp) obj;
- if (rp.isProcessingRule()) {
+ if (rp.getProcessingRule()) {
errors.add(createErrorMsg(PCEPErrors.P_FLAG_NOT_SET, Optional.empty()));
return null;
}
serializeObject(failure.getNoPath(), buffer);
serializeObject(failure.getLspa(), buffer);
serializeObject(failure.getBandwidth(), buffer);
- if (failure.getMetrics() != null) {
- for (final Metrics m : failure.getMetrics()) {
- serializeObject(m.getMetric(), buffer);
- }
+ for (final Metrics m : failure.nonnullMetrics()) {
+ serializeObject(m.getMetric(), buffer);
}
serializeObject(failure.getIro(), buffer);
}
if (success == null || success.getSuccess() == null) {
return;
}
- for (final Paths p : success.getSuccess().getPaths()) {
+ for (final Paths p : success.getSuccess().nonnullPaths()) {
serializeObject(p.getEro(), buffer);
serializeObject(p.getLspa(), buffer);
serializeObject(p.getOf(), buffer);
serializeObject(p.getBandwidth(), buffer);
- if (p.getMetrics() != null) {
- for (final Metrics m : p.getMetrics()) {
- serializeObject(m.getMetric(), buffer);
- }
+ for (final Metrics m : p.nonnullMetrics()) {
+ serializeObject(m.getMetric(), buffer);
}
serializeObject(p.getIro(), buffer);
}
}
private void serializeMonitoringMetrics(final Replies reply, final ByteBuf buffer) {
- if (reply.getMetricPce() != null) {
- for (final MetricPce metricPce : reply.getMetricPce()) {
- serializeMetricPce(metricPce, buffer);
- }
+ for (final MetricPce metricPce : reply.nonnullMetricPce()) {
+ serializeMetricPce(metricPce, buffer);
}
}
}
protected void serializeSvec(final PcreqMessage msg, final ByteBuf buffer) {
- for (final Svec s : msg.getSvec()) {
+ for (final Svec s : msg.nonnullSvec()) {
serializeObject(s.getSvec(), buffer);
serializeObject(s.getOf(), buffer);
serializeObject(s.getGc(), buffer);
serializeObject(s.getXro(), buffer);
if (s.getMetric() != null) {
for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcreq
- .message.pcreq.message.svec.Metric m : s.getMetric()) {
+ .message.pcreq.message.svec.Metric m : s.nonnullMetric()) {
serializeObject(m.getMetric(), buffer);
}
}
serializeObject(p2p.getLoadBalancing(), buffer);
serializeObject(p2p.getLspa(), buffer);
serializeObject(p2p.getBandwidth(), buffer);
- if (p2p.getMetrics() != null) {
- for (final Metrics m : p2p.getMetrics()) {
- serializeObject(m.getMetric(), buffer);
- }
+ for (final Metrics m : p2p.nonnullMetrics()) {
+ serializeObject(m.getMetric(), buffer);
}
serializeObject(p2p.getIro(), buffer);
serializeObject(p2p.getRro(), buffer);
serializeObject(p2mp.getOf(), buffer);
serializeObject(p2mp.getLspa(), buffer);
serializeObject(p2mp.getBandwidth(), buffer);
- if (p2mp.getMetric() != null) {
- for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcreq
- .message.pcreq.message.requests.segment.computation.p2mp.Metric m : p2mp.getMetric()) {
- serializeObject(m.getMetric(), buffer);
- }
+ for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcreq
+ .message.pcreq.message.requests.segment.computation.p2mp.Metric m : p2mp.nonnullMetric()) {
+ serializeObject(m.getMetric(), buffer);
}
if (p2mp.getIroBncChoice() instanceof IroCase) {
serializeObject(((IroCase) p2mp.getIroBncChoice()).getIro(), buffer);
protected void serializeMonitoringRequest(final MonitoringRequest monReq, final ByteBuf out) {
serializeObject(monReq.getMonitoring(), out);
serializeObject(monReq.getPccIdReq(), out);
- if (monReq.getPceIdList() != null) {
- for (final PceIdList pceId : monReq.getPceIdList()) {
- serializeObject(pceId.getPceId(), out);
- }
+ for (final PceIdList pceId : monReq.nonnullPceIdList()) {
+ serializeObject(pceId.getPceId(), out);
}
}
}
rpObj = (Rp) objects.get(0);
objects.remove(0);
- if (!rpObj.isProcessingRule()) {
+ if (!rpObj.getProcessingRule()) {
errors.add(createErrorMsg(PCEPErrors.P_FLAG_NOT_SET, Optional.empty()));
} else {
rBuilder.setRp(rpObj);
rBuilder.setVendorInformationObject(vendorInfo);
}
// expansion
- if (rpObj.isPathKey() && objects.get(0) instanceof PathKey) {
+ if (rpObj.getPathKey() && objects.get(0) instanceof PathKey) {
rBuilder.setPathKeyExpansion(
new PathKeyExpansionBuilder().setPathKey((PathKey) objects.get(0)).build());
}
return null;
}
- if (!rpObj.isP2mp()) {
+ if (!rpObj.getP2mp()) {
// p2p
final P2pBuilder p2pBuilder = new P2pBuilder();
final EndpointsObj ep = (EndpointsObj) objects.get(0);
objects.remove(0);
- if (!ep.isProcessingRule()) {
+ if (!ep.getProcessingRule()) {
errors.add(createErrorMsg(PCEPErrors.P_FLAG_NOT_SET, Optional.of(rpObj)));
} else {
p2pBuilder.setEndpointsObj(ep);
builder.setVendorInformationObject(viObjects);
}
- if (rp.isReoptimization() && builder.getBandwidth() != null
+ if (rp.getReoptimization() && builder.getBandwidth() != null
&& !builder.getReportedRoute().getReoptimizationBandwidth().getBandwidth().equals(
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network
.concepts.rev131125.Bandwidth(new byte[] { 0 }))
case OF_IN:
if (obj instanceof ClassType) {
final ClassType classType = (ClassType) obj;
- if (!classType.isProcessingRule()) {
+ if (!classType.getProcessingRule()) {
errors.add(createErrorMsg(PCEPErrors.P_FLAG_NOT_SET, Optional.of(rp)));
} else {
builder.setClassType(classType);
builder.setMetric(metrics);
}
- if (rp.isReoptimization() && builder.getBandwidth() != null) {
+ if (rp.getReoptimization() && builder.getBandwidth() != null) {
if (!isValidReoptimizationRro(epRros) || !isValidReoptimizationBandwidth(epRros)) {
errors.add(createErrorMsg(PCEPErrors.RRO_MISSING, Optional.of(rp)));
}
return new SegmentComputationBuilder().setP2mp(builder.build()).build();
}
- private boolean isValidReoptimizationRro(final List<EndpointRroPair> epRros) {
+ private static boolean isValidReoptimizationRro(final List<EndpointRroPair> epRros) {
for (EndpointRroPair epRro : epRros) {
if (epRro.getRros() == null || epRro.getRros().isEmpty()) {
return false;
return true;
}
- private boolean isValidReoptimizationBandwidth(final List<EndpointRroPair> epRros) {
+ private static boolean isValidReoptimizationBandwidth(final List<EndpointRroPair> epRros) {
for (EndpointRroPair epRro : epRros) {
if (epRro.getReoptimizationBandwidth() == null) {
return false;
case RP:
if (obj instanceof EndpointsObj) {
final EndpointRroPairBuilder rroPairBuilder = new EndpointRroPairBuilder();
- if (obj.isProcessingRule()) {
+ if (obj.getProcessingRule()) {
rroPairBuilder.setEndpointsObj((EndpointsObj) obj);
} else {
errors.add(createErrorMsg(PCEPErrors.P_FLAG_NOT_SET, Optional.of(rp)));
// fallthrough
case ENDPOINT:
if (obj instanceof Rro || obj instanceof Srro) {
- if (obj.isProcessingRule()) {
+ if (obj.getProcessingRule()) {
final int lastIndex = epRros.size() - 1;
final EndpointRroPair endpointRroPair = epRros.get(lastIndex);
List<Rros> rros = endpointRroPair.getRros();
if (pccIdReq.getIpAddress().getIpv4AddressNoZone() != null) {
final ByteBuf body = Unpooled.buffer(Ipv4Util.IP4_LENGTH);
Ipv4Util.writeIpv4Address(pccIdReq.getIpAddress().getIpv4AddressNoZone(), body);
- ObjectUtil.formatSubobject(getObjectType(), getObjectClass(), object.isProcessingRule(), object.isIgnore(),
- body, buffer);
+ ObjectUtil.formatSubobject(getObjectType(), getObjectClass(), object.getProcessingRule(),
+ object.getIgnore(), body, buffer);
} else if (pccIdReq.getIpAddress().getIpv6AddressNoZone() != null) {
final ByteBuf body = Unpooled.buffer(Ipv6Util.IPV6_LENGTH);
Ipv6Util.writeIpv6Address(pccIdReq.getIpAddress().getIpv6AddressNoZone(), body);
- ObjectUtil.formatSubobject(getObjectType(), getObjectClass(), object.isProcessingRule(), object.isIgnore(),
- body, buffer);
+ ObjectUtil.formatSubobject(getObjectType(), getObjectClass(), object.getProcessingRule(),
+ object.getIgnore(), body, buffer);
}
}
}
if (pceId.getIpAddress().getIpv4AddressNoZone() != null) {
final ByteBuf body = Unpooled.buffer(Ipv4Util.IP4_LENGTH);
Ipv4Util.writeIpv4Address(pceId.getIpAddress().getIpv4AddressNoZone(), body);
- ObjectUtil.formatSubobject(getObjectType(), getObjectClass(), object.isProcessingRule(), object.isIgnore(),
- body, buffer);
+ ObjectUtil.formatSubobject(getObjectType(), getObjectClass(), object.getProcessingRule(),
+ object.getIgnore(), body, buffer);
} else if (pceId.getIpAddress().getIpv6AddressNoZone() != null) {
final ByteBuf body = Unpooled.buffer(Ipv6Util.IPV6_LENGTH);
Ipv6Util.writeIpv6Address(pceId.getIpAddress().getIpv6AddressNoZone(), body);
- ObjectUtil.formatSubobject(getObjectType(), getObjectClass(), object.isProcessingRule(), object.isIgnore(),
- body, buffer);
+ ObjectUtil.formatSubobject(getObjectType(), getObjectClass(), object.getProcessingRule(),
+ object.getIgnore(), body, buffer);
}
}
}
serializeEnterpriseSpecificInformation(((VendorInformationObject) object).getEnterpriseSpecificInformation(),
body);
ObjectUtil.formatSubobject(VENDOR_INFORMATION_OBJECT_TYPE, VENDOR_INFORMATION_OBJECT_CLASS,
- object.isProcessingRule(), object.isIgnore(), body, buffer);
+ object.getProcessingRule(), object.getIgnore(), body, buffer);
}
-
}
"Wrong length of array of bytes. Passed: " + bytes.readableBytes()
+ "; Expected: " + BANDWIDTH_F_LENGTH + ".");
}
- final BandwidthBuilder builder = new BandwidthBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ return new BandwidthBuilder()
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setBandwidth(
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125
- .Bandwidth(ByteArray.getAllBytes(bytes)));
- return builder.build();
+ .Bandwidth(ByteArray.getAllBytes(bytes)))
+ .build();
}
@Override
"Wrong instance of PCEPObject. Passed %s. Needed BandwidthObject.", object.getClass());
final ByteBuf body = Unpooled.buffer();
writeFloat32(((Bandwidth) object).getBandwidth(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
@Override
public Object parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Cannot be null or empty.");
- if (!header.isProcessingRule()) {
+ if (!header.getProcessingRule()) {
LOG.debug("Processed bit not set on CLASS TYPE OBJECT, ignoring it");
return null;
}
}
final short ct = (short) bytes.readUnsignedInt();
final ClassTypeBuilder builder = new ClassTypeBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setClassType(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109
.ClassType(Uint8.valueOf(ct)));
.ClassType classType = ((ClassType) object).getClassType();
checkArgument(classType != null, "ClassType is mandatory.");
ByteBufUtils.write(body, classType.getValue());
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
final Uint8 reason = ByteBufUtils.readUint8(bytes);
final TlvsBuilder tlvsBuilder = new TlvsBuilder();
parseTlvs(tlvsBuilder, bytes.slice());
- final CCloseBuilder builder = new CCloseBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
- .setReason(reason)
- .setTlvs(tlvsBuilder.build());
- return builder.build();
+ return new CCloseBuilder()
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
+ .setReason(reason)
+ .setTlvs(tlvsBuilder.build())
+ .build();
}
@Override
body.writeZero(RESERVED + FLAGS_F_LENGTH);
ByteBufUtils.writeMandatory(body, obj.getReason(), "Reason");
serializeTlvs(obj.getTlvs(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
public void serializeTlvs(final Tlvs tlvs, final ByteBuf body) {
checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
bytes.skipBytes(FLAGS_F_LENGTH + RESERVED);
final ErrorObjectBuilder builder = new ErrorObjectBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setType(ByteBufUtils.readUint8(bytes))
.setValue(ByteBufUtils.readUint8(bytes));
parseTlvs(builder, bytes.slice());
ByteBufUtils.writeMandatory(body, errObj.getType(), "Type");
ByteBufUtils.writeMandatory(body, errObj.getValue(), "Value");
serializeTlvs(errObj.getTlvs(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
public void serializeTlvs(final Tlvs tlvs, final ByteBuf body) {
checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
bytes.skipBytes(FLAGS_OFFSET);
return new XroBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setFlags(new Flags(bytes.readBoolean()))
.setSubobject(parseSubobjects(bytes.slice()))
.build();
final ByteBuf body = Unpooled.buffer();
body.writeZero(FLAGS_OFFSET);
final Flags flags = obj.getFlags();
- body.writeBoolean(flags != null && Boolean.TRUE.equals(flags.isFail()));
+ body.writeBoolean(flags != null && Boolean.TRUE.equals(flags.getFail()));
serializeSubobject(obj.getSubobject(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
+ "; Expected: " + PCEPBandwidthObjectParser.BANDWIDTH_F_LENGTH + ".");
}
final ReoptimizationBandwidthBuilder builder = new ReoptimizationBandwidthBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setBandwidth(
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125
.Bandwidth(ByteArray.getAllBytes(bytes)));
object.getClass());
final ByteBuf body = Unpooled.buffer();
writeFloat32(((ReoptimizationBandwidth) object).getBandwidth(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
public Ero parseObject(final ObjectHeader header, final ByteBuf buffer) throws PCEPDeserializerException {
// Explicit approval of empty ERO
Preconditions.checkArgument(buffer != null, "Array of bytes is mandatory. Can't be null.");
- final EroBuilder builder = new EroBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
- .setSubobject(parseSubobjects(buffer));
- return builder.build();
+ return new EroBuilder()
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
+ .setSubobject(parseSubobjects(buffer))
+ .build();
}
@Override
public void serializeObject(final Object object, final ByteBuf buffer) {
Preconditions.checkArgument(object instanceof Ero,
"Wrong instance of PCEPObject. Passed %s. Needed EroObject.", object.getClass());
- final Ero ero = ((Ero) object);
+ final Ero ero = (Ero) object;
final ByteBuf body = Unpooled.buffer();
serializeSubobject(ero.getSubobject(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
public Gc parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Cannot be null or empty.");
final GcBuilder builder = new GcBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setMaxHop(ByteBufUtils.readUint8(bytes))
.setMaxUtilization(ByteBufUtils.readUint8(bytes))
.setMinUtilization(ByteBufUtils.readUint8(bytes))
ByteBufUtils.writeOrZero(body, specObj.getMinUtilization());
ByteBufUtils.writeOrZero(body, specObj.getOverBookingFactor());
serializeTlvs(specObj.getTlvs(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
public void serializeTlvs(final Tlvs tlvs, final ByteBuf body) {
for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit
.route.object.ero.Subobject s : parseSubobjects(bytes)) {
subs.add(new SubobjectBuilder()
- .setLoose(s.isLoose())
+ .setLoose(s.getLoose())
.setSubobjectType(s.getSubobjectType())
.build());
}
- final IroBuilder builder = new IroBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
- .setSubobject(subs);
- return builder.build();
+ return new IroBuilder()
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
+ .setSubobject(subs)
+ .build();
}
@Override
public void serializeObject(final Object object, final ByteBuf buffer) {
Preconditions.checkArgument(object instanceof Iro,
"Wrong instance of PCEPObject. Passed %s. Needed IroObject.", object.getClass());
- final Iro iro = ((Iro) object);
+ final Iro iro = (Iro) object;
final ByteBuf body = Unpooled.buffer();
final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit
.route.object.ero.Subobject> subs = new ArrayList<>();
- for (final Subobject s : iro.getSubobject()) {
+ for (final Subobject s : iro.nonnullSubobject()) {
subs.add(
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109
.explicit.route.object.ero.SubobjectBuilder()
- .setLoose(s.isLoose())
+ .setLoose(s.getLoose())
.setSubobjectType(s.getSubobjectType())
.build());
}
serializeSubobject(subs, body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
}
bytes.skipBytes(RESERVED + FLAGS_F_LENGTH);
return new LoadBalancingBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setMaxLsp(ByteBufUtils.readUint8(bytes))
.setMinBandwidth(new Bandwidth(ByteArray.readAllBytes(bytes)))
.build();
body.writeZero(RESERVED + FLAGS_F_LENGTH);
ByteBufUtils.writeOrZero(body, specObj.getMaxLsp());
writeFloat32(specObj.getMinBandwidth(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
public Lspa parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Cannot be null or empty.");
final LspaBuilder builder = new LspaBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setExcludeAny(new AttributeFilter(ByteBufUtils.readUint32(bytes)))
.setIncludeAll(new AttributeFilter(ByteBufUtils.readUint32(bytes)))
.setIncludeAny(new AttributeFilter(ByteBufUtils.readUint32(bytes)))
ByteBufUtils.writeOrZero(body, lspaObj.getSetupPriority());
ByteBufUtils.writeOrZero(body, lspaObj.getHoldPriority());
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(L_FLAG_OFFSET, lspaObj.isLocalProtectionDesired());
+ flags.set(L_FLAG_OFFSET, lspaObj.getLocalProtectionDesired());
flags.toByteBuf(body);
body.writeZero(RESERVED);
serializeTlvs(lspaObj.getTlvs(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
public void serializeTlvs(final Tlvs tlvs, final ByteBuf body) {
bytes.skipBytes(RESERVED);
final BitArray flags = BitArray.valueOf(bytes.readByte());
return new MetricBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setBound(flags.get(B_FLAG_OFFSET))
.setComputed(flags.get(C_FLAG_OFFSET))
.setMetricType(ByteBufUtils.readUint8(bytes))
final ByteBuf body = Unpooled.buffer(SIZE);
body.writeZero(RESERVED);
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(C_FLAG_OFFSET, mObj.isComputed());
- flags.set(B_FLAG_OFFSET, mObj.isBound());
+ flags.set(C_FLAG_OFFSET, mObj.getComputed());
+ flags.set(B_FLAG_OFFSET, mObj.getBound());
flags.toByteBuf(body);
ByteBufUtils.writeMandatory(body, mObj.getMetricType(), "MetricType");
writeFloat32(mObj.getValue(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
body.writeZero(RESERVED);
final Flags flags = monitoring.getFlags();
final BitArray flagBits = new BitArray(FLAGS_SIZE);
- flagBits.set(I_FLAG_POS, flags.isIncomplete());
- flagBits.set(C_FLAG_POS, flags.isOverload());
- flagBits.set(P_FLAG_POS, flags.isProcessingTime());
- flagBits.set(G_FLAG_POS, flags.isGeneral());
- flagBits.set(L_FLAG_POS, flags.isLiveness());
+ flagBits.set(I_FLAG_POS, flags.getIncomplete());
+ flagBits.set(C_FLAG_POS, flags.getOverload());
+ flagBits.set(P_FLAG_POS, flags.getProcessingTime());
+ flagBits.set(G_FLAG_POS, flags.getGeneral());
+ flagBits.set(L_FLAG_POS, flags.getLiveness());
flagBits.toByteBuf(body);
ByteBufUtils.writeOrZero(body, monitoring.getMonitoringId());
serializeTlvs(monitoring.getTlvs(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
@Override
final TlvsBuilder tlvsBuilder = new TlvsBuilder();
parseTlvs(tlvsBuilder, bytes.slice());
return new NoPathBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setNatureOfIssue(issue)
.setUnsatisfiedConstraints(flags.get(C_FLAG_OFFSET))
.setTlvs(tlvsBuilder.build())
final ByteBuf body = Unpooled.buffer();
ByteBufUtils.writeMandatory(body, nPObj.getNatureOfIssue(), "NatureOfIssue");
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(C_FLAG_OFFSET, nPObj.isUnsatisfiedConstraints());
+ flags.set(C_FLAG_OFFSET, nPObj.getUnsatisfiedConstraints());
flags.toByteBuf(body);
body.writeZero(RESERVED_F_LENGTH);
serializeTlvs(nPObj.getTlvs(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
public void serializeTlvs(final Tlvs tlvs, final ByteBuf body) {
checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
bytes.skipBytes(NT_F_OFFSET);
final CNotificationBuilder builder = new CNotificationBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setType(ByteBufUtils.readUint8(bytes))
.setValue(ByteBufUtils.readUint8(bytes));
parseTlvs(builder, bytes.slice());
ByteBufUtils.writeMandatory(body, notObj.getType(), "Type");
ByteBufUtils.writeMandatory(body, notObj.getValue(), "Value");
serializeTlvs(notObj.getTlvs(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
public void serializeTlvs(final Tlvs tlvs, final ByteBuf body) {
final TlvsBuilder tlvsBuilder = new TlvsBuilder();
parseTlvs(tlvsBuilder, bytes.slice());
return new OfBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setCode(new OfId(ofId))
.setTlvs(tlvsBuilder.build())
.build();
ByteBufUtils.write(body, code.getValue());
body.writeZero(RESERVED);
serializeTlvs(specObj.getTlvs(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
public void serializeTlvs(final Tlvs tlvs, final ByteBuf body) {
parseTlvs(tbuilder, bytes.slice());
final OpenBuilder builder = new OpenBuilder()
.setVersion(new ProtocolVersion(Uint8.valueOf(versionValue)))
- .setProcessingRule(header.isProcessingRule())
- .setIgnore(header.isIgnore())
+ .setProcessingRule(header.getProcessingRule())
+ .setIgnore(header.getIgnore())
.setKeepalive(Uint8.valueOf(keepalive))
.setSessionId(sessionId)
.setTlvs(tbuilder.build());
ByteBufUtils.writeOrZero(body, open.getDeadTimer());
ByteBufUtils.writeMandatory(body, open.getSessionId(), "SessionId");
serializeTlvs(open.getTlvs(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
public void serializeTlvs(final Tlvs tlvs, final ByteBuf body) {
final ByteBuf body = Unpooled.buffer(BODY_SIZE);
body.writeZero(RESERVED + FLAGS);
ByteBufUtils.writeOrZero(body, overload.getDuration());
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
@Override
final List<Subobject> subs = parseSubobjects(bytes);
for (final Subobject sub : subs) {
final PathKeyCase pkc = (PathKeyCase) sub.getSubobjectType();
- pk.add(new PathKeysBuilder().setLoose(sub.isLoose()).setPceId(pkc.getPathKey().getPceId())
+ pk.add(new PathKeysBuilder().setLoose(sub.getLoose()).setPceId(pkc.getPathKey().getPceId())
.setPathKey(pkc.getPathKey().getPathKey()).build());
}
- final PathKeyBuilder builder = new PathKeyBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
- .setPathKeys(pk);
- return builder.build();
+ return new PathKeyBuilder()
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
+ .setPathKeys(pk)
+ .build();
}
@Override
"Wrong instance of PCEPObject. Passed %s. Needed PathKeyObject.", object.getClass());
final PathKey pkey = (PathKey) object;
final ByteBuf body = Unpooled.buffer();
- final List<PathKeys> pks = pkey.getPathKeys();
final List<Subobject> subs = new ArrayList<>();
- for (final PathKeys pk : pks) {
+ for (final PathKeys pk : pkey.nonnullPathKeys()) {
subs.add(new SubobjectBuilder()
- .setLoose(pk.isLoose())
+ .setLoose(pk.getLoose())
.setSubobjectType(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp
.rev150820.explicit.route.subobjects.subobject.type.PathKeyCaseBuilder()
.setPathKey(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp
.build());
}
serializeSubobject(subs, body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
final ByteBuf body = Unpooled.buffer(BODY_SIZE);
body.writeZero(RESERVED);
final BitArray flagBits = new BitArray(FLAGS);
- flagBits.set(E_FLAG_POSITION, procTime.isEstimated());
+ flagBits.set(E_FLAG_POSITION, procTime.getEstimated());
flagBits.toByteBuf(body);
ByteBufUtils.writeOrZero(body, procTime.getCurrentProcTime());
ByteBufUtils.writeOrZero(body, procTime.getMinProcTime());
ByteBufUtils.writeOrZero(body, procTime.getMaxProcTime());
ByteBufUtils.writeOrZero(body, procTime.getAverageProcTime());
ByteBufUtils.writeOrZero(body, procTime.getVarianceProcTime());
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
@Override
public Rro parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
Preconditions.checkArgument(bytes != null && bytes.isReadable(),
"Array of bytes is mandatory. Can't be null or empty.");
- final RroBuilder builder = new RroBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
- .setSubobject(parseSubobjects(bytes.slice()));
- return builder.build();
+ return new RroBuilder()
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
+ .setSubobject(parseSubobjects(bytes.slice()))
+ .build();
}
@Override
final Rro obj = (Rro) object;
final ByteBuf body = Unpooled.buffer();
serializeSubobject(obj.getSubobject(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
final TlvsBuilder tlvsBuilder = new TlvsBuilder();
parseTlvs(tlvsBuilder, bytes.slice());
final RpBuilder builder = new RpBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setFragmentation(flags.get(F_FLAG_OFFSET))
.setP2mp(flags.get(N_FLAG_OFFSET))
.setEroCompression(flags.get(E_FLAG_OFFSET))
final ByteBuf body = Unpooled.buffer();
final Rp rpObj = (Rp) object;
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(R_FLAG_OFFSET, rpObj.isReoptimization());
- flags.set(B_FLAG_OFFSET, rpObj.isBiDirectional());
- flags.set(O_FLAG_OFFSET, rpObj.isLoose());
- flags.set(M_FLAG_OFFSET, rpObj.isMakeBeforeBreak());
- flags.set(D_FLAG_OFFSET, rpObj.isOrder());
- flags.set(P_FLAG_OFFSET, rpObj.isPathKey());
- flags.set(S_FLAG_OFFSET, rpObj.isSupplyOf());
- flags.set(F_FLAG_OFFSET, rpObj.isFragmentation());
- flags.set(N_FLAG_OFFSET, rpObj.isP2mp());
- flags.set(E_FLAG_OFFSET, rpObj.isEroCompression());
+ flags.set(R_FLAG_OFFSET, rpObj.getReoptimization());
+ flags.set(B_FLAG_OFFSET, rpObj.getBiDirectional());
+ flags.set(O_FLAG_OFFSET, rpObj.getLoose());
+ flags.set(M_FLAG_OFFSET, rpObj.getMakeBeforeBreak());
+ flags.set(D_FLAG_OFFSET, rpObj.getOrder());
+ flags.set(P_FLAG_OFFSET, rpObj.getPathKey());
+ flags.set(S_FLAG_OFFSET, rpObj.getSupplyOf());
+ flags.set(F_FLAG_OFFSET, rpObj.getFragmentation());
+ flags.set(N_FLAG_OFFSET, rpObj.getP2mp());
+ flags.set(E_FLAG_OFFSET, rpObj.getEroCompression());
final byte[] res = flags.array();
if (rpObj.getPriority() != null) {
final byte p = rpObj.getPriority().byteValue();
checkArgument(requestId != null, "RequestId is mandatory");
ByteBufUtils.write(body, requestId.getValue());
serializeTlvs(rpObj.getTlvs(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
public void serializeTlvs(final Tlvs tlvs, final ByteBuf body) {
Preconditions.checkArgument(buffer != null && buffer.isReadable(), EMPTY_ARRAY_ERROR);
final SeroBuilder builder = new SeroBuilder();
- builder.setIgnore(header.isIgnore());
- builder.setProcessingRule(header.isProcessingRule());
+ builder.setIgnore(header.getIgnore());
+ builder.setProcessingRule(header.getProcessingRule());
final List<Subobject> subObjects = parseSubobjects(buffer);
builder.setSubobject(subObjects.stream()
- .map(so -> new SubobjectBuilder().setLoose(so.isLoose()).setSubobjectType(so.getSubobjectType()).build())
+ .map(so -> new SubobjectBuilder().setLoose(so.getLoose()).setSubobjectType(so.getSubobjectType()).build())
.collect(Collectors.toList()));
return builder.build();
public void serializeObject(final Object object, final ByteBuf buffer) {
Preconditions.checkArgument(object instanceof Sero,
"Wrong instance of PCEPObject. Passed %s. Needed EroObject.", object.getClass());
- final Sero sero = ((Sero) object);
+ final Sero sero = (Sero) object;
final ByteBuf body = Unpooled.buffer();
- final List<Subobject> subObjects = sero.getSubobject().stream()
+ final List<Subobject> subObjects = sero.nonnullSubobject().stream()
.map(so -> new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109
.explicit.route.object.ero.SubobjectBuilder()
- .setLoose(so.isLoose())
+ .setLoose(so.getLoose())
.setSubobjectType(so.getSubobjectType())
.build())
.collect(Collectors.toList());
serializeSubobject(subObjects, body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
Preconditions.checkArgument(buffer != null && buffer.isReadable(), EMPTY_ARRAY_ERROR);
final SrroBuilder builder = new SrroBuilder();
- builder.setIgnore(header.isIgnore());
- builder.setProcessingRule(header.isProcessingRule());
+ builder.setIgnore(header.getIgnore());
+ builder.setProcessingRule(header.getProcessingRule());
final List<Subobject> subObjects = parseSubobjects(buffer);
builder.setSubobject(subObjects.stream()
.map(so -> new SubobjectBuilder()
.setSubobjectType(so.getSubobjectType())
- .setProtectionAvailable(so.isProtectionAvailable())
- .setProtectionInUse(so.isProtectionInUse())
+ .setProtectionAvailable(so.getProtectionAvailable())
+ .setProtectionInUse(so.getProtectionInUse())
.build())
.collect(Collectors.toList()));
public void serializeObject(final Object object, final ByteBuf buffer) {
Preconditions.checkArgument(object instanceof Srro,
"Wrong instance of PCEPObject. Passed %s. Needed EroObject.", object.getClass());
- final Srro sero = ((Srro) object);
+ final Srro sero = (Srro) object;
final ByteBuf body = Unpooled.buffer();
- final List<Subobject> subObjects = sero.getSubobject().stream()
+ final List<Subobject> subObjects = sero.nonnullSubobject().stream()
.map(so -> new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109
.reported.route.object.rro.SubobjectBuilder()
.setSubobjectType(so.getSubobjectType())
- .setProtectionAvailable(so.isProtectionAvailable())
- .setProtectionInUse(so.isProtectionInUse())
+ .setProtectionAvailable(so.getProtectionAvailable())
+ .setProtectionInUse(so.getProtectionInUse())
.build())
.collect(Collectors.toList());
serializeSubobject(subObjects, body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
throw new PCEPDeserializerException("Empty Svec Object - no request ids.");
}
return new SvecBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setLinkDiverse(flags.get(L_FLAG_OFFSET))
.setNodeDiverse(flags.get(N_FLAG_OFFSET))
.setSrlgDiverse(flags.get(S_FLAG_OFFSET))
final ByteBuf body = Unpooled.buffer();
body.writeZero(FLAGS_F_OFFSET);
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(L_FLAG_OFFSET, svecObj.isLinkDiverse());
- flags.set(N_FLAG_OFFSET, svecObj.isNodeDiverse());
- flags.set(S_FLAG_OFFSET, svecObj.isSrlgDiverse());
- flags.set(D_FLAG_OFFSET, svecObj.isLinkDirectionDiverse());
- flags.set(P_FLAG_OFFSET, svecObj.isPartialPathDiverse());
+ flags.set(L_FLAG_OFFSET, svecObj.getLinkDiverse());
+ flags.set(N_FLAG_OFFSET, svecObj.getNodeDiverse());
+ flags.set(S_FLAG_OFFSET, svecObj.getSrlgDiverse());
+ flags.set(D_FLAG_OFFSET, svecObj.getLinkDirectionDiverse());
+ flags.set(P_FLAG_OFFSET, svecObj.getPartialPathDiverse());
flags.toByteBuf(body);
final List<RequestId> requestIDs = svecObj.getRequestsIds();
for (final RequestId requestId : requestIDs) {
ByteBufUtils.write(body, requestId.getValue());
}
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
Preconditions.checkArgument(type instanceof IpPrefixCase,
"Wrong instance of PCEPObject. Passed %s. Needed IpPrefixCase.", type.getClass());
return new SubobjectBuilder().setIpPrefix(((IpPrefixCase) type).getIpPrefix().getIpPrefix())
- .setLoose(sob.isLoose()).build();
+ .setLoose(sob.getLoose()).build();
}).collect(Collectors.toList());
}
return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109
.explicit.route.object.ero.SubobjectBuilder()
.setSubobjectType(subObjType)
- .setLoose(sob.isLoose())
+ .setLoose(sob.getLoose())
.build();
}).collect(Collectors.toList());
}
throws PCEPDeserializerException {
Preconditions.checkArgument(bytes != null && bytes.isReadable(),
"Array of bytes is mandatory. Can't be null or empty.");
- final BranchNodeListBuilder builder = new BranchNodeListBuilder();
- builder.setIgnore(header.isIgnore());
- builder.setProcessingRule(header.isProcessingRule());
- builder.setSubobject(BNCUtil.toBncSubobject(parseSubobjects(bytes))).build();
- return builder.build();
+ return new BranchNodeListBuilder()
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
+ .setSubobject(BNCUtil.toBncSubobject(parseSubobjects(bytes)))
+ .build();
}
@Override
public void serializeObject(final Object object, final ByteBuf buffer) {
Preconditions.checkArgument(object instanceof BranchNodeList,
"Wrong instance of PCEPObject. Passed %s. Needed BranchNodeList.", object.getClass());
- final BranchNodeList nbnc = ((BranchNodeList) object);
+ final BranchNodeList nbnc = (BranchNodeList) object;
final ByteBuf body = Unpooled.buffer();
serializeSubobject(BNCUtil.toIroSubject(nbnc.getSubobject()), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
throws PCEPDeserializerException {
Preconditions.checkArgument(bytes != null && bytes.isReadable(),
"Array of bytes is mandatory. Can't be null or empty.");
- final NonBranchNodeListBuilder builder = new NonBranchNodeListBuilder();
- builder.setIgnore(header.isIgnore());
- builder.setProcessingRule(header.isProcessingRule());
- builder.setSubobject(BNCUtil.toBncSubobject(parseSubobjects(bytes)));
- return builder.build();
+ return new NonBranchNodeListBuilder()
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
+ .setSubobject(BNCUtil.toBncSubobject(parseSubobjects(bytes)))
+ .build();
}
@Override
public void serializeObject(final Object object, final ByteBuf buffer) {
Preconditions.checkArgument(object instanceof NonBranchNodeList,
"Wrong instance of PCEPObject. Passed %s. Needed NonBranchNodeList.", object.getClass());
- final NonBranchNodeList nbnc = ((NonBranchNodeList) object);
+ final NonBranchNodeList nbnc = (NonBranchNodeList) object;
final ByteBuf body = Unpooled.buffer();
serializeSubobject(BNCUtil.toIroSubject(nbnc.getSubobject()), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
}
public Object parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
final EndpointsObjBuilder builder = new EndpointsObjBuilder();
- if (!header.isProcessingRule()) {
+ if (!header.getProcessingRule()) {
LOG.debug("Processed bit not set on Endpoints OBJECT, ignoring it.");
return new UnknownObject(PCEPErrors.P_FLAG_NOT_SET, builder.build());
}
final Ipv4Builder ipv4bldr = new Ipv4Builder()
.setSourceIpv4Address(Ipv4Util.addressForByteBuf(bytes))
.setDestinationIpv4Address(Ipv4Util.addressForByteBuf(bytes));
- builder.setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ builder.setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setAddressFamily(new Ipv4CaseBuilder().setIpv4(ipv4bldr.build()).build());
return builder.build();
}
public Object parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
final EndpointsObjBuilder builder = new EndpointsObjBuilder();
- if (!header.isProcessingRule()) {
+ if (!header.getProcessingRule()) {
LOG.debug("Processed bit not set on Endpoints OBJECT, ignoring it.");
return new UnknownObject(PCEPErrors.P_FLAG_NOT_SET, builder.build());
}
final Ipv6Builder ipv6bldr = new Ipv6Builder()
.setSourceIpv6Address(Ipv6Util.addressForByteBuf(bytes))
.setDestinationIpv6Address(Ipv6Util.addressForByteBuf(bytes));
- return builder.setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ return builder.setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setAddressFamily(new Ipv6CaseBuilder().setIpv6(ipv6bldr.build()).build())
.build();
}
"Wrong instance of PCEPObject. Passed %s. Needed EndpointsObject.", object.getClass());
final EndpointsObj ePObj = (EndpointsObj) object;
final AddressFamily afi = ePObj.getAddressFamily();
- final Boolean processing = object.isProcessingRule();
- final Boolean ignore = object.isIgnore();
+ final Boolean processing = object.getProcessingRule();
+ final Boolean ignore = object.getIgnore();
if (afi instanceof Ipv6Case) {
final Ipv6 ipv6 = ((Ipv6Case) afi).getIpv6();
PCEPEndPointsIpv6ObjectParser.serializeObject(processing, ignore, ipv6, buffer);
public Object parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
final EndpointsObjBuilder builder = new EndpointsObjBuilder();
- if (!header.isProcessingRule()) {
+ if (!header.getProcessingRule()) {
LOG.debug("Processed bit not set on Endpoints OBJECT, ignoring it.");
return new UnknownObject(PCEPErrors.P_FLAG_NOT_SET, builder.build());
}
if (bytes.readableBytes() % Ipv4Util.IP4_LENGTH != 0) {
throw new PCEPDeserializerException("Wrong length of array of bytes.");
}
- builder.setIgnore(header.isIgnore());
- builder.setProcessingRule(header.isProcessingRule());
+ builder.setIgnore(header.getIgnore());
+ builder.setProcessingRule(header.getProcessingRule());
final P2mpIpv4Builder p2mpIpv4Builder = new P2mpIpv4Builder();
p2mpIpv4Builder.setP2mpLeaves(P2mpLeaves.forValue(bytes.readInt()));
p2mpIpv4Builder.setSourceIpv4Address(Ipv4Util.addressForByteBuf(bytes));
@Override
public Object parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
- if (!header.isProcessingRule()) {
+ if (!header.getProcessingRule()) {
LOG.debug("Processed bit not set on Endpoints OBJECT, ignoring it.");
return new UnknownObject(PCEPErrors.P_FLAG_NOT_SET, new EndpointsObjBuilder().build());
}
}
p2mpIpv6Builder.setDestinationIpv6Address(dest);
return new EndpointsObjBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule())
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule())
.setAddressFamily(new P2mpIpv6CaseBuilder().setP2mpIpv6(p2mpIpv6Builder.build()).build())
.build();
}
if (bytes.readableBytes() % Ipv4Util.IP4_LENGTH != 0) {
throw new PCEPDeserializerException("Wrong length of array of bytes.");
}
- builder.setIgnore(header.isIgnore());
- builder.setProcessingRule(header.isProcessingRule());
+ builder.setIgnore(header.getIgnore());
+ builder.setProcessingRule(header.getProcessingRule());
List<Ipv4AddressNoZone> dest = new ArrayList<>();
while (bytes.isReadable()) {
dest.add(Ipv4Util.addressForByteBuf(bytes));
if (bytes.readableBytes() % Ipv6Util.IPV6_LENGTH != 0) {
throw new PCEPDeserializerException("Wrong length of array of bytes.");
}
- builder.setIgnore(header.isIgnore());
- builder.setProcessingRule(header.isProcessingRule());
+ builder.setIgnore(header.getIgnore());
+ builder.setProcessingRule(header.getProcessingRule());
List<Ipv6AddressNoZone> dest = new ArrayList<>();
while (bytes.isReadable()) {
dest.add(Ipv6Util.addressForByteBuf(bytes));
"Wrong instance of PCEPObject. Passed %s. Needed UnreachDestinationObj.", object.getClass());
final UnreachDestinationObj uPObj = (UnreachDestinationObj) object;
final Destination destination = uPObj.getDestination();
- final Boolean processing = object.isProcessingRule();
- final Boolean ignore = object.isIgnore();
+ final Boolean processing = object.getProcessingRule();
+ final Boolean ignore = object.getIgnore();
if (destination instanceof Ipv6DestinationCase) {
- final Ipv6DestinationCase ipv6 = ((Ipv6DestinationCase) destination);
+ final Ipv6DestinationCase ipv6 = (Ipv6DestinationCase) destination;
PCEPIpv6UnreachDestinationParser.serializeObject(processing, ignore, ipv6, buffer);
} else if (destination instanceof Ipv4DestinationCase) {
- final Ipv4DestinationCase ipv4 = ((Ipv4DestinationCase) destination);
+ final Ipv4DestinationCase ipv4 = (Ipv4DestinationCase) destination;
PCEPIpv4UnreachDestinationParser.serializeObject(processing, ignore, ipv4, buffer);
}
}
Preconditions.checkArgument(subobject.getSubobjectType() instanceof AsNumberCase,
"Unknown subobject instance. Passed %s. Needed AsNumberCase.", subobject.getSubobjectType().getClass());
final ByteBuf body = AsNumberCaseParser.serializeSubobject((AsNumberCase) subobject.getSubobjectType());
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
}
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820
.explicit.route.subobjects.subobject.type.exrs._case.exrs.ExrsBuilder()
.setAttribute(xro.getAttribute())
- .setMandatory(xro.isMandatory())
+ .setMandatory(xro.getMandatory())
.setSubobjectType(xro.getSubobjectType());
exrss.add(exrsBuilder.build());
}
.route.object.xro.Subobject> xros = new ArrayList<>();
while (buffer.isReadable()) {
final boolean mandatory =
- ((buffer.getByte(buffer.readerIndex()) & (1 << Values.FIRST_BIT_OFFSET)) != 0) ? true : false;
+ (buffer.getByte(buffer.readerIndex()) & 1 << Values.FIRST_BIT_OFFSET) != 0 ? true : false;
final int type =
- (buffer.readUnsignedByte() & Values.BYTE_MAX_VALUE_BYTES) & ~(1 << Values.FIRST_BIT_OFFSET);
+ buffer.readUnsignedByte() & Values.BYTE_MAX_VALUE_BYTES & ~(1 << Values.FIRST_BIT_OFFSET);
final int length = buffer.readUnsignedByte() - HEADER_LENGTH;
if (length > buffer.readableBytes()) {
throw new PCEPDeserializerException("Wrong length specified. Passed: " + length + "; Expected: <= "
final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.exclude
.route.object.xro.Subobject> xros = new ArrayList<>();
for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit
- .route.subobjects.subobject.type.exrs._case.exrs.Exrs exr : exrs.getExrs()) {
+ .route.subobjects.subobject.type.exrs._case.exrs.Exrs exr : exrs.nonnullExrs()) {
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109
.exclude.route.object.xro.SubobjectBuilder xroBuilder =
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109
.exclude.route.object.xro.SubobjectBuilder()
.setAttribute(exr.getAttribute())
- .setMandatory(exr.isMandatory())
+ .setMandatory(exr.getMandatory())
.setSubobjectType(exr.getSubobjectType());
xros.add(xroBuilder.build());
}
final ByteBuf body = Unpooled.buffer();
serializeSubobject(xros, body);
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
private void serializeSubobject(
checkArgument(prefix.getIpv4Prefix() != null, "Ipv4Prefix is mandatory.");
Ipv4Util.writeIpv4Prefix(prefix.getIpv4Prefix(), body);
body.writeZero(RESERVED);
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
}
final ByteBuf body = Unpooled.buffer();
Ipv6Util.writeIpv6Prefix(ipv6prefix, body);
body.writeZero(RESERVED);
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
}
"Unknown subobject instance. Passed %s. Needed LabelCase.", subobject.getSubobjectType().getClass());
final Label label = ((LabelCase) subobject.getSubobjectType()).getLabel();
final ByteBuf body = Unpooled.buffer();
- this.registry.serializeLabel(label.isUniDirectional(), false, label.getLabelType(), body);
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ this.registry.serializeLabel(label.getUniDirectional(), false, label.getLabelType(), body);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
}
body.writeZero(RESERVED);
ByteBufUtils.writeMandatory(body, specObj.getRouterId(), "RouterId");
ByteBufUtils.writeMandatory(body, specObj.getInterfaceId(), "InterfaceId");
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
}
.build();
buffer.skipBytes(PREFIX_F_LENGTH);
final BitArray flags = BitArray.valueOf(buffer, FLAGS_SIZE);
- final SubobjectBuilder builder = new SubobjectBuilder()
+ return new SubobjectBuilder()
.setProtectionAvailable(flags.get(LPA_F_OFFSET))
.setProtectionInUse(flags.get(LPIU_F_OFFSET))
- .setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(prefix).build());
- return builder.build();
+ .setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(prefix).build())
+ .build();
}
@Override
}
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(LPA_F_OFFSET, subobject.isProtectionAvailable());
- flags.set(LPIU_F_OFFSET, subobject.isProtectionInUse());
+ flags.set(LPA_F_OFFSET, subobject.getProtectionAvailable());
+ flags.set(LPIU_F_OFFSET, subobject.getProtectionInUse());
final ByteBuf body = Unpooled.buffer(CONTENT4_LENGTH);
checkArgument(prefix.getIpv4Prefix() != null, "Ipv4Prefix is mandatory.");
Ipv4Util.writeIpv4Prefix(prefix.getIpv4Prefix(), body);
static void serializeSubobject(final ByteBuf buffer, final Subobject subobject, final Ipv6Prefix ipv6prefix) {
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(LPA_F_OFFSET, subobject.isProtectionAvailable());
- flags.set(LPIU_F_OFFSET, subobject.isProtectionInUse());
+ flags.set(LPA_F_OFFSET, subobject.getProtectionAvailable());
+ flags.set(LPIU_F_OFFSET, subobject.getProtectionInUse());
final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
Ipv6Util.writeIpv6Prefix(ipv6prefix, body);
flags.toByteBuf(body);
requireNonNull(subobject.getSubobjectType(), "Subobject type cannot be empty.");
final Label label = ((LabelCase) subobject.getSubobjectType()).getLabel();
final ByteBuf body = Unpooled.buffer();
- this.registry.serializeLabel(label.isUniDirectional(), label.isGlobal(), label.getLabelType(), body);
+ this.registry.serializeLabel(label.getUniDirectional(), label.getGlobal(), label.getLabelType(), body);
RROSubobjectUtil.formatSubobject(TYPE, body, buffer);
}
}
"Unknown subobject instance. Passed %s. Needed UnnumberedCase.", subobject.getSubobjectType().getClass());
final UnnumberedSubobject specObj = ((UnnumberedCase) subobject.getSubobjectType()).getUnnumbered();
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(LPA_F_OFFSET, subobject.isProtectionAvailable());
- flags.set(LPIU_F_OFFSET, subobject.isProtectionInUse());
+ flags.set(LPA_F_OFFSET, subobject.getProtectionAvailable());
+ flags.set(LPIU_F_OFFSET, subobject.getProtectionInUse());
final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
flags.toByteBuf(body);
body.writeZero(RESERVED);
@Override
public Subobject parseSubobject(final ByteBuf buffer, final boolean mandatory) throws PCEPDeserializerException {
return new SubobjectBuilder().setMandatory(mandatory)
- .setSubobjectType(AsNumberCaseParser.parseSubobject(buffer)).build();
+ .setSubobjectType(AsNumberCaseParser.parseSubobject(buffer))
+ .build();
}
@Override
Preconditions.checkArgument(subobject.getSubobjectType() instanceof AsNumberCase,
"Unknown subobject instance. Passed %s. Needed AsNumberCase.", subobject.getSubobjectType().getClass());
final ByteBuf body = AsNumberCaseParser.serializeSubobject((AsNumberCase) subobject.getSubobjectType());
- XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(TYPE, subobject.getMandatory(), body, buffer);
}
}
final Attribute attribute = subobject.getAttribute();
checkArgument(attribute != null, "Attribute is mandatory.");
body.writeByte(attribute.getIntValue());
- XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(TYPE, subobject.getMandatory(), body, buffer);
}
}
final Attribute attribute = subobject.getAttribute();
checkArgument(attribute != null, "Attribute is mandatory.");
body.writeByte(attribute.getIntValue());
- XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(TYPE, subobject.getMandatory(), body, buffer);
}
}
final PceId pceId = pk.getPceId();
checkArgument(pceId != null, "PceId is mandatory.");
body.writeBytes(pceId.getValue());
- XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(TYPE, subobject.getMandatory(), body, buffer);
}
}
ByteBufUtils.write(body, pathKey.getValue());
checkArgument(pceId.length == PCE_ID_F_LENGTH, "PceId 32 Bit required.");
body.writeBytes(pceId);
- XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(TYPE, subobject.getMandatory(), body, buffer);
}
}
checkArgument(attribute != null, "Attribute is mandatory.");
body.writeByte(0);
body.writeByte(attribute.getIntValue());
- XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(TYPE, subobject.getMandatory(), body, buffer);
}
}
final UnnumberedBuilder ubuilder = new UnnumberedBuilder()
.setRouterId(ByteBufUtils.readUint32(buffer))
.setInterfaceId(ByteBufUtils.readUint32(buffer));
- final SubobjectBuilder builder = new SubobjectBuilder()
+ return new SubobjectBuilder()
.setMandatory(mandatory)
.setAttribute(attr)
- .setSubobjectType(new UnnumberedCaseBuilder().setUnnumbered(ubuilder.build()).build());
- return builder.build();
+ .setSubobjectType(new UnnumberedCaseBuilder().setUnnumbered(ubuilder.build()).build())
+ .build();
}
@Override
ByteBufUtils.writeMandatory(body, specObj.getRouterId(), "RouterId");
ByteBufUtils.writeMandatory(body, specObj.getInterfaceId(), "InterfaceId");
- XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(TYPE, subobject.getMandatory(), body, buffer);
}
}
final ByteBuf body = Unpooled.buffer();
final BitArray flags = new BitArray(FLAGS_SIZE);
final Flags f = noPath.getFlags();
- flags.set(REACHABLITY_PROBLEM, f.isP2mpUnreachable());
- flags.set(NO_GCO_SOLUTION, f.isNoGcoSolution());
- flags.set(NO_GCO_MIGRATION_PATH, f.isNoGcoMigration());
- flags.set(PATH_KEY, f.isPathKey());
- flags.set(CHAIN_UNAVAILABLE, f.isChainUnavailable());
- flags.set(UNKNOWN_SRC, f.isUnknownSource());
- flags.set(UNKNOWN_DEST, f.isUnknownDestination());
- flags.set(PCE_UNAVAILABLE, f.isPceUnavailable());
+ flags.set(REACHABLITY_PROBLEM, f.getP2mpUnreachable());
+ flags.set(NO_GCO_SOLUTION, f.getNoGcoSolution());
+ flags.set(NO_GCO_MIGRATION_PATH, f.getNoGcoMigration());
+ flags.set(PATH_KEY, f.getPathKey());
+ flags.set(CHAIN_UNAVAILABLE, f.getChainUnavailable());
+ flags.set(UNKNOWN_SRC, f.getUnknownSource());
+ flags.set(UNKNOWN_DEST, f.getUnknownDestination());
+ flags.set(PCE_UNAVAILABLE, f.getPceUnavailable());
flags.toByteBuf(body);
TlvUtil.formatTlv(TYPE, body, buffer);
}
@Override
protected BitArray serializeFlags(final Lsp specObj) {
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(DELEGATE, specObj.isDelegate());
- flags.set(REMOVE, specObj.isRemove());
- flags.set(SYNC, specObj.isSync());
- flags.set(ADMINISTRATIVE, specObj.isAdministrative());
- if (specObj.augmentation(Lsp1.class) != null) {
- flags.set(CREATE_FLAG_OFFSET, specObj.augmentation(Lsp1.class).isCreate());
+ flags.set(DELEGATE, specObj.getDelegate());
+ flags.set(REMOVE, specObj.getRemove());
+ flags.set(SYNC, specObj.getSync());
+ flags.set(ADMINISTRATIVE, specObj.getAdministrative());
+ final Lsp1 aug = specObj.augmentation(Lsp1.class);
+ if (aug != null) {
+ flags.set(CREATE_FLAG_OFFSET, aug.getCreate());
}
return flags;
}
serializeObject(req.getEro(), buffer);
serializeObject(req.getLspa(), buffer);
serializeObject(req.getBandwidth(), buffer);
- if (req.getMetrics() != null) {
- for (final Metrics m : req.getMetrics()) {
- serializeObject(m.getMetric(), buffer);
- }
+ for (final Metrics m : req.nonnullMetrics()) {
+ serializeObject(m.getMetric(), buffer);
}
serializeObject(req.getIro(), buffer);
}
@Override
protected void serializeFlags(final Srp srp, final ByteBuf body) {
final BitArray flags = new BitArray(FLAGS_SIZE);
- if (srp.augmentation(Srp1.class) != null) {
- flags.set(REMOVE_FLAG, srp.augmentation(Srp1.class).isRemove());
+ final Srp1 aug = srp.augmentation(Srp1.class);
+ if (aug != null) {
+ flags.set(REMOVE_FLAG, aug.getRemove());
}
flags.toByteBuf(body);
}
final BitArray flags = new BitArray(FLAGS_F_LENGTH);
final Stateful1 sfi = sct.augmentation(Stateful1.class);
if (sfi != null) {
- flags.set(I_FLAG_OFFSET, sfi.isInitiation());
+ flags.set(I_FLAG_OFFSET, sfi.getInitiation());
}
- flags.set(U_FLAG_OFFSET, sct.isLspUpdateCapability());
+ flags.set(U_FLAG_OFFSET, sct.getLspUpdateCapability());
return flags;
}
}
}
public PCEPStatefulCapability(final PcepIetfStatefulConfig config) {
- this(config.isStateful(), config.isActive(), config.isInitiated(), config.isTriggeredInitialSync(),
- config.isTriggeredResync(), config.isDeltaLspSyncCapability(), config.isIncludeDbVersion());
+ this(config.getStateful(), config.getActive(), config.getInitiated(), config.getTriggeredInitialSync(),
+ config.getTriggeredResync(), config.getDeltaLspSyncCapability(), config.getIncludeDbVersion());
}
@Override
final MplsLabelEntry mplsEntry = (MplsLabelEntry) bindingValue;
final long entry = getMplsStackEntry(mplsEntry.getLabel())
| mplsEntry.getTrafficClass().toJava() << TC_SHIFT
- | (mplsEntry.isBottomOfStack() ? 1 : 0) << S_SHIFT
+ | (mplsEntry.getBottomOfStack() ? 1 : 0) << S_SHIFT
| mplsEntry.getTimeToLive().toJava();
ByteBufUtils.write(buf, Uint32.valueOf(entry));
}
state = State.ERROR_IN;
} else if (obj instanceof Rp) {
final Rp o = (Rp) obj;
- if (o.isProcessingRule()) {
+ if (o.getProcessingRule()) {
errors.add(createErrorMsg(PCEPErrors.P_FLAG_NOT_SET, Optional.empty()));
return null;
}
@Override
public Lsp parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
- final LspBuilder builder = new LspBuilder();
- builder.setIgnore(header.isIgnore());
- builder.setProcessingRule(header.isProcessingRule());
+ final LspBuilder builder = new LspBuilder()
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule());
final int[] plspIdRaw
= new int[] { bytes.readUnsignedByte(), bytes.readUnsignedByte(), bytes.getUnsignedByte(2), };
builder.setPlspId(new PlspId(Uint32.valueOf(plspIdRaw[0] << FLAGS_SIZE | plspIdRaw[1] << FOUR_BITS_SHIFT
res[res.length - 1] = (byte) (res[res.length - 1] | op);
body.writeByte(res[res.length - 1]);
serializeTlvs(specObj.getTlvs(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
protected BitArray serializeFlags(final Lsp specObj) {
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(DELEGATE, specObj.isDelegate());
- flags.set(REMOVE, specObj.isRemove());
- flags.set(SYNC, specObj.isSync());
- flags.set(ADMINISTRATIVE, specObj.isAdministrative());
+ flags.set(DELEGATE, specObj.getDelegate());
+ flags.set(REMOVE, specObj.getRemove());
+ flags.set(SYNC, specObj.getSync());
+ flags.set(ADMINISTRATIVE, specObj.getAdministrative());
return flags;
}
serializeObject(p.getLspa(), buffer);
serializeObject(p.getBandwidth(), buffer);
serializeObject(p.getReoptimizationBandwidth(), buffer);
- if (p.getMetrics() != null) {
- for (final Metrics m : p.getMetrics()) {
- serializeObject(m.getMetric(), buffer);
- }
+ for (final Metrics m : p.nonnullMetrics()) {
+ serializeObject(m.getMetric(), buffer);
}
serializeObject(p.getIro(), buffer);
serializeObject(p.getRro(), buffer);
serializeObject(p.getLspa(), buffer);
serializeObject(p.getBandwidth(), buffer);
serializeObject(p.getReoptimizationBandwidth(), buffer);
- if (p.getMetrics() != null) {
- for (final Metrics m : p.getMetrics()) {
- serializeObject(m.getMetric(), buffer);
- }
+ for (final Metrics m : p.nonnullMetrics()) {
+ serializeObject(m.getMetric(), buffer);
}
serializeObject(p.getIro(), buffer);
}
private static void serializeRsvp(final RsvpError rsvp, final ByteBuf body) {
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(IN_PLACE, rsvp.getFlags().isInPlace());
- flags.set(NOT_GUILTY, rsvp.getFlags().isNotGuilty());
+ flags.set(IN_PLACE, rsvp.getFlags().getInPlace());
+ flags.set(NOT_GUILTY, rsvp.getFlags().getNotGuilty());
final IpAddressNoZone node = rsvp.getNode();
checkArgument(node != null, "Node is mandatory.");
final ByteBuf rsvpObjBuf = Unpooled.buffer();
+ "; Expected: >=" + MIN_SIZE + ".");
}
final SrpBuilder builder = new SrpBuilder()
- .setIgnore(header.isIgnore())
- .setProcessingRule(header.isProcessingRule());
+ .setIgnore(header.getIgnore())
+ .setProcessingRule(header.getProcessingRule());
parseFlags(builder, bytes);
builder.setOperationId(new SrpIdNumber(ByteBufUtils.readUint32(bytes)));
final TlvsBuilder tlvsBuilder = new TlvsBuilder();
checkArgument(srpId != null, "SrpId is mandatory.");
ByteBufUtils.write(body, srpId.getValue());
serializeTlvs(srp.getTlvs(), body);
- ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer);
+ ObjectUtil.formatSubobject(TYPE, CLASS, object.getProcessingRule(), object.getIgnore(), body, buffer);
}
protected void serializeFlags(final Srp srp, final ByteBuf body) {
protected BitArray serializeFlags(final Stateful sct) {
final BitArray flags = new BitArray(FLAGS_F_LENGTH);
- flags.set(U_FLAG_OFFSET, sct.isLspUpdateCapability());
+ flags.set(U_FLAG_OFFSET, sct.getLspUpdateCapability());
return flags;
}
}
.rev200720.Stateful1 sf2 = sct.augmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
.controller.pcep.sync.optimizations.rev200720.Stateful1.class);
if (sf2 != null) {
- flags.set(F_FLAG_OFFSET, sf2.isTriggeredInitialSync());
- flags.set(D_FLAG_OFFSET, sf2.isDeltaLspSyncCapability());
- flags.set(T_FLAG_OFFSET, sf2.isTriggeredResync());
- flags.set(S_FLAG_OFFSET, sf2.isIncludeDbVersion());
+ flags.set(F_FLAG_OFFSET, sf2.getTriggeredInitialSync());
+ flags.set(D_FLAG_OFFSET, sf2.getDeltaLspSyncCapability());
+ flags.set(T_FLAG_OFFSET, sf2.getTriggeredResync());
+ flags.set(S_FLAG_OFFSET, sf2.getIncludeDbVersion());
}
if (sfi != null) {
- flags.set(I_FLAG_OFFSET, sfi.isInitiation());
+ flags.set(I_FLAG_OFFSET, sfi.getInitiation());
}
- flags.set(U_FLAG_OFFSET, sct.isLspUpdateCapability());
+ flags.set(U_FLAG_OFFSET, sct.getLspUpdateCapability());
return flags;
}
}
if (bytes.readableBytes() != Ipv4Util.IP4_LENGTH * 2) {
throw new PCEPDeserializerException("Wrong length of array of bytes.");
}
- builder.setIgnore(header.isIgnore());
- builder.setProcessingRule(header.isProcessingRule());
+ builder.setIgnore(header.getIgnore());
+ builder.setProcessingRule(header.getProcessingRule());
final Ipv4Builder b = new Ipv4Builder();
b.setSourceIpv4Address(Ipv4Util.addressForByteBuf(bytes));
b.setDestinationIpv4Address(Ipv4Util.addressForByteBuf(bytes));
private final boolean isTriggeredReSyncEnable;
private final LspDbVersion localLspDbVersion;
private final LspDbVersion remoteLspDbVersion;
+
private Uint64 lspDBVersion = Uint64.ONE;
- private Boolean resynchronizing = Boolean.FALSE;
+ private boolean resynchronizing = false;
PCCSyncOptimization(final @NonNull PCCSession session) {
requireNonNull(session);
private static boolean isSyncAvoidance(final Tlvs openTlvs) {
final Stateful1 stateful1 = getStateful1(openTlvs);
- if (stateful1 != null && stateful1.isIncludeDbVersion() != null) {
- return stateful1.isIncludeDbVersion();
- }
- return false;
+ return stateful1 != null && Boolean.TRUE.equals(stateful1.getIncludeDbVersion());
}
private static boolean isDeltaSync(final Tlvs openTlvs) {
final Stateful1 stateful1 = getStateful1(openTlvs);
- if (stateful1 != null && stateful1.isDeltaLspSyncCapability() != null) {
- return stateful1.isDeltaLspSyncCapability();
- }
- return false;
+ return stateful1 != null && Boolean.TRUE.equals(stateful1.getDeltaLspSyncCapability());
}
private static boolean isTriggeredInitialSync(final Tlvs openTlvs) {
final Stateful1 stateful1 = getStateful1(openTlvs);
- if (stateful1 != null && stateful1.isTriggeredInitialSync() != null) {
- return stateful1.isTriggeredInitialSync();
- }
- return false;
+ return stateful1 != null && Boolean.TRUE.equals(stateful1.getTriggeredInitialSync());
}
private static boolean isTriggeredReSync(final Tlvs openTlvs) {
final Stateful1 stateful1 = getStateful1(openTlvs);
- if (stateful1 != null && stateful1.isTriggeredResync() != null) {
- return stateful1.isTriggeredResync();
- }
- return false;
+ return stateful1 != null && Boolean.TRUE.equals(stateful1.getTriggeredResync());
}
public Optional<Uint64> incrementLspDBVersion() {
return !doesLspDbMatch() || this.resynchronizing;
}
- public void setResynchronizingState(final Boolean resync) {
+ void setResynchronizingState(final boolean resync) {
this.resynchronizing = resync;
}
}
}
} else if (isReSyncTriggered(lsp)) {
handledDbTriggeredResync(update, session);
- } else if (lsp.isDelegate() != null && lsp.isDelegate()) {
+ } else if (Boolean.TRUE.equals(lsp.getDelegate())) {
//regular LSP update
reportToAll(update, session);
} else {
@Override
public void onMessagePcInitiate(final Requests request, final PCCSession session) {
- if (request.getSrp().augmentation(Srp1.class) != null
- && request.getSrp().augmentation(Srp1.class).isRemove()) {
+ final Srp1 aug = request.getSrp().augmentation(Srp1.class);
+ if (aug != null && aug.getRemove()) {
//remove LSP
removeTunnel(request, session);
- } else if (request.getLsp().isDelegate() != null && request.getLsp().isDelegate()
- && request.getEndpointsObj() == null) {
+ } else if (Boolean.TRUE.equals(request.getLsp().getDelegate()) && request.getEndpointsObj() == null) {
//take LSP delegation
takeDelegation(request, session);
} else {
}
private boolean isReSyncTriggered(final Lsp lsp) {
- return this.syncOptimization.isTriggeredReSyncEnabled() && lsp.isSync();
+ return this.syncOptimization.isTriggeredReSyncEnabled() && lsp.getSync();
}
private boolean isInitialSyncTriggered(final Lsp lsp) {
- return lsp.getPlspId().getValue().toJava() == 0 && lsp.isSync()
+ return lsp.getPlspId().getValue().toJava() == 0 && lsp.getSync()
&& this.syncOptimization.isTriggeredInitSyncEnabled();
}
private void handledDbTriggeredResync(final Updates update, final PCCSession session) {
- this.syncOptimization.setResynchronizingState(Boolean.TRUE);
+ this.syncOptimization.setResynchronizingState(true);
final SrpIdNumber operationId = update.getSrp().getOperationId();
if (update.getLsp().getPlspId().getValue().toJava() == 0) {
reportAllKnownLsp(Optional.of(operationId), session);
reportLsp(update.getLsp().getPlspId(), operationId, session);
}
sendEndOfSynchronization(session, Optional.of(operationId));
- this.syncOptimization.setResynchronizingState(Boolean.FALSE);
+ this.syncOptimization.setResynchronizingState(false);
}
private void lspReport(final PCCSession session) {
assertEquals(IP1, ((Ipv4Case) output.getAddressFamily()).getIpv4().getSourceIpv4Address().getValue());
assertEquals(IP2, ((Ipv4Case) output.getAddressFamily()).getIpv4().getDestinationIpv4Address().getValue());
- assertFalse(output.isIgnore());
- assertFalse(output.isProcessingRule());
+ assertFalse(output.getIgnore());
+ assertFalse(output.getProcessingRule());
}
@Test(expected = IllegalArgumentException.class)
checkSession(session, DEAD_TIMER, KEEP_ALIVE);
assertTrue(session.getRemoteTlvs().augmentation(Tlvs1.class).getStateful()
- .augmentation(Stateful1.class).isInitiation());
+ .augmentation(Stateful1.class).getInitiation());
assertNull(session.getLocalTlvs().augmentation(Tlvs3.class)
.getLspDbVersion().getLspDbVersionValue());
}
checkSession(session, DEAD_TIMER, KEEP_ALIVE);
assertTrue(session.getRemoteTlvs().augmentation(Tlvs1.class).getStateful()
- .augmentation(Stateful1.class).isInitiation());
+ .augmentation(Stateful1.class).getInitiation());
final Uint64 pceDBVersion = session.getLocalTlvs().augmentation(Tlvs3.class)
.getLspDbVersion().getLspDbVersionValue();
assertEquals(startingDBVersion, pceDBVersion);
assertEquals(expectedKeepAlive, session.getPeerPref().getKeepalive().shortValue());
final Stateful1 stateful = session.getRemoteTlvs().augmentation(Tlvs1.class)
.getStateful().augmentation(Stateful1.class);
- assertTrue(stateful.isInitiation());
+ assertTrue(stateful.getInitiation());
}
protected static void checkSequequenceDBVersionSync(final TestingSessionListener pceSessionListener,
for (final Reports report : pcrt) {
final Lsp lsp = report.getLsp();
if (lsp.getPlspId().getValue().toJava() == 0) {
- assertEquals(false, lsp.isSync());
+ assertEquals(false, lsp.getSync());
} else {
- assertEquals(true, lsp.isSync());
+ assertEquals(true, lsp.getSync());
}
final Uint64 actuaLspDBVersion = lsp.getTlvs()
.augmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep
/* Flags set according to RFC8664#section 4.3.1 */
final BitArray bits = new BitArray(BITSET_LENGTH);
- bits.set(M_FLAG_POSITION, srSubobject.isMFlag());
+ bits.set(M_FLAG_POSITION, srSubobject.getMFlag());
/* C flag MUST be set to 0 if M flag is set to 0 */
- if (!srSubobject.isMFlag()) {
+ if (!srSubobject.getMFlag()) {
bits.set(C_FLAG_POSITION, Boolean.FALSE);
} else {
- bits.set(C_FLAG_POSITION, srSubobject.isCFlag());
+ bits.set(C_FLAG_POSITION, srSubobject.getCFlag());
}
/* M & C flags MUST be set to 0 if S flag is set to 1 */
if (srSubobject.getSid() == null) {
bits.set(S_FLAG_POSITION, Boolean.TRUE);
}
/* F flag MUST be set if NT=0 or NAI is absent */
- if ((srSubobject.getNai() == null) || (srSubobject.getNaiType().getIntValue() == 0)) {
+ if (srSubobject.getNai() == null || srSubobject.getNaiType().getIntValue() == 0) {
bits.set(F_FLAG_POSITION, Boolean.TRUE);
}
/* Write Flags */
/* Write SID */
if (srSubobject.getSid() != null) {
- if (srSubobject.isMFlag()) {
+ if (srSubobject.getMFlag()) {
buffer.writeInt(srSubobject.getSid().intValue() << MPLS_LABEL_OFFSET);
} else {
ByteBufUtils.writeOrZero(buffer, srSubobject.getSid());
final SrSubobject srSubobject = (SrSubobject) subobject.getSubobjectType();
final ByteBuf body = serializeSubobject(srSubobject);
- EROSubobjectUtil.formatSubobject(this.type, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(this.type, subobject.getLoose(), body, buffer);
}
@Override
/* Flags */
final SrPceCapability srPceCapability = (SrPceCapability) tlv;
final BitArray bits = new BitArray(BITSET_LENGTH);
- bits.set(N_FLAG_POSITION, srPceCapability.isNFlag());
- bits.set(X_FLAG_POSITION, srPceCapability.isXFlag());
+ bits.set(N_FLAG_POSITION, srPceCapability.getNFlag());
+ bits.set(X_FLAG_POSITION, srPceCapability.getXFlag());
bits.toByteBuf(body);
/* MSD */
final ByteBuf body = Unpooled.buffer();
ByteBufUtils.write(body, pathKey.getValue());
body.writeBytes(pceID);
- EROSubobjectUtil.formatSubobject(pceID.length == PCE_ID_F_LENGTH ? TYPE_32 : TYPE_128, subobject.isLoose(),
+ EROSubobjectUtil.formatSubobject(pceID.length == PCE_ID_F_LENGTH ? TYPE_32 : TYPE_128, subobject.getLoose(),
body, buffer);
}
}
final ObjectParser parser = this.handlers.getParser(createKey(objectClass, objectType));
if (parser == null) {
- if (!header.isProcessingRule()) {
+ if (!header.getProcessingRule()) {
return null;
}
for (int type = 1; type <= MAX_OBJECT_TYPE; type++) {
throws PCEPDeserializerException {
final ObjectParser parser = this.handlers.getParser(enterpriseNumber.getValue().intValue());
if (parser == null) {
- if (!header.isProcessingRule()) {
+ if (!header.getProcessingRule()) {
return Optional.empty();
}
return Optional.of(new UnknownObject(PCEPErrors.UNRECOGNIZED_OBJ_CLASS));
public void testObjectHeader() {
ObjectHeaderImpl header = new ObjectHeaderImpl(null, true);
assertEquals("ObjectHeader [objClass=, processed=null, ignored=true]", header.toString());
- assertTrue(header.isIgnore());
- assertNull(header.isProcessingRule());
+ assertTrue(header.getIgnore());
+ assertNull(header.getProcessingRule());
assertEquals(new ObjectHeaderImpl(null, true).hashCode(), header.hashCode());
assertEquals(new ObjectHeaderImpl(null, true), header);
@Test
public void testUnknownObject() {
UnknownObject un = new UnknownObject(PCEPErrors.CT_AND_SETUP_PRIORITY_DO_NOT_FORM_TE_CLASS);
- assertFalse(un.isIgnore());
- assertFalse(un.isProcessingRule());
+ assertFalse(un.getIgnore());
+ assertFalse(un.getProcessingRule());
assertEquals(PCEPErrors.CT_AND_SETUP_PRIORITY_DO_NOT_FORM_TE_CLASS, un.getError());
assertEquals(PCEPErrors.CT_AND_SETUP_PRIORITY_DO_NOT_FORM_TE_CLASS.getErrorType(),
un.getErrors().get(0).getErrorObject().getType());
table.addRow().addContent("Topology Id", topologyId);
table.addRow().addContent("Node Id", nodeId);
table.addRow().addContent("Session duration", pcepSessionState.getSessionDuration());
- table.addRow().addContent("Synchronized", pcepSessionState.isSynchronized());
+ table.addRow().addContent("Synchronized", pcepSessionState.getSynchronized());
table.addRow().addContent("Delegated Lsp Count", pcepSessionState.getDelegatedLspsCount());
}
final StatefulCapabilitiesStatsAug stateFulCapa = capa.augmentation(StatefulCapabilitiesStatsAug.class);
if (stateFulCapa != null) {
addHeader(table, "Stateful Capabilities");
- table.addRow().addContent("Stateful", stateFulCapa.isStateful());
- table.addRow().addContent("Active", stateFulCapa.isActive());
- table.addRow().addContent("Instantiation", stateFulCapa.isInstantiation());
+ table.addRow().addContent("Stateful", stateFulCapa.getStateful());
+ table.addRow().addContent("Active", stateFulCapa.getActive());
+ table.addRow().addContent("Instantiation", stateFulCapa.getInstantiation());
}
}
import static java.util.Objects.requireNonNull;
import com.google.common.collect.Iterables;
+import com.google.common.collect.Maps;
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.ReportedLspBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.ReportedLspKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.reported.lsp.Path;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.reported.lsp.PathKey;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
final ReportedLsp previous = this.lspData.get(name);
// if no previous report about the lsp exist, just proceed
if (previous != null) {
- final List<Path> updatedPaths = makeBeforeBreak(rlb, previous, name, remove);
+ final Map<PathKey, Path> updatedPaths = makeBeforeBreak(rlb, previous, name, remove);
// if all paths or the last path were deleted, delete whole tunnel
if (updatedPaths.isEmpty()) {
LOG.debug("All paths were removed, removing LSP with {}.", id);
this.lspData.put(name, rl);
}
- private static List<Path> makeBeforeBreak(final ReportedLspBuilder rlb, final ReportedLsp previous,
+ private static Map<PathKey, Path> makeBeforeBreak(final ReportedLspBuilder rlb, final ReportedLsp previous,
final String name, final boolean remove) {
// just one path should be reported
final Path path = Iterables.getOnlyElement(rlb.getPath().values());
}
}
LOG.debug("Setting new paths {} to lsp {}", updatedPaths, name);
- return updatedPaths;
+ return Maps.uniqueIndex(updatedPaths, Path::key);
}
/**
.map(pathList -> pathList.values().iterator().next())
.map(path -> path.augmentation(Path1.class)).filter(Objects::nonNull)
.map(LspObject::getLsp).filter(Objects::nonNull)
- .filter(Lsp::isDelegate)
+ .filter(Lsp::getDelegate)
.count());
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.reported.lsp.Path;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.Uint32;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
final PlspId plspid = lsp.getPlspId();
final Srp srp = report.getSrp();
- if (!lsp.isSync() && (plspid == null || plspid.getValue().toJava() == 0)) {
+ if (!lsp.getSync() && (plspid == null || plspid.getValue().toJava() == 0)) {
purgeStaleLsps(ctx);
if (isTriggeredSyncInProcess()) {
if (srp == null) {
solicited = isSolicited(srp, lsp, ctx, rlb);
// if remove flag is set in SRP object, remove the tunnel immediately
- if (solicited && srp.augmentation(Srp1.class) != null) {
+ if (solicited) {
final Srp1 initiatedSrp = srp.augmentation(Srp1.class);
- if (initiatedSrp.isRemove()) {
+ if (initiatedSrp != null && initiatedSrp.getRemove()) {
super.removeLsp(ctx, plspid);
return false;
}
}
- rlb.setPath(Collections.singletonList(buildPath(report, srp, lsp)));
+ rlb.setPath(BindingMap.of(buildPath(report, srp, lsp)));
String name = lookupLspName(plspid);
if (lsp.getTlvs() != null && lsp.getTlvs().getSymbolicPathName() != null) {
updatePccNode(ctx, new PathComputationClientBuilder()
.addAugmentation(new PathComputationClient1Builder().setLspDbVersion(lspDbVersion).build()).build());
}
- updateLsp(ctx, plspid, name, rlb, solicited, lsp.isRemove());
+ updateLsp(ctx, plspid, name, rlb, solicited, lsp.getRemove());
unmarkStaleLsp(plspid);
LOG.debug("LSP {} updated", lsp);
}
rb.setSrp(srpBuilder.build());
rb.setLsp(new LspBuilder().setRemove(Boolean.FALSE).setPlspId(reportedLsp.getPlspId())
- .setDelegate(reportedLsp.isDelegate()).build());
+ .setDelegate(reportedLsp.getDelegate()).build());
return rb.build();
}
private ListenableFuture<OperationResult> redelegate(final Lsp reportedLsp, final Srp srp, final Lsp lsp,
final UpdateLspArgs input) {
// the D bit that was reported decides the type of PCE message sent
- requireNonNull(reportedLsp.isDelegate());
+ final boolean isDelegate = requireNonNull(reportedLsp.getDelegate());
final Message msg;
- if (reportedLsp.isDelegate()) {
+ if (isDelegate) {
// we already have delegation, send update
final UpdatesBuilder rb = new UpdatesBuilder();
rb.setSrp(srp);
} else {
final Lsp1 lspCreateFlag = reportedLsp.augmentation(Lsp1.class);
// we only retake delegation for PCE initiated tunnels
- if (lspCreateFlag != null && !lspCreateFlag.isCreate()) {
+ if (lspCreateFlag != null && !lspCreateFlag.getCreate()) {
LOG.warn("Unable to retake delegation of PCC-initiated tunnel: {}", reportedLsp);
return OperationResults.createUnsent(PCEPErrors.UPDATE_REQ_FOR_NON_LSP).future();
}
private synchronized void setStatefulCapabilities(final Stateful stateful) {
this.statefulCapability.set(true);
- if (stateful.isLspUpdateCapability() != null) {
- this.lspUpdateCapability.set(stateful.isLspUpdateCapability());
+ if (stateful.getLspUpdateCapability() != null) {
+ this.lspUpdateCapability.set(stateful.getLspUpdateCapability());
}
final Stateful1 stateful1 = stateful.augmentation(Stateful1.class);
- if (stateful1 != null && stateful1.isInitiation() != null) {
- this.initiationCapability.set(stateful1.isInitiation());
+ if (stateful1 != null && stateful1.getInitiation() != null) {
+ this.initiationCapability.set(stateful1.getInitiation());
}
}
rb.setSrp(srpBuilder.build());
rb.setLsp(new LspBuilder()
- .setAdministrative(inputLsp.isAdministrative())
- .setDelegate(inputLsp.isDelegate())
+ .setAdministrative(inputLsp.getAdministrative())
+ .setDelegate(inputLsp.getDelegate())
.setPlspId(PLSPID_ZERO)
.setTlvs(tlvsBuilder.build())
.build());
final Lsp inputLsp = args != null ? args.getLsp() : null;
final LspBuilder lspBuilder = new LspBuilder().setPlspId(reportedLsp.getPlspId());
if (inputLsp != null) {
- lspBuilder.setDelegate(inputLsp.isDelegate() != null && inputLsp.isDelegate())
+ lspBuilder.setDelegate(Boolean.TRUE.equals(inputLsp.getDelegate()))
.setTlvs(inputLsp.getTlvs())
- .setAdministrative(inputLsp.isAdministrative() != null && inputLsp.isAdministrative());
+ .setAdministrative(Boolean.TRUE.equals(inputLsp.getAdministrative()));
}
return redelegate(reportedLsp, srp, lspBuilder.build(), this.input);
}
import com.google.common.util.concurrent.MoreExecutors;
import java.net.InetAddress;
import java.net.InetSocketAddress;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutionException;
final TopologyKey key = InstanceIdentifier.keyOf(this.topology);
final TopologyId topologyId = key.getTopologyId();
final WriteTransaction tx = this.dependenciesProvider.getDataBroker().newWriteOnlyTransaction();
- tx.mergeParentStructurePut(LogicalDatastoreType.OPERATIONAL, this.topology, new TopologyBuilder().withKey(key)
- .setTopologyId(topologyId).setTopologyTypes(new TopologyTypesBuilder()
- .addAugmentation(new TopologyTypes1Builder().setTopologyPcep(new TopologyPcepBuilder().build())
- .build()).build())
- .setNode(new ArrayList<>()).build());
+ tx.mergeParentStructurePut(LogicalDatastoreType.OPERATIONAL, this.topology, new TopologyBuilder()
+ .withKey(key)
+ .setTopologyId(topologyId).setTopologyTypes(new TopologyTypesBuilder()
+ .addAugmentation(new TopologyTypes1Builder()
+ .setTopologyPcep(new TopologyPcepBuilder().build())
+ .build())
+ .build())
+ .build());
try {
tx.commit().get();
LOG.info("PCEP Topology {} created successfully.", topologyId.getValue());
private static boolean isSyncAvoidance(final Tlvs openTlvs) {
final Stateful1 stateful1 = getStateful1(openTlvs);
- if (stateful1 != null && stateful1.isIncludeDbVersion() != null) {
- return stateful1.isIncludeDbVersion();
- }
- return false;
+ return stateful1 != null && Boolean.TRUE.equals(stateful1.getIncludeDbVersion());
}
private static boolean isDeltaSync(final Tlvs openTlvs) {
final Stateful1 stateful1 = getStateful1(openTlvs);
- if (stateful1 != null && stateful1.isDeltaLspSyncCapability() != null) {
- return stateful1.isDeltaLspSyncCapability();
- }
- return false;
+ return stateful1 != null && Boolean.TRUE.equals(stateful1.getDeltaLspSyncCapability());
}
private static boolean isTriggeredInitialSync(final Tlvs openTlvs) {
final Stateful1 stateful1 = getStateful1(openTlvs);
- if (stateful1 != null && stateful1.isTriggeredInitialSync() != null) {
- return stateful1.isTriggeredInitialSync();
- }
- return false;
+ return stateful1 != null && Boolean.TRUE.equals(stateful1.getTriggeredInitialSync());
}
private static boolean isTriggeredReSync(final Tlvs openTlvs) {
final Stateful1 stateful1 = getStateful1(openTlvs);
- if (stateful1 != null && stateful1.isTriggeredResync() != null) {
- return stateful1.isTriggeredResync();
- }
- return false;
+ return stateful1 != null && Boolean.TRUE.equals(stateful1.getTriggeredResync());
}
}
assertTrue(replyTime.getMaxTime().toJava() > 0);
final StatefulCapabilitiesStatsAug statefulCapabilities = listenerState
.getPeerCapabilities().augmentation(StatefulCapabilitiesStatsAug.class);
- assertFalse(statefulCapabilities.isActive());
- assertTrue(statefulCapabilities.isInstantiation());
- assertTrue(statefulCapabilities.isStateful());
+ assertFalse(statefulCapabilities.getActive());
+ assertTrue(statefulCapabilities.getInstantiation());
+ assertTrue(statefulCapabilities.getStateful());
return pcc;
});
sb.setPeerCapabilities(new PeerCapabilitiesBuilder(topoPeerCapability)
.removeAugmentation(StatefulCapabilitiesStatsAug.class)
.addAugmentation(new StatefulCapabilitiesRpcAugBuilder()
- .setActive(capabilityStatsAug.isActive())
- .setInstantiation(capabilityStatsAug.isInstantiation())
- .setStateful(capabilityStatsAug.isStateful())
+ .setActive(capabilityStatsAug.getActive())
+ .setInstantiation(capabilityStatsAug.getInstantiation())
+ .setStateful(capabilityStatsAug.getStateful())
.build())
.build());
}
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.stream.Collectors;
import org.junit.After;
import org.junit.Before;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.Uint16;
import org.opendaylight.yangtools.yang.common.Uint32;
rpcService.init();
// PCEP topology with one PCC node
- final Topology t1 = createTopology(TOPOLOGY_ID1, Collections.singletonList(createPcepNode(NODE_ID1)));
+ final Topology t1 = createTopology(TOPOLOGY_ID1, BindingMap.of(createPcepNode(NODE_ID1)));
// PCEP topology with two PCC node
final Topology t2 =
- createTopology(TOPOLOGY_ID2, Arrays.asList(createPcepNode(NODE_ID2), createPcepNode(NODE_ID3)));
+ createTopology(TOPOLOGY_ID2, BindingMap.of(createPcepNode(NODE_ID2), createPcepNode(NODE_ID3)));
// Non-PCEP topology with one non-PCC node
final Topology t3 = createTopology(NONPCEP_TOPOLOGY,
- Collections.singletonList(new NodeBuilder().setNodeId(new NodeId(NONPCEP_NODE)).build()));
+ BindingMap.of(new NodeBuilder().setNodeId(new NodeId(NONPCEP_NODE)).build()));
final WriteTransaction wtx = getDataBroker().newWriteOnlyTransaction();
final NetworkTopologyBuilder ntb = new NetworkTopologyBuilder();
- ntb.setTopology(Arrays.asList(t1, t2, t3));
+ ntb.setTopology(BindingMap.of(t1, t2, t3));
wtx.put(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.builder(NetworkTopology.class).build(),
ntb.build());
wtx.commit().get();
}
- private static Topology createTopology(final String topologyId, final List<Node> nodes) {
+ private static Topology createTopology(final String topologyId, final Map<NodeKey, Node> nodes) {
return new TopologyBuilder().setTopologyId(new TopologyId(topologyId)).setNode(nodes).build();
}
.getTopology().values() .iterator().next();
final var ot2 = createGetStatsOutput(TOPOLOGY_ID2, Arrays.asList(NODE_ID2, NODE_ID3), createRpcSessionState())
.getTopology().values().iterator().next();
- final GetStatsOutput out = new GetStatsOutputBuilder().setTopology(Arrays.asList(ot1, ot2)).build();
+ final GetStatsOutput out = new GetStatsOutputBuilder().setTopology(BindingMap.of(ot1, ot2)).build();
// Implicitly match all PCEP topologies and nodes
in = createGetStatsInput(null, null);
.iterator().next();
final var it2 = createGetStatsInput(TOPOLOGY_ID2, Arrays.asList(NODE_ID2, NODE_ID3)).getTopology().values()
.iterator().next();
- in = new GetStatsInputBuilder().setTopology(Arrays.asList(it1, it2)).build();
+ in = new GetStatsInputBuilder().setTopology(BindingMap.of(it1, it2)).build();
performCountTest(in, out);
}
} else {
topology = null;
}
- return new GetStatsInputBuilder().setTopology(topology != null ? Collections.singletonList(topology) : null)
- .build();
+ return new GetStatsInputBuilder().setTopology(topology != null ? BindingMap.of(topology) : null).build();
}
private static GetStatsOutput createGetStatsOutput(final String topologyId, final List<String> nodeIds,
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
final NodeKey nk = new NodeKey(new NodeId(url));
final NodeBuilder nb = new NodeBuilder();
nb.withKey(nk).setNodeId(nk.getNodeId());
- nb.setTerminationPoint(Lists.newArrayList(tpb.build()));
+ nb.setTerminationPoint(BindingMap.of(tpb.build()));
if (sni != null) {
- nb.setSupportingNode(Lists.newArrayList(createSupportingNode(InstanceIdentifier.keyOf(sni).getNodeId(),
+ nb.setSupportingNode(BindingMap.of(createSupportingNode(InstanceIdentifier.keyOf(sni).getNodeId(),
inControl)));
}
final InstanceIdentifier<Node> nid = this.target.child(Node.class, nb.key());
final InstanceIdentifier<TerminationPoint> dst = getIpTerminationPoint(trans, dstIp, null, Boolean.FALSE);
final InstanceIdentifier<TerminationPoint> src = getIpTerminationPoint(trans, srcIp, ni,
- rl.getLsp().isDelegate());
+ rl.getLsp().getDelegate());
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720
.Link1Builder slab = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf
.stateful.rev200720.Link1Builder();
slab.setOperationalStatus(rl.getLsp().getOperational());
- slab.setAdministrativeStatus(rl.getLsp().isAdministrative() ? AdministrativeStatus.Active :
+ slab.setAdministrativeStatus(rl.getLsp().getAdministrative() ? AdministrativeStatus.Active :
AdministrativeStatus.Inactive);
final LinkId id = linkIdForLsp(identifier, value);
*/
package org.opendaylight.bgpcep.pcep.tunnel.provider;
-import java.util.ArrayList;
import java.util.concurrent.ExecutionException;
import org.checkerframework.checker.lock.qual.GuardedBy;
import org.opendaylight.bgpcep.topology.DefaultTopologyReference;
.addAugmentation(new TopologyTypes1Builder()
.setTopologyTunnelPcep(
new TopologyTunnelPcepBuilder().build()).build()).build())
- .setNode(new ArrayList<>()).build());
+ .build());
try {
tx.commit().get();
} catch (final InterruptedException | ExecutionException e) {
if (h1 != null) {
final SubobjectBuilder sb = new SubobjectBuilder();
sb.fieldsFrom(h1);
- sb.setLoose(h.isLoose());
+ sb.setLoose(h.getLoose());
subobjs.add(sb.build());
} else {
LOG.debug("Ignoring unhandled explicit hop {}", h);
public static NodeId supportingNode(final Node node) {
for (final SupportingNode n : node.nonnullSupportingNode().values()) {
final SupportingNode1 n1 = n.augmentation(SupportingNode1.class);
- if (n1 != null && n1.getPathComputationClient().isControlling()) {
+ if (n1 != null && n1.getPathComputationClient().getControlling()) {
return n.key().getNodeRef();
}
}
import static org.opendaylight.protocol.util.CheckTestUtil.readDataOperational;
import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import java.util.Collections;
import java.util.Iterator;
import java.util.concurrent.ExecutionException;
import org.junit.After;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.Uint32;
public class NodeChangedListenerTest extends AbstractConcurrentDataBrokerTest {
public void setUp() throws InterruptedException, ExecutionException {
final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
wTx.mergeParentStructurePut(LogicalDatastoreType.OPERATIONAL, PCEP_TOPO_IID, new TopologyBuilder()
- .withKey(new TopologyKey(PCEP_TOPOLOGY_ID)).setNode(Collections.emptyList())
+ .withKey(new TopologyKey(PCEP_TOPOLOGY_ID))
.setTopologyId(PCEP_TOPOLOGY_ID).build());
wTx.mergeParentStructurePut(LogicalDatastoreType.OPERATIONAL, TUNNEL_TOPO_IID, new TopologyBuilder()
.withKey(new TopologyKey(TUNNEL_TOPOLOGY_ID)).setTopologyId(TUNNEL_TOPOLOGY_ID).build());
dst = tmp;
}
- Assert.assertEquals(srcId, src.getNodeId());
- Assert.assertEquals(dstId, dst.getNodeId());
+ assertEquals(srcId, src.getNodeId());
+ assertEquals(dstId, dst.getNodeId());
- Assert.assertEquals(1, dst.getTerminationPoint().size());
- Assert.assertEquals(1, src.getTerminationPoint().size());
+ assertEquals(1, dst.getTerminationPoint().size());
+ assertEquals(1, src.getTerminationPoint().size());
final TerminationPoint dstTp = dst.nonnullTerminationPoint().values().iterator().next();
final TerminationPoint srcTp = src.nonnullTerminationPoint().values().iterator().next();
final TpId dstNodeTpId = new TpId(dstId.getValue());
final TpId srcNodeTpId = new TpId(srcId.getValue());
- Assert.assertEquals(dstNodeTpId, dstTp.getTpId());
- Assert.assertEquals(srcNodeTpId, srcTp.getTpId());
+ assertEquals(dstNodeTpId, dstTp.getTpId());
+ assertEquals(srcNodeTpId, srcTp.getTpId());
- Assert.assertEquals(1, src.getSupportingNode().size());
- Assert.assertNull(dst.getSupportingNode());
+ assertEquals(1, src.getSupportingNode().size());
+ assertNull(dst.getSupportingNode());
final SupportingNode sNode = src.nonnullSupportingNode().values().iterator().next();
- Assert.assertEquals(NODE1_ID, sNode.key().getNodeRef());
+ assertEquals(NODE1_ID, sNode.key().getNodeRef());
- Assert.assertEquals(1, tunnelTopo.nonnullLink().size());
+ assertEquals(1, tunnelTopo.nonnullLink().size());
final Link link = tunnelTopo.nonnullLink().values().iterator().next();
- Assert.assertEquals(srcId, link.getSource().getSourceNode());
- Assert.assertEquals(srcNodeTpId, link.getSource().getSourceTp());
- Assert.assertEquals(dstId, link.getDestination().getDestNode());
- Assert.assertEquals(dstNodeTpId, link.getDestination().getDestTp());
+ assertEquals(srcId, link.getSource().getSourceNode());
+ assertEquals(srcNodeTpId, link.getSource().getSourceTp());
+ assertEquals(dstId, link.getDestination().getDestNode());
+ assertEquals(dstNodeTpId, link.getDestination().getDestTp());
// update second node -> adds supporting node and second link
createNode(NODE2_ID, NODE2_IPV4, LSP2_NAME, LSP2_ID, NODE1_IPV4);
readDataOperational(getDataBroker(), TUNNEL_TOPO_IID, updatedNodeTopo -> {
assertNotNull(updatedNodeTopo.getNode());
- Assert.assertEquals(2, updatedNodeTopo.getNode().size());
+ assertEquals(2, updatedNodeTopo.getNode().size());
final Node updatedNode;
if (updatedNodeTopo.nonnullNode().values().iterator().next().getNodeId().equals(srcId)) {
updatedNode = Iterables.get(updatedNodeTopo.nonnullNode().values(), 1);
}
assertNotNull(updatedNode.getSupportingNode());
- Assert.assertEquals(1, updatedNode.nonnullSupportingNode().size());
+ assertEquals(1, updatedNode.nonnullSupportingNode().size());
final SupportingNode sNode2 = updatedNode.nonnullSupportingNode().values().iterator().next();
- Assert.assertEquals(NODE2_ID, sNode2.getNodeRef());
- Assert.assertEquals(2, updatedNodeTopo.getLink().size());
+ assertEquals(NODE2_ID, sNode2.getNodeRef());
+ assertEquals(2, updatedNodeTopo.getLink().size());
return updatedNodeTopo;
});
.build()).build()).build()).build()).setAdministrative(true)
.setDelegate(true).build()).build());
final ReportedLsp reportedLps = new ReportedLspBuilder().withKey(new ReportedLspKey(lspName)).setPath(
- Collections.singletonList(pathBuilder.build())).build();
+ BindingMap.of(pathBuilder.build())).build();
final Node1Builder node1Builder = new Node1Builder();
node1Builder.setPathComputationClient(new PathComputationClientBuilder()
.setStateSync(PccSyncState.Synchronized)
- .setReportedLsp(Lists.newArrayList(reportedLps))
+ .setReportedLsp(BindingMap.of(reportedLps))
.setIpAddress(new IpAddressNoZone(new Ipv4AddressNoZone(ipv4Address)))
.build());
nodeBuilder.addAugmentation(node1Builder.build());
*/
package org.opendaylight.bgpcep.pcep.tunnel.provider;
-import com.google.common.collect.Lists;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+
import com.google.common.util.concurrent.ListenableFuture;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
+import org.mockito.junit.MockitoJUnitRunner;
import org.opendaylight.bgpcep.programming.spi.Instruction;
import org.opendaylight.bgpcep.programming.spi.InstructionScheduler;
import org.opendaylight.bgpcep.programming.spi.SchedulerException;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.LinkKey;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNodeKey;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.TerminationPoint1Builder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.igp.termination.point.attributes.IgpTerminationPointAttributesBuilder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.igp.termination.point.attributes.igp.termination.point.attributes.termination.point.type.IpBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.Uint32;
import org.opendaylight.yangtools.yang.common.Uint8;
import org.osgi.framework.BundleContext;
+@RunWith(MockitoJUnitRunner.StrictStubs.class)
public class TunnelProgrammingTest extends AbstractConcurrentDataBrokerTest {
private static final TopologyId TOPOLOGY_ID = new TopologyId("tunnel-topo");
private ListenableFuture<RpcResult<RemoveLspOutput>> futureRemoveLspOutput;
private static Node createNode(final NodeId nodeId, final TpId tpId, final String ipv4Address) {
- final TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
- tpBuilder.setTpId(tpId);
- tpBuilder.withKey(new TerminationPointKey(tpId));
- tpBuilder.addAugmentation(new TerminationPoint1Builder()
- .setIgpTerminationPointAttributes(new IgpTerminationPointAttributesBuilder()
+ return new NodeBuilder()
+ .setNodeId(nodeId)
+ .setTerminationPoint(BindingMap.of(new TerminationPointBuilder()
+ .setTpId(tpId)
+ .addAugmentation(new TerminationPoint1Builder()
+ .setIgpTerminationPointAttributes(new IgpTerminationPointAttributesBuilder()
.setTerminationPointType(new IpBuilder()
- .setIpAddress(Collections.singletonList(new IpAddress(new Ipv4Address(ipv4Address))))
- .build()).build()).build());
- final NodeBuilder nodeBuilder = new NodeBuilder();
- nodeBuilder.setNodeId(nodeId);
- nodeBuilder.withKey(new NodeKey(nodeId));
- nodeBuilder.setTerminationPoint(Lists.newArrayList(tpBuilder.build()));
- final SupportingNode supportingNode = new SupportingNodeBuilder()
- .withKey(new SupportingNodeKey(nodeId, new TopologyId("dummy")))
+ .setIpAddress(Collections.singletonList(new IpAddress(new Ipv4Address(ipv4Address))))
+ .build())
+ .build())
+ .build())
+ .build()))
+ .setSupportingNode(BindingMap.of(new SupportingNodeBuilder()
+ .setTopologyRef(new TopologyId("dummy"))
+ .setNodeRef(nodeId)
.addAugmentation(new SupportingNode1Builder()
- .setPathComputationClient(new PathComputationClientBuilder()
- .setControlling(true).build()).build()).build();
- nodeBuilder.setSupportingNode(Lists.newArrayList(supportingNode));
- return nodeBuilder.build();
+ .setPathComputationClient(new PathComputationClientBuilder().setControlling(true).build())
+ .build())
+ .build()))
+ .build();
}
- private static ExplicitHops createExplicitHop(final String ipv4Prefix, Uint32 order) {
+ private static ExplicitHops createExplicitHop(final String ipv4Prefix, final Uint32 order) {
return new ExplicitHopsBuilder()
.setOrder(order)
.addAugmentation(new ExplicitHops1Builder()
@Before
public void setUp() throws SchedulerException, InterruptedException, ExecutionException {
- MockitoAnnotations.initMocks(this);
- Mockito.doReturn(true).when(this.instruction).checkedExecutionStart();
- Mockito.doNothing().when(this.instruction).executionCompleted(InstructionStatus.Failed, null);
- Mockito.doAnswer(invocation -> {
- final Runnable callback = invocation.getArgument(0);
- callback.run();
+ doReturn(true).when(instruction).checkedExecutionStart();
+ doNothing().when(instruction).executionCompleted(InstructionStatus.Failed, null);
+ doAnswer(invocation -> {
+ invocation.getArgument(0, Runnable.class).run();
return null;
- }).when(this.instructionFuture).addListener(Mockito.any(Runnable.class), Mockito.any(Executor.class));
- Mockito.doReturn(false).when(this.futureAddLspOutput).isCancelled();
- Mockito.doAnswer(invocation -> {
- final Runnable callback = invocation.getArgument(0);
- callback.run();
+ }).when(instructionFuture).addListener(ArgumentMatchers.any(Runnable.class), Mockito.any(Executor.class));
+ doReturn(false).when(futureAddLspOutput).isCancelled();
+ doAnswer(invocation -> {
+ invocation.getArgument(0, Runnable.class).run();
return null;
- }).when(this.futureAddLspOutput).addListener(Mockito.any(Runnable.class), Mockito.any(Executor.class));
- Mockito.doReturn(false).when(this.futureUpdateLspOutput).isCancelled();
- Mockito.doAnswer(invocation -> {
- final Runnable callback = invocation.getArgument(0);
- callback.run();
+ }).when(futureAddLspOutput).addListener(any(Runnable.class), any(Executor.class));
+ doReturn(false).when(futureUpdateLspOutput).isCancelled();
+ doAnswer(invocation -> {
+ invocation.getArgument(0, Runnable.class).run();
return null;
- }).when(this.futureUpdateLspOutput).addListener(Mockito.any(Runnable.class), Mockito.any(Executor.class));
- Mockito.doReturn(false).when(this.futureRemoveLspOutput).isCancelled();
- Mockito.doAnswer(invocation -> {
- final Runnable callback = invocation.getArgument(0);
- callback.run();
+ }).when(futureUpdateLspOutput).addListener(any(Runnable.class), any(Executor.class));
+ doReturn(false).when(futureRemoveLspOutput).isCancelled();
+ doAnswer(invocation -> {
+ invocation.getArgument(0, Runnable.class).run();
return null;
- }).when(this.futureRemoveLspOutput).addListener(Mockito.any(Runnable.class), Mockito.any(Executor.class));
- Mockito.doAnswer(invocation -> {
- TunnelProgrammingTest.this.addLspInput = invocation.getArgument(0);
- return TunnelProgrammingTest.this.futureAddLspOutput;
- }).when(this.topologyService).addLsp(Mockito.any(AddLspInput.class));
- Mockito.doAnswer(invocation -> {
- TunnelProgrammingTest.this.updateLspInput = invocation.getArgument(0);
- return TunnelProgrammingTest.this.futureUpdateLspOutput;
- }).when(this.topologyService).updateLsp(Mockito.any(UpdateLspInput.class));
- Mockito.doAnswer(invocation -> {
- TunnelProgrammingTest.this.removeLspInput = invocation.getArgument(0);
- return TunnelProgrammingTest.this.futureRemoveLspOutput;
- }).when(this.topologyService).removeLsp(Mockito.any(RemoveLspInput.class));
- Mockito.doReturn(this.instruction).when(this.instructionFuture).get();
- Mockito.doReturn(true).when(this.instructionFuture).isDone();
- Mockito.doReturn(this.instructionFuture).when(this.scheduler)
- .scheduleInstruction(Mockito.any(SubmitInstructionInput.class));
+ }).when(futureRemoveLspOutput).addListener(any(Runnable.class), any(Executor.class));
+ doAnswer(invocation -> {
+ addLspInput = invocation.getArgument(0);
+ return futureAddLspOutput;
+ }).when(topologyService).addLsp(any(AddLspInput.class));
+ doAnswer(invocation -> {
+ updateLspInput = invocation.getArgument(0);
+ return futureUpdateLspOutput;
+ }).when(topologyService).updateLsp(any(UpdateLspInput.class));
+ doAnswer(invocation -> {
+ removeLspInput = invocation.getArgument(0);
+ return futureRemoveLspOutput;
+ }).when(topologyService).removeLsp(any(RemoveLspInput.class));
+ doReturn(instruction).when(instructionFuture).get();
+ doReturn(true).when(instructionFuture).isDone();
+ doReturn(instructionFuture).when(scheduler)
+ .scheduleInstruction(any(SubmitInstructionInput.class));
- Mockito.doReturn(this.topologyService).when(this.rpcs)
+ doReturn(topologyService).when(rpcs)
.getRpcService(NetworkTopologyPcepService.class);
createInitialTopology();
- final TunnelProviderDependencies dependencies = new TunnelProviderDependencies(getDataBroker(), this.cssp,
- this.rpr, this.rpcs, this.bundleContext);
- this.tunnelProgramming = new TunnelProgramming(this.scheduler, dependencies);
+ tunnelProgramming = new TunnelProgramming(scheduler,
+ new TunnelProviderDependencies(getDataBroker(), cssp, rpr, rpcs, bundleContext));
}
@Test
final String tunnelName = "create-tunnel";
final NetworkTopologyRef topologyRef = new NetworkTopologyRef(TOPO_IID);
// create tunnel
- final PcepCreateP2pTunnelInputBuilder createInputBuilder = new PcepCreateP2pTunnelInputBuilder();
- createInputBuilder.setDestination(new DestinationBuilder().setNode(NODE2_ID).setTp(TP2_ID).build());
- createInputBuilder.setSource(new SourceBuilder().setNode(NODE1_ID).setTp(TP1_ID).build());
- createInputBuilder.setNetworkTopologyRef(topologyRef);
- createInputBuilder.setBandwidth(bwd);
- createInputBuilder.setClassType(classType);
- createInputBuilder.setSymbolicPathName(tunnelName);
- createInputBuilder.setExplicitHops(Collections.emptyList());
- createInputBuilder.addAugmentation(new PcepCreateP2pTunnelInput1Builder()
- .setAdministrativeStatus(AdministrativeStatus.Active).build());
- this.tunnelProgramming.pcepCreateP2pTunnel(createInputBuilder.build());
+ tunnelProgramming.pcepCreateP2pTunnel(new PcepCreateP2pTunnelInputBuilder()
+ .setDestination(new DestinationBuilder().setNode(NODE2_ID).setTp(TP2_ID).build())
+ .setSource(new SourceBuilder().setNode(NODE1_ID).setTp(TP1_ID).build())
+ .setNetworkTopologyRef(topologyRef)
+ .setBandwidth(bwd)
+ .setClassType(classType)
+ .setSymbolicPathName(tunnelName)
+ .addAugmentation(new PcepCreateP2pTunnelInput1Builder()
+ .setAdministrativeStatus(AdministrativeStatus.Active)
+ .build())
+ .build());
//check add-lsp input
- Assert.assertNotNull(this.addLspInput);
- Assert.assertEquals(tunnelName, this.addLspInput.getName());
- final Arguments agrs = this.addLspInput.getArguments();
- Assert.assertNotNull(agrs);
- Assert.assertEquals(bwd, agrs.getBandwidth().getBandwidth());
- Assert.assertEquals(classType, agrs.getClassType().getClassType());
+ assertNotNull(addLspInput);
+ assertEquals(tunnelName, addLspInput.getName());
+ final Arguments agrs = addLspInput.getArguments();
+ assertNotNull(agrs);
+ assertEquals(bwd, agrs.getBandwidth().getBandwidth());
+ assertEquals(classType, agrs.getClassType().getClassType());
final Ipv4 ipv4Endpoints = ((Ipv4Case) agrs.getEndpointsObj().getAddressFamily()).getIpv4();
- Assert.assertEquals(NODE1_IPV4, ipv4Endpoints.getSourceIpv4Address().getValue());
- Assert.assertEquals(NODE2_IPV4, ipv4Endpoints.getDestinationIpv4Address().getValue());
- Assert.assertEquals(NODE1_ID.getValue(), this.addLspInput.getNode().getValue());
+ assertEquals(NODE1_IPV4, ipv4Endpoints.getSourceIpv4Address().getValue());
+ assertEquals(NODE2_IPV4, ipv4Endpoints.getDestinationIpv4Address().getValue());
+ assertEquals(NODE1_ID.getValue(), addLspInput.getNode().getValue());
createLink();
// update tunnel
- final PcepUpdateTunnelInputBuilder updateInputBuilder = new PcepUpdateTunnelInputBuilder();
- updateInputBuilder.setNetworkTopologyRef(topologyRef);
- updateInputBuilder.setBandwidth(bwd);
- updateInputBuilder.setClassType(classType);
- updateInputBuilder.setExplicitHops(Lists.newArrayList(createExplicitHop(IPV4_PREFIX1, Uint32.ONE),
- createExplicitHop(IPV4_PREFIX2, Uint32.TWO)));
- updateInputBuilder.setLinkId(LINK1_ID);
- updateInputBuilder.addAugmentation(new PcepUpdateTunnelInput1Builder()
- .setAdministrativeStatus(AdministrativeStatus.Active).build());
- this.tunnelProgramming.pcepUpdateTunnel(updateInputBuilder.build());
+ tunnelProgramming.pcepUpdateTunnel(new PcepUpdateTunnelInputBuilder()
+ .setNetworkTopologyRef(topologyRef)
+ .setBandwidth(bwd)
+ .setClassType(classType)
+ // We assert on explicit order
+ .setExplicitHops(BindingMap.ordered(
+ createExplicitHop(IPV4_PREFIX1, Uint32.ONE),
+ createExplicitHop(IPV4_PREFIX2, Uint32.TWO)))
+ .setLinkId(LINK1_ID)
+ .addAugmentation(new PcepUpdateTunnelInput1Builder()
+ .setAdministrativeStatus(AdministrativeStatus.Active)
+ .build())
+ .build());
//check update-lsp input
- Assert.assertNotNull(this.updateLspInput);
- Assert.assertEquals(LINK1_ID.getValue(), this.updateLspInput.getName());
+ assertNotNull(updateLspInput);
+ assertEquals(LINK1_ID.getValue(), updateLspInput.getName());
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.update.lsp
- .args.Arguments updArgs = this.updateLspInput.getArguments();
- Assert.assertEquals(2, updArgs.getEro().getSubobject().size());
- final List<Subobject> subObjects = updArgs.getEro().getSubobject();
+ .args.Arguments updArgs = updateLspInput.getArguments();
+ assertEquals(2, updArgs.getEro().nonnullSubobject().size());
+ final List<Subobject> subObjects = updArgs.getEro().nonnullSubobject();
final IpPrefixCase prefix1 = (IpPrefixCase) subObjects.get(0).getSubobjectType();
final IpPrefixCase prefix2 = (IpPrefixCase) subObjects.get(1).getSubobjectType();
- Assert.assertEquals(IPV4_PREFIX1, prefix1.getIpPrefix().getIpPrefix().getIpv4Prefix().getValue());
- Assert.assertEquals(IPV4_PREFIX2, prefix2.getIpPrefix().getIpPrefix().getIpv4Prefix().getValue());
+ assertEquals(IPV4_PREFIX1, prefix1.getIpPrefix().getIpPrefix().getIpv4Prefix().getValue());
+ assertEquals(IPV4_PREFIX2, prefix2.getIpPrefix().getIpPrefix().getIpv4Prefix().getValue());
// delete tunnel
final PcepDestroyTunnelInputBuilder destroyInputBuilder = new PcepDestroyTunnelInputBuilder();
destroyInputBuilder.setLinkId(LINK1_ID);
destroyInputBuilder.setNetworkTopologyRef(topologyRef);
- this.tunnelProgramming.pcepDestroyTunnel(destroyInputBuilder.build());
- Assert.assertNotNull(this.removeLspInput);
- Assert.assertEquals(LINK1_ID.getValue(), this.removeLspInput.getName());
- Assert.assertEquals(NODE1_ID.getValue(), this.removeLspInput.getNode().getValue());
+ tunnelProgramming.pcepDestroyTunnel(destroyInputBuilder.build());
+ assertNotNull(removeLspInput);
+ assertEquals(LINK1_ID.getValue(), removeLspInput.getName());
+ assertEquals(NODE1_ID, removeLspInput.getNode());
}
private void createInitialTopology() throws InterruptedException, ExecutionException {
- final TopologyBuilder topologyBuilder = new TopologyBuilder();
- topologyBuilder.withKey(new TopologyKey(TOPOLOGY_ID));
- topologyBuilder.setServerProvided(true);
- topologyBuilder.setTopologyId(TOPOLOGY_ID);
- topologyBuilder.setNode(Lists.newArrayList(createNode(NODE1_ID, TP1_ID, NODE1_IPV4),
- createNode(NODE2_ID, TP2_ID, NODE2_IPV4)));
final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
- wTx.mergeParentStructurePut(LogicalDatastoreType.OPERATIONAL, TOPO_IID, topologyBuilder.build());
+ wTx.mergeParentStructurePut(LogicalDatastoreType.OPERATIONAL, TOPO_IID, new TopologyBuilder()
+ .setTopologyId(TOPOLOGY_ID)
+ .setServerProvided(true)
+ .setTopologyId(TOPOLOGY_ID)
+ .setNode(BindingMap.of(createNode(NODE1_ID, TP1_ID, NODE1_IPV4), createNode(NODE2_ID, TP2_ID, NODE2_IPV4)))
+ .build());
wTx.commit().get();
}
private void createLink() throws InterruptedException, ExecutionException {
- final LinkBuilder linkBuilder = new LinkBuilder();
- linkBuilder.setSource(new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology
- .rev131021.link.attributes.SourceBuilder().setSourceNode(NODE1_ID).setSourceTp(TP1_ID).build());
- linkBuilder.setDestination(new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology
- .rev131021.link.attributes.DestinationBuilder().setDestNode(NODE2_ID).setDestTp(TP2_ID).build());
- linkBuilder.setLinkId(LINK1_ID);
- linkBuilder.withKey(new LinkKey(LINK1_ID));
- linkBuilder.addAugmentation(new Link1Builder().setSymbolicPathName(LINK1_ID.getValue()).build());
final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
wTx.mergeParentStructurePut(LogicalDatastoreType.OPERATIONAL,
- TOPO_IID.builder().child(Link.class, new LinkKey(LINK1_ID)).build(), linkBuilder.build());
+ TOPO_IID.child(Link.class, new LinkKey(LINK1_ID)),
+ new LinkBuilder()
+ .setSource(new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021
+ .link.attributes.SourceBuilder().setSourceNode(NODE1_ID).setSourceTp(TP1_ID).build())
+ .setDestination(new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021
+ .link.attributes.DestinationBuilder().setDestNode(NODE2_ID).setDestTp(TP2_ID).build())
+ .setLinkId(LINK1_ID)
+ .addAugmentation(new Link1Builder().setSymbolicPathName(LINK1_ID.getValue()).build())
+ .build());
wTx.commit().get();
}
-
}
"Unknown subobject instance. Passed %s. Needed AsNumberCase.",
subobject.getSubobjectType().getClass());
final ByteBuf body = AsNumberCaseParser.serializeSubobject((AsNumberCase) subobject.getSubobjectType());
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
}
.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route
.subobjects.subobject.type.exrs._case.exrs.ExrsBuilder();
b.setAttribute(s.getAttribute());
- b.setMandatory(s.isMandatory());
+ b.setMandatory(s.getMandatory());
b.setSubobjectType(s.getSubobjectType());
exrss.add(b.build());
}
final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.exclude.route
.object.exclude.route.object.SubobjectContainer> list = new ArrayList<>();
for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route
- .subobjects.subobject.type.exrs._case.exrs.Exrs ex : e.getExrs()) {
+ .subobjects.subobject.type.exrs._case.exrs.Exrs ex : e.nonnullExrs()) {
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.exclude.route
.object.exclude.route.object.SubobjectContainerBuilder b = new org.opendaylight.yang.gen.v1.urn
.opendaylight.params.xml.ns.yang.rsvp.rev150820.exclude.route.object.exclude.route.object
.SubobjectContainerBuilder();
b.setAttribute(ex.getAttribute());
- b.setMandatory(ex.isMandatory());
+ b.setMandatory(ex.getMandatory());
b.setSubobjectType(ex.getSubobjectType());
list.add(b.build());
}
final ByteBuf body = Unpooled.buffer();
localSerializeSubobject(list, body);
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
private List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.exclude.route.object
final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.exclude.route
.object.exclude.route.object.SubobjectContainer> subs = new ArrayList<>();
while (buffer.isReadable()) {
- final boolean mandatory = (buffer.getByte(buffer.readerIndex()) & (1 << Values.FIRST_BIT_OFFSET)) != 0;
- final int type = (buffer.readUnsignedByte() & Values.BYTE_MAX_VALUE_BYTES) & ~(1 << Values
+ final boolean mandatory = (buffer.getByte(buffer.readerIndex()) & 1 << Values.FIRST_BIT_OFFSET) != 0;
+ final int type = buffer.readUnsignedByte() & Values.BYTE_MAX_VALUE_BYTES & ~(1 << Values
.FIRST_BIT_OFFSET);
final int length = buffer.readUnsignedByte() - HEADER_LENGTH;
if (length > buffer.readableBytes()) {
checkArgument(prefix.getIpv4Prefix() != null, "Ipv4Prefix is mandatory.");
Ipv4Util.writeIpv4Prefix(prefix.getIpv4Prefix(), body);
body.writeZero(RESERVED);
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
}
final ByteBuf body = Unpooled.buffer();
Ipv6Util.writeIpv6Prefix(ipv6prefix, body);
body.writeZero(RESERVED);
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
}
subobject.getSubobjectType().getClass());
final Label label = ((LabelCase) subobject.getSubobjectType()).getLabel();
final ByteBuf body = Unpooled.buffer();
- this.registry.serializeLabel(label.isUniDirectional(), false, label.getLabelType(), body);
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ this.registry.serializeLabel(label.getUniDirectional(), false, label.getLabelType(), body);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
}
.getPathKey();
final ByteBuf body = serializePathKey(pk);
if (pk.getPceId().getValue().length == PCE_ID_F_LENGTH) {
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
} else if (pk.getPceId().getValue().length == EROPathKey128SubobjectParser.PCE128_ID_F_LENGTH) {
- EROSubobjectUtil.formatSubobject(EROPathKey128SubobjectParser.TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(EROPathKey128SubobjectParser.TYPE, subobject.getLoose(), body, buffer);
}
}
}
final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
body.writeZero(RESERVED);
serializeUnnumeredInterface(((UnnumberedCase) subobject.getSubobjectType()).getUnnumbered(), body);
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
}
.getProtectionSubobject();
final ByteBuf body = Unpooled.buffer();
serializeBody(CTYPE, protObj, body);
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
}
.getDynamicControlProtection().getProtectionSubobject();
final ByteBuf body = Unpooled.buffer();
serializeBody(CTYPE, protObj, body);
- EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
+ EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
}
}
\ No newline at end of file
}
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(LPA_F_OFFSET, subobject.isProtectionAvailable());
- flags.set(LPIU_F_OFFSET, subobject.isProtectionInUse());
+ flags.set(LPA_F_OFFSET, subobject.getProtectionAvailable());
+ flags.set(LPIU_F_OFFSET, subobject.getProtectionInUse());
final ByteBuf body = Unpooled.buffer(CONTENT4_LENGTH);
checkArgument(prefix.getIpv4Prefix() != null, "Ipv4Prefix is mandatory.");
Ipv4Util.writeIpv4Prefix(prefix.getIpv4Prefix(), body);
static void serializeSubobject(final ByteBuf buffer, final SubobjectContainer subobject,
final Ipv6Prefix ipv6Prefix) {
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(LPA_F_OFFSET, subobject.isProtectionAvailable());
- flags.set(LPIU_F_OFFSET, subobject.isProtectionInUse());
+ flags.set(LPA_F_OFFSET, subobject.getProtectionAvailable());
+ flags.set(LPIU_F_OFFSET, subobject.getProtectionInUse());
final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
Ipv6Util.writeIpv6Prefix(ipv6Prefix, body);
flags.toByteBuf(body);
requireNonNull(subobject.getSubobjectType(), "Subobject type cannot be empty.");
final Label label = ((LabelCase) subobject.getSubobjectType()).getLabel();
final ByteBuf body = Unpooled.buffer();
- this.registry.serializeLabel(label.isUniDirectional(), label.isGlobal(), label.getLabelType(), body);
+ this.registry.serializeLabel(label.getUniDirectional(), label.getGlobal(), label.getLabelType(), body);
RROSubobjectUtil.formatSubobject(TYPE, body, buffer);
}
}
checkArgument(type instanceof UnnumberedCase, "Unknown subobject instance. Passed %s. Needed UnnumberedCase.",
type.getClass());
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(LPA_F_OFFSET, subobject.isProtectionAvailable());
- flags.set(LPIU_F_OFFSET, subobject.isProtectionInUse());
+ flags.set(LPA_F_OFFSET, subobject.getProtectionAvailable());
+ flags.set(LPIU_F_OFFSET, subobject.getProtectionInUse());
final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
flags.toByteBuf(body);
body.writeZero(RESERVED);
"Unknown subobject instance. Passed %s. Needed AsNumberCase.",
subobject.getSubobjectType().getClass());
final ByteBuf body = AsNumberCaseParser.serializeSubobject((AsNumberCase) subobject.getSubobjectType());
- XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(TYPE, subobject.getMandatory(), body, buffer);
}
}
final Attribute attribute = subobject.getAttribute();
checkArgument(attribute != null, "Attribute is mandatory.");
body.writeByte(attribute.getIntValue());
- XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(TYPE, subobject.getMandatory(), body, buffer);
}
}
final Attribute attribute = subobject.getAttribute();
checkArgument(attribute != null, "Attribute is mandatory.");
body.writeByte(attribute.getIntValue());
- XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(TYPE, subobject.getMandatory(), body, buffer);
}
}
final ByteBuf body = serializePathKey(pk);
final byte[] pceId = pk.getPceId().getValue();
if (pceId.length == PCE_ID_F_LENGTH) {
- XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(TYPE, subobject.getMandatory(), body, buffer);
} else if (pceId.length == XROPathKey128SubobjectParser.PCE128_ID_F_LENGTH) {
- XROSubobjectUtil.formatSubobject(XROPathKey128SubobjectParser.TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(XROPathKey128SubobjectParser.TYPE, subobject.getMandatory(), body, buffer);
}
}
}
checkArgument(attribute != null, "Attribute is mandatory.");
body.writeByte(0);
body.writeByte(attribute.getIntValue());
- XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(TYPE, subobject.getMandatory(), body, buffer);
}
}
final Attribute attribute = subobject.getAttribute();
body.writeByte(attribute != null ? attribute.getIntValue() : 0);
serializeUnnumeredInterface(((UnnumberedCase) type).getUnnumbered(), body);
- XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
+ XROSubobjectUtil.formatSubobject(TYPE, subobject.getMandatory(), body, buffer);
}
}
final AdminStatusObject addObject = (AdminStatusObject) teLspObject;
serializeAttributeHeader(BODY_SIZE, CLASS_NUM, CTYPE, output);
final BitArray reflect = new BitArray(FLAGS_SIZE);
- reflect.set(REFLECT, addObject.isReflect());
+ reflect.set(REFLECT, addObject.getReflect());
reflect.toByteBuf(output);
output.writeShort(0);
final BitArray flags = new BitArray(FLAGS_SIZE);
- flags.set(TESTING, addObject.isTesting());
- flags.set(DOWN, addObject.isAdministrativelyDown());
- flags.set(DELETION, addObject.isDeletionInProgress());
+ flags.set(TESTING, addObject.getTesting());
+ flags.set(DOWN, addObject.getAdministrativelyDown());
+ flags.set(DELETION, addObject.getDeletionInProgress());
flags.toByteBuf(output);
}
}
serializeAttributeHeader(BODY_SIZE, CLASS_NUM, CTYPE, output);
output.writeShort(0);
final BitArray reflect = new BitArray(FLAGS_SIZE);
- reflect.set(BOUND, metric.isBound());
- reflect.set(COMPUTED, metric.isComputed());
+ reflect.set(BOUND, metric.getBound());
+ reflect.set(COMPUTED, metric.getComputed());
reflect.toByteBuf(output);
output.writeByte(metric.getMetricType().toJava());
writeFloat32(metric.getValue(), output);
protected static void serializeBodyType1(final ProtectionSubobject protObj, final ByteBuf output) {
final BitArray flagBitArray = new BitArray(FLAGS_SIZE);
- flagBitArray.set(SECONDARY, protObj.isSecondary());
+ flagBitArray.set(SECONDARY, protObj.getSecondary());
flagBitArray.toByteBuf(output);
output.writeShort(0);
output.writeByte(protObj.getLinkFlags().getIntValue());
protected static void serializeBodyType2(final ProtectionSubobject protObj, final ByteBuf output) {
final BitArray flagBitArray = new BitArray(FLAGS_SIZE);
- flagBitArray.set(SECONDARY, protObj.isSecondary());
- flagBitArray.set(PROTECTING, protObj.isProtecting());
- flagBitArray.set(NOTIFICATION, protObj.isNotification());
- flagBitArray.set(OPERATIONAL, protObj.isOperational());
+ flagBitArray.set(SECONDARY, protObj.getSecondary());
+ flagBitArray.set(PROTECTING, protObj.getProtecting());
+ flagBitArray.set(NOTIFICATION, protObj.getNotification());
+ flagBitArray.set(OPERATIONAL, protObj.getOperational());
flagBitArray.toByteBuf(output);
output.writeByte(protObj.getLspFlag().getIntValue());
output.writeByte(0);
output.writeByte(protObj.getLinkFlags().getIntValue());
final BitArray flagInPlaceBitArray = new BitArray(FLAGS_SIZE);
- flagInPlaceBitArray.set(IN_PLACE, protObj.isInPlace());
- flagInPlaceBitArray.set(REQUIRED, protObj.isRequired());
+ flagInPlaceBitArray.set(IN_PLACE, protObj.getInPlace());
+ flagInPlaceBitArray.set(REQUIRED, protObj.getRequired());
flagInPlaceBitArray.toByteBuf(output);
output.writeByte(protObj.getSegFlag().getIntValue());
output.writeShort(0);
.route.object.secondary.record.route.object.SubobjectContainer> srroSbo = sbo.stream()
.map(so -> new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.secondary
.record.route.object.secondary.record.route.object.SubobjectContainerBuilder()
- .setProtectionAvailable(so.isProtectionAvailable())
- .setProtectionInUse(so.isProtectionInUse())
+ .setProtectionAvailable(so.getProtectionAvailable())
+ .setProtectionInUse(so.getProtectionInUse())
.setSubobjectType(so.getSubobjectType())
.build()
).collect(Collectors.toList());
final ByteBuf bufferAux = Unpooled.buffer();
final List<SubobjectContainer> srroSbo = srro.getSubobjectContainer()
.stream().map(so -> new SubobjectContainerBuilder()
- .setProtectionAvailable(so.isProtectionAvailable())
- .setProtectionInUse(so.isProtectionInUse())
+ .setProtectionAvailable(so.getProtectionAvailable())
+ .setProtectionInUse(so.getProtectionInUse())
.setSubobjectType(so.getSubobjectType())
.build()).collect(Collectors.toList());
serializeList(srroSbo, bufferAux);
output.writeByte(sessionObject.getSetupPriority().toJava());
output.writeByte(sessionObject.getHoldPriority().toJava());
final BitArray bs = new BitArray(FLAGS_SIZE);
- bs.set(LOCAL_PROTECTION, sessionObject.isLocalProtectionDesired());
- bs.set(LABEL_RECORDING, sessionObject.isLabelRecordingDesired());
- bs.set(SE_STYLE, sessionObject.isSeStyleDesired());
+ bs.set(LOCAL_PROTECTION, sessionObject.getLocalProtectionDesired());
+ bs.set(LABEL_RECORDING, sessionObject.getLabelRecordingDesired());
+ bs.set(SE_STYLE, sessionObject.getSeStyleDesired());
bs.toByteBuf(output);
output.writeByte(sessionName.readableBytes());
output.writeBytes(sessionName);
output.writeByte(sessionObject.getSetupPriority().toJava());
output.writeByte(sessionObject.getHoldPriority().toJava());
final BitArray bs = new BitArray(FLAGS_SIZE);
- bs.set(SessionAttributeLspObjectParser.LOCAL_PROTECTION, sessionObject.isLocalProtectionDesired());
- bs.set(SessionAttributeLspObjectParser.LABEL_RECORDING, sessionObject.isLabelRecordingDesired());
- bs.set(SessionAttributeLspObjectParser.SE_STYLE, sessionObject.isSeStyleDesired());
+ bs.set(SessionAttributeLspObjectParser.LOCAL_PROTECTION, sessionObject.getLocalProtectionDesired());
+ bs.set(SessionAttributeLspObjectParser.LABEL_RECORDING, sessionObject.getLabelRecordingDesired());
+ bs.set(SessionAttributeLspObjectParser.SE_STYLE, sessionObject.getSeStyleDesired());
bs.toByteBuf(output);
output.writeByte(sessionName.readableBytes());
output.writeBytes(Unpooled.wrappedBuffer(StandardCharsets.US_ASCII.encode(sessionObject.getSessionName())));