Class BGPMessageParserMock
- java.lang.Object
-
- org.opendaylight.protocol.bgp.parser.mock.BGPMessageParserMock
-
- All Implemented Interfaces:
org.opendaylight.protocol.bgp.parser.spi.MessageRegistry
public class BGPMessageParserMock extends Object implements org.opendaylight.protocol.bgp.parser.spi.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.NotificationparseMessage(io.netty.buffer.ByteBuf buffer, org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint constraint)voidserializeMessage(org.opendaylight.yangtools.yang.binding.Notification msg, io.netty.buffer.ByteBuf 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)- Specified by:
serializeMessagein interfaceorg.opendaylight.protocol.bgp.parser.spi.MessageRegistry
-
parseMessage
public org.opendaylight.yangtools.yang.binding.Notification parseMessage(io.netty.buffer.ByteBuf buffer, org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint constraint) throws org.opendaylight.protocol.bgp.parser.BGPDocumentedException, org.opendaylight.protocol.bgp.parser.BGPParsingException- Specified by:
parseMessagein interfaceorg.opendaylight.protocol.bgp.parser.spi.MessageRegistry- Throws:
org.opendaylight.protocol.bgp.parser.BGPDocumentedExceptionorg.opendaylight.protocol.bgp.parser.BGPParsingException
-
-