Removed wrong handling of PCEP messages.
Change-Id: If7b57dd2bf7ce56bee4c4f041cf64ddf667c72fa
Signed-off-by: Dana Kutenicsova <dkutenic@cisco.com>
retBytes[0] = (byte) (lspID >> 12);
retBytes[1] = (byte) (lspID >> 4);
retBytes[2] = (byte) (lspID << 4);
- if (specObj.isDelegate()) {
+ if (specObj.isDelegate() != null && specObj.isDelegate()) {
retBytes[3] |= 1 << (Byte.SIZE - (DELEGATE_FLAG_OFFSET - Byte.SIZE) - 1);
}
- if (specObj.isRemove()) {
+ if (specObj.isRemove() != null && specObj.isRemove()) {
retBytes[3] |= 1 << (Byte.SIZE - (REMOVE_FLAG_OFFSET - Byte.SIZE) - 1);
}
- if (specObj.isSync()) {
+ if (specObj.isSync() != null && specObj.isSync()) {
retBytes[3] |= 1 << (Byte.SIZE - (SYNC_FLAG_OFFSET - Byte.SIZE) - 1);
}
- if (specObj.isOperational()) {
+ if (specObj.isOperational() != null && specObj.isOperational()) {
retBytes[3] |= 1 << (Byte.SIZE - (OPERATIONAL_FLAG_OFFSET - Byte.SIZE) - 1);
}
ByteArray.copyWhole(tlvs, retBytes, TLVS_OFFSET);
retBytes[0] = (byte) (lspID >> 12);
retBytes[1] = (byte) (lspID >> 4);
retBytes[2] = (byte) (lspID << 4);
- if (specObj.isDelegate()) {
+ if (specObj.isDelegate() != null && specObj.isDelegate()) {
retBytes[3] |= 1 << (Byte.SIZE - (DELEGATE_FLAG_OFFSET - Byte.SIZE) - 1);
}
- if (specObj.isRemove()) {
+ if (specObj.isRemove() != null && specObj.isRemove()) {
retBytes[3] |= 1 << (Byte.SIZE - (REMOVE_FLAG_OFFSET - Byte.SIZE) - 1);
}
- if (specObj.isSync()) {
+ if (specObj.isSync() != null && specObj.isSync()) {
retBytes[3] |= 1 << (Byte.SIZE - (SYNC_FLAG_OFFSET - Byte.SIZE) - 1);
}
- if (specObj.isAdministrative()) {
+ if (specObj.isAdministrative() != null && specObj.isAdministrative()) {
retBytes[3] |= 1 << (Byte.SIZE - (ADMINISTRATIVE_FLAG_OFFSET - Byte.SIZE) - 1);
}
- if (specObj.getAugmentation(Lsp1.class).isCreate()) {
+ if (specObj.getAugmentation(Lsp1.class).isCreate() != null && specObj.getAugmentation(Lsp1.class).isCreate()) {
retBytes[3] |= 1 << (Byte.SIZE - (CREATE_FLAG_OFFSET - Byte.SIZE) - 1);
}
- final int op = specObj.getOperational().getIntValue();
- retBytes[3] |= (op & 7) << 4;
+ if (specObj.getOperational() != null) {
+ final int op = specObj.getOperational().getIntValue();
+ retBytes[3] |= (op & 7) << 4;
+ }
ByteArray.copyWhole(tlvs, retBytes, TLVS_OFFSET);
return ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), retBytes);
}
retBytes[0] = (byte) (lspID >> 12);
retBytes[1] = (byte) (lspID >> 4);
retBytes[2] = (byte) (lspID << 4);
- if (specObj.isDelegate()) {
+ if (specObj.isDelegate() != null && specObj.isDelegate()) {
retBytes[3] |= 1 << (Byte.SIZE - (DELEGATE_FLAG_OFFSET - Byte.SIZE) - 1);
}
- if (specObj.isRemove()) {
+ if (specObj.isRemove() != null && specObj.isRemove()) {
retBytes[3] |= 1 << (Byte.SIZE - (REMOVE_FLAG_OFFSET - Byte.SIZE) - 1);
}
- if (specObj.isSync()) {
+ if (specObj.isSync() != null && specObj.isSync()) {
retBytes[3] |= 1 << (Byte.SIZE - (SYNC_FLAG_OFFSET - Byte.SIZE) - 1);
}
- if (specObj.isAdministrative()) {
+ if (specObj.isAdministrative() != null && specObj.isAdministrative()) {
retBytes[3] |= 1 << (Byte.SIZE - (ADMINISTRATIVE_FLAG_OFFSET - Byte.SIZE) - 1);
}
- final int op = specObj.getOperational().getIntValue();
- retBytes[3] |= (op & 7) << 4;
+ if (specObj.getOperational() != null) {
+ final int op = specObj.getOperational().getIntValue();
+ retBytes[3] |= (op & 7) << 4;
+ }
ByteArray.copyWhole(tlvs, retBytes, TLVS_OFFSET);
return ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), retBytes);
}
import org.opendaylight.protocol.pcep.PCEPTerminationReason;
import org.opendaylight.protocol.pcep.TerminationReason;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcerr;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.PcerrBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.MessageHeader;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ProtocolVersion;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcerr.message.PcerrMessageBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.Node1;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.Node1Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.OperationResult;
}
};
private static final Logger LOG = LoggerFactory.getLogger(AbstractTopologySessionListener.class);
- private static final Pcerr UNHANDLED_MESSAGE_ERROR = new PcerrBuilder().setPcerrMessage(
- new PcerrMessageBuilder().setErrorType(null).build()).build();
// FIXME: make this private
protected final ServerSessionManager serverSessionManager;
if (onMessage(trans, message)) {
LOG.info("Unhandled message {} on session {}", message, session);
- session.sendMessage(UNHANDLED_MESSAGE_ERROR);
return;
}