bug 9154: Add redundant state to DomainRouterResponse

This commit is contained in:
Sheng Yang 2011-06-14 19:30:30 -07:00
parent 206eef2805
commit 07a61686db
4 changed files with 15 additions and 4 deletions

View File

@ -119,8 +119,8 @@ public class DomainRouterResponse extends BaseResponse {
@SerializedName("serviceofferingname") @Param(description="the name of the service offering of the virtual machine")
private String serviceOfferingName;
@SerializedName("redundantstate") @Param(description="the state of redundant virtual router")
private String redundantState;
@Override
public Long getObjectId() {
@ -374,4 +374,12 @@ public class DomainRouterResponse extends BaseResponse {
public void setServiceOfferingName(String serviceOfferingName) {
this.serviceOfferingName = serviceOfferingName;
}
public String getRedundantState() {
return redundantState;
}
public void setRedundantState(String redundantState) {
this.redundantState = redundantState;
}
}

View File

@ -30,8 +30,9 @@ public interface VirtualRouter extends VirtualMachine {
}
Role getRole();
public enum RedundantState {
UNKNOWN,
MASTER,
BACKUP,
UNKNOWN
BACKUP
}
RedundantState getRedundantState();
}

View File

@ -160,6 +160,7 @@ public class DomainRouterVO extends VMInstanceVO implements VirtualRouter {
this.priority = priority;
}
@Override
public RedundantState getRedundantState() {
return this.redundantState;
}

View File

@ -1257,6 +1257,7 @@ public class ApiResponseHelper implements ResponseGenerator {
routerResponse.setTemplateId(router.getTemplateId());
routerResponse.setCreated(router.getCreated());
routerResponse.setState(router.getState());
routerResponse.setRedundantState(router.getRedundantState().toString());
if (router.getHostId() != null) {
routerResponse.setHostId(router.getHostId());