bug 7451: Added network offering action events

status 7451: resolved fixed
This commit is contained in:
kishan 2011-06-15 16:56:18 +05:30
parent 675ffe23e8
commit 7a810d1df1

View File

@ -2644,7 +2644,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
throw new PermissionDeniedException("There's no way to confirm " + caller + " has access to zone:" + zone.getId()); throw new PermissionDeniedException("There's no way to confirm " + caller + " has access to zone:" + zone.getId());
} }
@Override @Override @ActionEvent(eventType = EventTypes.EVENT_NETWORK_OFFERING_CREATE, eventDescription = "creating network offering")
public NetworkOffering createNetworkOffering(CreateNetworkOfferingCmd cmd) { public NetworkOffering createNetworkOffering(CreateNetworkOfferingCmd cmd) {
Long userId = UserContext.current().getCallerUserId(); Long userId = UserContext.current().getCallerUserId();
String name = cmd.getNetworkOfferingName(); String name = cmd.getNetworkOfferingName();
@ -2722,6 +2722,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
gatewayService, firewallService, lbService, vpnService, guestIpType, false); gatewayService, firewallService, lbService, vpnService, guestIpType, false);
if ((offering = _networkOfferingDao.persist(offering)) != null) { if ((offering = _networkOfferingDao.persist(offering)) != null) {
UserContext.current().setEventDetails(" Id: "+offering.getId()+" Name: "+name);
return offering; return offering;
} else { } else {
return null; return null;
@ -2809,10 +2810,11 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
return _networkOfferingDao.search(sc, searchFilter); return _networkOfferingDao.search(sc, searchFilter);
} }
@Override @Override @ActionEvent(eventType = EventTypes.EVENT_NETWORK_OFFERING_DELETE, eventDescription = "deleting network offering")
public boolean deleteNetworkOffering(DeleteNetworkOfferingCmd cmd) { public boolean deleteNetworkOffering(DeleteNetworkOfferingCmd cmd) {
Long offeringId = cmd.getId(); Long offeringId = cmd.getId();
UserContext.current().setEventDetails(" Id: "+offeringId);
// Verify network offering id // Verify network offering id
NetworkOfferingVO offering = _networkOfferingDao.findById(offeringId); NetworkOfferingVO offering = _networkOfferingDao.findById(offeringId);
if (offering == null) { if (offering == null) {
@ -2833,14 +2835,15 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
} }
} }
@Override @Override @ActionEvent(eventType = EventTypes.EVENT_NETWORK_OFFERING_EDIT, eventDescription = "updating network offering")
public NetworkOffering updateNetworkOffering(UpdateNetworkOfferingCmd cmd) { public NetworkOffering updateNetworkOffering(UpdateNetworkOfferingCmd cmd) {
String displayText = cmd.getDisplayText(); String displayText = cmd.getDisplayText();
Long id = cmd.getId(); Long id = cmd.getId();
String name = cmd.getNetworkOfferingName(); String name = cmd.getNetworkOfferingName();
String availabilityStr = cmd.getAvailability(); String availabilityStr = cmd.getAvailability();
Availability availability = null; Availability availability = null;
UserContext.current().setEventDetails(" Id: "+id);
// Verify input parameters // Verify input parameters
NetworkOfferingVO offeringToUpdate = _networkOfferingDao.findById(id); NetworkOfferingVO offeringToUpdate = _networkOfferingDao.findById(id);
if (offeringToUpdate == null) { if (offeringToUpdate == null) {