Bug 1764 - created new bundle responsible for default OF switch configuration
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / NotificationQueueWrapper.java
1 /**
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  * 
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.openflowplugin.openflow.md.core;
9
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
11 import org.opendaylight.yangtools.yang.binding.DataContainer;
12 import org.opendaylight.yangtools.yang.binding.Notification;
13
14 import com.google.common.base.Preconditions;
15
16 /**
17  * 
18  */
19 public class NotificationQueueWrapper implements OfHeader {
20     
21     private final Notification notification;
22     private final Short version;
23     private Long xid = -1L;
24
25     
26     /**
27      * @param notification
28      * @param version 
29      */
30     public NotificationQueueWrapper(final Notification notification, final Short version) {
31         Preconditions.checkArgument(notification != null, "wrapped notification must not be null");
32         Preconditions.checkArgument(version != null, "message version of wrapped notification must not be null");
33         this.notification = notification; 
34         this.version = version;
35     }
36
37     @Override
38     public Class<? extends DataContainer> getImplementedInterface() {
39         return NotificationQueueWrapper.class;
40     }
41
42     @Override
43     public Short getVersion() {
44         return version;
45     }
46
47     @Override
48     public Long getXid() {
49         return xid;
50     }
51
52     /**
53      * @return the notification
54      */
55     public Notification getNotification() {
56         return notification;
57     }
58
59     /**
60      * @param xid the xid to set
61      */
62     public void setXid(Long xid) {
63         this.xid = xid;
64     }
65 }