blob: 114cc9347d0fd86a404eb9751b8b5edfd4128269 [file] [log] [blame]
Jian Li152b8852015-12-07 14:47:25 -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.controller.driver;
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 {
29 OFType type;
30
31 private OfMessageAdapter() {}
32
33 public OfMessageAdapter(OFType type) {
34 this.type = type;
35 }
36
37 @Override
38 public OFType getType() {
39 return type;
40 }
41
42 @Override
43 public OFVersion getVersion() {
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}