bug 9154: Add isRedundantRouter to DomainRouterResponse

This commit is contained in:
Sheng Yang 2011-06-15 14:39:28 -07:00
parent 1616084f47
commit 9466106c40
4 changed files with 14 additions and 0 deletions

View File

@ -119,6 +119,9 @@ public class DomainRouterResponse extends BaseResponse {
@SerializedName("serviceofferingname") @Param(description="the name of the service offering of the virtual machine")
private String serviceOfferingName;
@SerializedName("isredundantrouter") @Param(description="if this router is an redundant virtual router")
private boolean isRedundantRouter;
@SerializedName("redundantstate") @Param(description="the state of redundant virtual router")
private String redundantState;
@ -382,4 +385,12 @@ public class DomainRouterResponse extends BaseResponse {
public void setRedundantState(String redundantState) {
this.redundantState = redundantState;
}
public boolean getIsRedundantRouter() {
return isRedundantRouter;
}
public void setIsRedundantRouter(boolean isRedundantRouter) {
this.isRedundantRouter = isRedundantRouter;
}
}

View File

@ -29,6 +29,7 @@ public interface VirtualRouter extends VirtualMachine {
DHCP_USERDATA
}
Role getRole();
boolean getIsRedundantRouter();
public enum RedundantState {
UNKNOWN,
MASTER,

View File

@ -139,6 +139,7 @@ public class DomainRouterVO extends VMInstanceVO implements VirtualRouter {
this.role = role;
}
@Override
public boolean getIsRedundantRouter() {
return this.isRedundantRouter;
}

View File

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