BUG-2218: Keep existing link augmentations during discovery process
[controller.git] / opendaylight / adsal / sal / api / src / main / java / org / opendaylight / controller / sal / action / Enqueue.java
1 /*
2  * Copyright (c) 2013 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
9 package org.opendaylight.controller.sal.action;
10
11 import javax.xml.bind.annotation.XmlAccessType;
12 import javax.xml.bind.annotation.XmlAccessorType;
13 import javax.xml.bind.annotation.XmlElement;
14 import javax.xml.bind.annotation.XmlRootElement;
15
16 import org.opendaylight.controller.sal.core.NodeConnector;
17
18 @XmlRootElement
19 @XmlAccessorType(XmlAccessType.NONE)
20 public class Enqueue extends Action {
21     private static final long serialVersionUID = 1L;
22     @XmlElement
23     private NodeConnector port;
24     @XmlElement
25     private int queue;
26
27     /* Dummy constructor for JAXB */
28     @SuppressWarnings("unused")
29     private Enqueue() {
30     }
31
32     public Enqueue(NodeConnector port) {
33         type = ActionType.ENQUEUE;
34         this.port = port;
35         this.queue = 0;
36     }
37
38     public Enqueue(NodeConnector port, int queue) {
39         type = ActionType.ENQUEUE;
40         this.port = port;
41         this.queue = queue;
42     }
43
44     public NodeConnector getPort() {
45         return port;
46     }
47
48     public int getQueue() {
49         return queue;
50     }
51
52     @Override
53     public String toString() {
54         return String.format("%s[%s:%s]", type, port, queue);
55     }
56 }