Package com.cloud.utils.exception

Examples of com.cloud.utils.exception.ExecutionException


            }
        } catch (nitro_exception e) {
            if (e.getErrorCode() == NitroError.NS_RESOURCE_NOT_EXISTS) {
                return;
            } else {
                throw new ExecutionException("Failed to delete monitor :" + nsMonitorName + " due to " + e.getMessage());
            }
        } catch (Exception e) {
            throw new ExecutionException("Failed to delete monitor :" + nsMonitorName + " due to " + e.getMessage());
        }

    }
View Full Code Here


    public synchronized void applyAutoScaleConfig(LoadBalancerTO loadBalancer) throws Exception, ExecutionException {

        AutoScaleVmGroupTO vmGroupTO = loadBalancer.getAutoScaleVmGroupTO();
        if(!isAutoScaleSupportedInNetScaler()) {
            throw new ExecutionException("AutoScale not supported in this version of NetScaler");
        }
        if(loadBalancer.isRevoked() || vmGroupTO.getState().equals("revoke")) {
            removeAutoScaleConfig(loadBalancer);
        }
        else {
View Full Code Here

    private void saveConfiguration() throws ExecutionException {
        try {
            apiCallResult = nsconfig.save(_netscalerService);
            if (apiCallResult.errorcode != 0) {
                throw new ExecutionException("Error occured while saving configuration changes to Netscaler device due to " + apiCallResult.message);
            }
        } catch (nitro_exception e) {
            throw new ExecutionException("Failed to save configuration changes to Netscaler device due to " + e.getMessage());
        } catch (Exception e) {
            throw new ExecutionException("Failed to save configuration changes to Netscaler device due to " + e.getMessage());
        }
    }
View Full Code Here

                    }
                }
            }
        } catch (Exception e) {
            s_logger.error("Failed to get bytes sent and recived statistics due to " + e);
            throw new ExecutionException(e.getMessage());
        }

        return answer;
    }
View Full Code Here

            lbProtocol = LbProtocol.tcp;
          } else {
            lbProtocol = LbProtocol.valueOf(loadBalancer.getProtocol());
          }
        } catch (IllegalArgumentException e) {
          throw new ExecutionException("Got invalid protocol: " + loadBalancer.getProtocol());
        }
       
        LbAlgorithm lbAlgorithm;
        if (loadBalancer.getAlgorithm().equals("roundrobin")) {
          lbAlgorithm = LbAlgorithm.RoundRobin;
        } else if (loadBalancer.getAlgorithm().equals("leastconn")) {
          lbAlgorithm = LbAlgorithm.LeastConn;
        } else {
          throw new ExecutionException("Got invalid algorithm: " + loadBalancer.getAlgorithm());
        }   
       
        String srcIp = inline ? tagAddressWithRouteDomain(loadBalancer.getSrcIp(), guestVlanTag) : loadBalancer.getSrcIp();
        int srcPort = loadBalancer.getSrcPort()
        String virtualServerName = genVirtualServerName(lbProtocol, srcIp, srcPort);
View Full Code Here

      _configSyncApi.save_configuration("", SystemConfigSyncSaveMode.SAVE_BASE_LEVEL_CONFIG);   
      _configSyncApi.save_configuration("", SystemConfigSyncSaveMode.SAVE_HIGH_LEVEL_CONFIG);   
      s_logger.debug("Successfully saved F5 BigIp configuration.");
    } catch (RemoteException e) {
      s_logger.error("Failed to save F5 BigIp configuration due to: " + e);
      throw new ExecutionException(e.getMessage());
    }
  }
View Full Code Here

         
        s_logger.debug("Creating a guest VLAN with tag " + vlanTag);
        _vlanApi.create(vlanNames, vlanTags, vlanMemberEntries, commonEnabledState, new long[]{10L}, new String[]{"00:00:00:00:00:00"});   
       
        if (!getVlans().contains(vlanName)) {
          throw new ExecutionException("Failed to create vlan with tag " + vlanTag);
        }
      }
     
      if (inline) {
        List<Long> allRouteDomains = getRouteDomains();
        if (!allRouteDomains.contains(vlanTag)) {
          long[] routeDomainIds = genLongArray(vlanTag);
          String[][] vlanNames = new String[][]{genStringArray(genVlanName(vlanTag))};
         
          s_logger.debug("Creating route domain " + vlanTag);
          _routeDomainApi.create(routeDomainIds, vlanNames);
         
          if (!getRouteDomains().contains(vlanTag)) {
            throw new ExecutionException("Failed to create route domain " + vlanTag);
          }
        }
      }
     
      List<String> allSelfIps = getSelfIps();
      if (!allSelfIps.contains(vlanSelfIp)) {
        String[] selfIpsToCreate = genStringArray(vlanSelfIp);
        String[] vlans = genStringArray(vlanName);
        String[] netmasks = genStringArray(vlanNetmask);
        long[] unitIds = genLongArray(0L);
        CommonEnabledState[] enabledStates = new CommonEnabledState[]{CommonEnabledState.STATE_DISABLED};
       
        s_logger.debug("Creating self IP " + vlanSelfIp);
        _selfIpApi.create(selfIpsToCreate, vlans, netmasks, unitIds, enabledStates);
       
        if (!getSelfIps().contains(vlanSelfIp)) {
          throw new ExecutionException("Failed to create self IP " + vlanSelfIp);
        }
      }
    } catch (RemoteException e) {
      s_logger.error(e);
      throw new ExecutionException(e.getMessage());
    }
     
  }
View Full Code Here

      if (allSelfIps.contains(vlanSelfIp)) {
        s_logger.debug("Deleting self IP " + vlanSelfIp);
        _selfIpApi.delete_self_ip(genStringArray(vlanSelfIp));

        if (getSelfIps().contains(vlanSelfIp)) {
          throw new ExecutionException("Failed to delete self IP " + vlanSelfIp);
        }
      }
     
      if (inline) {
        List<Long> allRouteDomains = getRouteDomains();
        if (allRouteDomains.contains(vlanTag)) {
          s_logger.debug("Deleting route domain " + vlanTag);
          _routeDomainApi.delete_route_domain(genLongArray(vlanTag));
         
          if (getRouteDomains().contains(vlanTag)) {
            throw new ExecutionException("Failed to delete route domain " + vlanTag);
          }
        }
      }

      String vlanName = genVlanName(vlanTag)
      List<String> allVlans = getVlans();
      if (allVlans.contains(vlanName)) {
        _vlanApi.delete_vlan(genStringArray(vlanName));

        if (getVlans().contains(vlanName)) {
          throw new ExecutionException("Failed to delete VLAN with tag: " + vlanTag);
        }
      }       
    } catch (RemoteException e) {
      throw new ExecutionException(e.getMessage());
    }
  }
View Full Code Here

        routeDomains.add(routeDomainName);
      }
     
      return routeDomains;
    } catch (RemoteException e) {
      throw new ExecutionException(e.getMessage());
    }
  }
View Full Code Here

        selfIps.add(selfIp);
      }

      return selfIps;
    } catch (RemoteException e) {
      throw new ExecutionException(e.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of com.cloud.utils.exception.ExecutionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.