blob: e7dbe71bda712da557d18678032e9267ba80d308 [file] [log] [blame]
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08001/**
2* Copyright 2011, Big Switch Networks, Inc.
3* Originally created by David Erickson & Rob Sherwood, Stanford University
4*
5* Licensed under the Apache License, Version 2.0 (the "License"); you may
6* not use this file except in compliance with the License. You may obtain
7* a copy of the License at
8*
9* http://www.apache.org/licenses/LICENSE-2.0
10*
11* Unless required by applicable law or agreed to in writing, software
12* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14* License for the specific language governing permissions and limitations
15* under the License.
16**/
17
18package org.openflow.vendor.nicira;
19
20import org.openflow.protocol.Instantiable;
21import org.openflow.protocol.vendor.OFVendorData;
22
23/**
24 * Subclass of OFVendorData representing the vendor data associated with
25 * a role request vendor extension.
26 *
27 * @author Rob Vaterlaus (rob.vaterlaus@bigswitch.com)
28 */
29public class OFRoleRequestVendorData extends OFRoleVendorData {
30
31 protected static Instantiable<OFVendorData> instantiable =
32 new Instantiable<OFVendorData>() {
33 public OFVendorData instantiate() {
34 return new OFRoleRequestVendorData();
35 }
36 };
37
38 /**
39 * @return a subclass of Instantiable<OFVendorData> that instantiates
40 * an instance of OFRoleRequestVendorData.
41 */
42 public static Instantiable<OFVendorData> getInstantiable() {
43 return instantiable;
44 }
45
46 /**
47 * The data type value for a role request
48 */
49 public static final int NXT_ROLE_REQUEST = 10;
50
51 /**
52 * Construct a role request vendor data with an unspecified role value.
53 */
54 public OFRoleRequestVendorData() {
55 super(NXT_ROLE_REQUEST);
56 }
57
58 /**
59 * Construct a role request vendor data with the specified role value.
60 * @param role the role value for the role request. Should be one of
61 * NX_ROLE_OTHER, NX_ROLE_MASTER or NX_ROLE_SLAVE.
62 */
63 public OFRoleRequestVendorData(int role) {
64 super(NXT_ROLE_REQUEST, role);
65 }
66}