added new status for ibm

This commit is contained in:
Adrian Cole 2010-07-21 11:50:40 -07:00
parent 5bd3eb0571
commit 318e9b9071
1 changed files with 21 additions and 19 deletions

View File

@ -29,25 +29,27 @@ import javax.annotation.Nullable;
public class Address { public class Address {
public static enum State { public static enum State {
NEW, ALLOCATING, FREE, ATTACHED, RELEASING, RELEASED, FAILED; NEW, ALLOCATING, FREE, ATTACHED, RELEASING, RELEASED, FAILED, RELEASE_PENDING;
public static State fromValue(int v) { public static State fromValue(int v) {
switch (v) { switch (v) {
case 0: case 0:
return NEW; return NEW;
case 1: case 1:
return ALLOCATING; return ALLOCATING;
case 2: case 2:
return FREE; return FREE;
case 3: case 3:
return ATTACHED; return ATTACHED;
case 4: case 4:
return RELEASING; return RELEASING;
case 5: case 5:
return RELEASED; return RELEASED;
case 6: case 6:
return FAILED; return FAILED;
default: case 7:
throw new IllegalArgumentException("invalid state:" + v); return RELEASE_PENDING;
default:
throw new IllegalArgumentException("invalid state:" + v);
} }
} }
} }
@ -156,8 +158,8 @@ public class Address {
@Override @Override
public String toString() { public String toString() {
return "[id=" + id + ", ip=" + ip + ", location=" + location + ", state=" + getState() return "[id=" + id + ", ip=" + ip + ", location=" + location + ", state=" + getState() + ", instanceId="
+ ", instanceId=" + instanceId + "]"; + instanceId + "]";
} }
} }