コード例 #1
0
 @SuppressWarnings("deprecation")
 @Override
 public void execute() {
   try {
     Host externalFirewall = _srxElementService.addExternalFirewall(this);
     ExternalFirewallResponse response =
         _srxElementService.createExternalFirewallResponse(externalFirewall);
     response.setObjectName("externalfirewall");
     response.setResponseName(getCommandName());
     this.setResponseObject(response);
   } catch (InvalidParameterValueException ipve) {
     throw new ServerApiException(ApiErrorCode.PARAM_ERROR, ipve.getMessage());
   } catch (CloudRuntimeException cre) {
     throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, cre.getMessage());
   }
 }
コード例 #2
0
 @Override
 public void execute()
     throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException,
         ConcurrentOperationException, ResourceAllocationException {
   try {
     ExternalFirewallDeviceVO fwDeviceVO = _srxFwService.addSrxFirewall(this);
     if (fwDeviceVO != null) {
       SrxFirewallResponse response = _srxFwService.createSrxFirewallResponse(fwDeviceVO);
       response.setObjectName("srxfirewall");
       response.setResponseName(getCommandName());
       this.setResponseObject(response);
     } else {
       throw new ServerApiException(
           BaseAsyncCmd.INTERNAL_ERROR, "Failed to add SRX firewall due to internal error.");
     }
   } catch (InvalidParameterValueException invalidParamExcp) {
     throw new ServerApiException(BaseCmd.PARAM_ERROR, invalidParamExcp.getMessage());
   } catch (CloudRuntimeException runtimeExcp) {
     throw new ServerApiException(BaseCmd.INTERNAL_ERROR, runtimeExcp.getMessage());
   }
 }