blob: b7446eb946ce090cc2e9ac6315186d590d0cf2ee [file] [log] [blame]
Ray Milkey4bf8a582015-11-04 08:26:19 -08001/*
2 * Copyright 2015 Open Networking Laboratory
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 */
16package org.onosproject.openflow;
17
18import org.jboss.netty.buffer.ChannelBuffer;
19import org.projectfloodlight.openflow.protocol.OFMessage;
20import org.projectfloodlight.openflow.protocol.OFType;
21import org.projectfloodlight.openflow.protocol.OFVersion;
22
23import com.google.common.hash.PrimitiveSink;
24
25/**
26 * Adapter for testing against an OpenFlow message.
27 */
28public class OfMessageAdapter implements OFMessage {
Ray Milkey7ec0d1b2015-11-13 08:51:35 -080029 OFType type;
30
31 private OfMessageAdapter() {}
32
33 public OfMessageAdapter(OFType type) {
34 this.type = type;
Ray Milkey4bf8a582015-11-04 08:26:19 -080035 }
36
37 @Override
38 public OFType getType() {
Ray Milkey7ec0d1b2015-11-13 08:51:35 -080039 return type;
40 }
41
42 @Override
43 public OFVersion getVersion() {
Ray Milkey4bf8a582015-11-04 08:26:19 -080044 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}