public class BGPMessageParserMock extends Object implements MessageRegistry
MessageRegistry
. It implements the required interface by having two internal maps,
each used in one of the methods. It looks up the key provided to the method and returns whatever value is stored in
the map.Constructor and Description |
---|
BGPMessageParserMock(Map<io.netty.buffer.ByteBuf,org.opendaylight.yangtools.yang.binding.Notification> messages)
Creates a new BGPMessageParserMock with given messages.
|
Modifier and Type | Method and Description |
---|---|
org.opendaylight.yangtools.yang.binding.Notification |
parseMessage(io.netty.buffer.ByteBuf buffer,
PeerSpecificParserConstraint constraint)
Decode input buffer to BGP Message.
|
void |
serializeMessage(org.opendaylight.yangtools.yang.binding.Notification msg,
io.netty.buffer.ByteBuf buffer)
Encode input BGP Message to output buffer.
|
public BGPMessageParserMock(Map<io.netty.buffer.ByteBuf,org.opendaylight.yangtools.yang.binding.Notification> messages)
messages
- represents a new map of ByteBuf and Notificationpublic void serializeMessage(org.opendaylight.yangtools.yang.binding.Notification msg, io.netty.buffer.ByteBuf buffer)
MessageRegistry
serializeMessage
in interface MessageRegistry
msg
- Input BGP Message to be serialized.buffer
- Output buffer where message is to be written.public org.opendaylight.yangtools.yang.binding.Notification parseMessage(io.netty.buffer.ByteBuf buffer, PeerSpecificParserConstraint constraint) throws BGPDocumentedException, BGPParsingException
MessageRegistry
parseMessage
in interface MessageRegistry
buffer
- Input buffer with encoded message.constraint
- Peer specific constraint.BGPDocumentedException
BGPParsingException
Copyright © 2019 OpenDaylight. All rights reserved.