blob: ef32958a8ff751be92d81508324c6e0536c8e42c [file] [log] [blame]
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08001/**
Ray Milkey269ffb92014-04-03 14:43:30 -07002 * Copyright 2011, Big Switch Networks, Inc.
3 * Originally created by David Erickson, 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 **/
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080017
18package net.floodlightcontroller.util;
19
20/**
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080021 * @author David Erickson (daviderickson@cs.stanford.edu)
22 */
23public enum BundleState {
Ray Milkey269ffb92014-04-03 14:43:30 -070024 ACTIVE(32),
25 INSTALLED(2),
26 RESOLVED(4),
27 STARTING(8),
28 STOPPING(16),
29 UNINSTALLED(1);
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -080030
31 protected int value;
32
33 private BundleState(int value) {
34 this.value = value;
35 }
36
37 /**
38 * @return the value
39 */
40 public int getValue() {
41 return value;
42 }
43
44 public static BundleState getState(int value) {
45 switch (value) {
46 case 32:
47 return ACTIVE;
48 case 2:
49 return INSTALLED;
50 case 4:
51 return RESOLVED;
52 case 8:
53 return STARTING;
54 case 16:
55 return STOPPING;
56 case 1:
57 return UNINSTALLED;
58 }
59 return null;
60 }
61}