@Override
@ActionEvent(eventType = EventTypes.EVENT_S2S_VPN_GATEWAY_UPDATE, eventDescription = "updating s2s vpn gateway", async = true)
public Site2SiteVpnGateway updateVpnGateway(Long id, String customId, Boolean forDisplay) {
Account caller = CallContext.current().getCallingAccount();
Site2SiteVpnGatewayVO vpnGateway = _vpnGatewayDao.findById(id);
if (vpnGateway == null) {
throw new InvalidParameterValueException("Fail to find vpn gateway with " + id);
}
_accountMgr.checkAccess(caller, null, false, vpnGateway);
if (customId != null) {
vpnGateway.setUuid(customId);
}
if (forDisplay != null) {
vpnGateway.setDisplay(forDisplay);
}
_vpnGatewayDao.update(id, vpnGateway);
return _vpnGatewayDao.findById(id);