Ray Milkey | 4bf8a58 | 2015-11-04 08:26:19 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | ce2a03d | 2017-08-03 19:21:03 -0700 | [diff] [blame^] | 2 | * Copyright 2015-present Open Networking Foundation |
Ray Milkey | 4bf8a58 | 2015-11-04 08:26:19 -0800 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.openflow; |
| 17 | |
| 18 | import org.jboss.netty.buffer.ChannelBuffer; |
| 19 | import org.projectfloodlight.openflow.protocol.OFMessage; |
| 20 | import org.projectfloodlight.openflow.protocol.OFType; |
| 21 | import org.projectfloodlight.openflow.protocol.OFVersion; |
| 22 | |
| 23 | import com.google.common.hash.PrimitiveSink; |
| 24 | |
| 25 | /** |
| 26 | * Adapter for testing against an OpenFlow message. |
| 27 | */ |
| 28 | public class OfMessageAdapter implements OFMessage { |
Ray Milkey | 7ec0d1b | 2015-11-13 08:51:35 -0800 | [diff] [blame] | 29 | OFType type; |
| 30 | |
| 31 | private OfMessageAdapter() {} |
| 32 | |
| 33 | public OfMessageAdapter(OFType type) { |
| 34 | this.type = type; |
Ray Milkey | 4bf8a58 | 2015-11-04 08:26:19 -0800 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | @Override |
| 38 | public OFType getType() { |
Ray Milkey | 7ec0d1b | 2015-11-13 08:51:35 -0800 | [diff] [blame] | 39 | return type; |
| 40 | } |
| 41 | |
| 42 | @Override |
| 43 | public OFVersion getVersion() { |
Ray Milkey | 4bf8a58 | 2015-11-04 08:26:19 -0800 | [diff] [blame] | 44 | return null; |
| 45 | } |
| 46 | |
| 47 | @Override |
| 48 | public long getXid() { |
| 49 | return 0; |
| 50 | } |
| 51 | |
| 52 | @Override |
| 53 | public void writeTo(ChannelBuffer channelBuffer) { } |
| 54 | |
| 55 | @Override |
| 56 | public Builder createBuilder() { |
| 57 | return null; |
| 58 | } |
| 59 | |
| 60 | @Override |
| 61 | public void putTo(PrimitiveSink sink) { } |
| 62 | } |