Class BGPMessageParserMock
- java.lang.Object
-
- org.opendaylight.protocol.bgp.parser.mock.BGPMessageParserMock
-
- All Implemented Interfaces:
MessageRegistry
public class BGPMessageParserMock extends Object implements MessageRegistry
Mock implementation ofMessageRegistry
. 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 Summary
Constructors Constructor Description BGPMessageParserMock(Map<io.netty.buffer.ByteBuf,org.opendaylight.yangtools.yang.binding.Notification> messages)
Creates a new BGPMessageParserMock with given messages.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
BGPMessageParserMock
public BGPMessageParserMock(Map<io.netty.buffer.ByteBuf,org.opendaylight.yangtools.yang.binding.Notification> messages)
Creates a new BGPMessageParserMock with given messages.- Parameters:
messages
- represents a new map of ByteBuf and Notification
-
-
Method Detail
-
serializeMessage
public void serializeMessage(org.opendaylight.yangtools.yang.binding.Notification msg, io.netty.buffer.ByteBuf buffer)
Description copied from interface:MessageRegistry
Encode input BGP Message to output buffer.- Specified by:
serializeMessage
in interfaceMessageRegistry
- Parameters:
msg
- Input BGP Message to be serialized.buffer
- Output buffer where message is to be written.
-
parseMessage
public org.opendaylight.yangtools.yang.binding.Notification parseMessage(io.netty.buffer.ByteBuf buffer, PeerSpecificParserConstraint constraint) throws BGPDocumentedException, BGPParsingException
Description copied from interface:MessageRegistry
Decode input buffer to BGP Message.- Specified by:
parseMessage
in interfaceMessageRegistry
- Parameters:
buffer
- Input buffer with encoded message.constraint
- Peer specific constraint.- Returns:
- Parsed BGP message.
- Throws:
BGPDocumentedException
BGPParsingException
-
-