fixing disassociateIpAddress API to call 'releasePortableIpAddress'

network service method for portable ip address. Also fix ensures events
coresponding to the portabl ip are generated correctly.
This commit is contained in:
Murali Reddy 2013-05-24 18:51:24 +05:30
parent 8b9d6d81a2
commit b000781bfc
3 changed files with 12 additions and 4 deletions

View File

@ -103,7 +103,7 @@ public class EventTypes {
public static final String EVENT_NET_IP_ASSIGN = "NET.IPASSIGN";
public static final String EVENT_NET_IP_RELEASE = "NET.IPRELEASE";
public static final String EVENT_PORTABLE_IP_ASSIGN = "PORTABLE.IPASSIGN";
public static final String EVENT_PORTABLE_IP_RELEASE = "PORTABLEIPRELEASE";
public static final String EVENT_PORTABLE_IP_RELEASE = "PORTABLE.IPRELEASE";
public static final String EVENT_NET_RULE_ADD = "NET.RULEADD";
public static final String EVENT_NET_RULE_DELETE = "NET.RULEDELETE";
public static final String EVENT_NET_RULE_MODIFY = "NET.RULEMODIFY";

View File

@ -191,7 +191,11 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
@Override
public String getEventType() {
return EventTypes.EVENT_NET_IP_ASSIGN;
if (isPortable()) {
return EventTypes.EVENT_PORTABLE_IP_ASSIGN;
} else {
return EventTypes.EVENT_NET_IP_ASSIGN;
}
}
@Override

View File

@ -78,7 +78,7 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd {
if (!isPortable(id)) {
result = _networkService.releaseIpAddress(getIpAddressId());
} else {
result = _networkService.releaseIpAddress(getIpAddressId());
result = _networkService.releasePortableIpAddress(getIpAddressId());
}
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
@ -90,7 +90,11 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd {
@Override
public String getEventType() {
return EventTypes.EVENT_NET_IP_RELEASE;
if (!isPortable(id)) {
return EventTypes.EVENT_NET_IP_RELEASE;
} else {
return EventTypes.EVENT_PORTABLE_IP_RELEASE;
}
}
@Override