Package com.cloud.utils.exception

Examples of com.cloud.utils.exception.ExecutionException


    }

    private void createEdgeDeviceProfile(String tenant, List<String> gateways, Long vlanId) throws ExecutionException {
        // create edge device profile
        if (!_connection.createTenantVDCEdgeDeviceProfile(tenant))
            throw new ExecutionException("Failed to create tenant edge device profile in VNMC for guest network with vlan " + vlanId);

        // create edge static route policy
        if (!_connection.createTenantVDCEdgeStaticRoutePolicy(tenant))
            throw new ExecutionException("Failed to create tenant edge static route policy in VNMC for guest network with vlan " + vlanId);

        // create edge static route for all gateways
        for (String gateway : gateways) {
            if (!_connection.createTenantVDCEdgeStaticRoute(tenant, gateway, "0.0.0.0", "0.0.0.0"))
                throw new ExecutionException("Failed to create tenant edge static route in VNMC for guest network with vlan " + vlanId);
        }

        // associate edge
        if (!_connection.associateTenantVDCEdgeStaticRoutePolicy(tenant))
            throw new ExecutionException("Failed to associate edge static route policy with edge device profile in VNMC for guest network with vlan " + vlanId);
    }
View Full Code Here


    private Answer execute(CreateLogicalEdgeFirewallCommand cmd, int numRetries) {
        String tenant = "vlan-" + cmd.getVlanId();
        try {
            // create tenant
            if (!_connection.createTenant(tenant))
                throw new ExecutionException("Failed to create tenant in VNMC for guest network with vlan " + cmd.getVlanId());

            // create tenant VDC
            if (!_connection.createTenantVDC(tenant))
                throw new ExecutionException("Failed to create tenant VDC in VNMC for guest network with vlan " + cmd.getVlanId());

            // create edge security profile
            if (!_connection.createTenantVDCEdgeSecurityProfile(tenant))
                throw new ExecutionException("Failed to create tenant edge security profile in VNMC for guest network with vlan " + cmd.getVlanId());

            // create edge device profile and associated route
            createEdgeDeviceProfile(tenant, cmd.getPublicGateways(), cmd.getVlanId());

            // create logical edge firewall
            if (!_connection.createEdgeFirewall(tenant, cmd.getPublicIp(), cmd.getInternalIp(), cmd.getPublicSubnet(), cmd.getInternalSubnet()))
                throw new ExecutionException("Failed to create edge firewall in VNMC for guest network with vlan " + cmd.getVlanId());
        } catch (ExecutionException e) {
            String msg = "CreateLogicalEdgeFirewallCommand failed due to " + e.getMessage();
            s_logger.error(msg, e);
            return new Answer(cmd, false, msg);
        }
View Full Code Here

    private Answer execute(AssociateAsaWithLogicalEdgeFirewallCommand cmd, int numRetries) {
        String tenant = "vlan-" + cmd.getVlanId();
        try {
            Map<String, String> availableAsaAppliances = _connection.listUnAssocAsa1000v();
            if (availableAsaAppliances.isEmpty()) {
                throw new ExecutionException("No ASA 1000v available to associate with logical edge firewall for guest vlan " + cmd.getVlanId());
            }

            String asaInstanceDn = availableAsaAppliances.get(cmd.getAsaMgmtIp());
            if (asaInstanceDn == null) {
                throw new ExecutionException("Requested ASA 1000v (" + cmd.getAsaMgmtIp() + ") is not available");
            }

            if (!_connection.assignAsa1000v(tenant, asaInstanceDn)) {
                throw new ExecutionException("Failed to associate ASA 1000v (" + cmd.getAsaMgmtIp() + ") with logical edge firewall for guest vlan " + cmd.getVlanId());
            }
        } catch (ExecutionException e) {
            String msg = "AssociateAsaWithLogicalEdgeFirewallCommand failed due to " + e.getMessage();
            s_logger.error(msg, e);
            return new Answer(cmd, false, msg);
View Full Code Here

            } catch (Exception e) {
                String errMsg = "Failed to create GSLB site: " + siteName + " due to " + e.getMessage();
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug(errMsg);
                }
                throw new ExecutionException(errMsg);
            }
        }
View Full Code Here

            } catch (Exception e) {
                String errMsg = "Failed to delete GSLB site: " + siteName + " due to " + e.getMessage();
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug(errMsg);
                }
                throw new ExecutionException(errMsg);
            }
        }
View Full Code Here

            } catch (Exception e) {
                String errMsg = "Failed to update GSLB site: " + siteName + " due to " + e.getMessage();
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug(errMsg);
                }
                throw new ExecutionException(errMsg);
            }
        }
View Full Code Here

                } else if ("LeastConn".equalsIgnoreCase(lbMethod)) {
                    vserver.set_lbmethod("LEASTCONNECTION");
                } else if ("Proximity".equalsIgnoreCase(lbMethod)) {
                    vserver.set_lbmethod("RTT");
                } else {
                    throw new ExecutionException("Unsupported LB method");
                }
                vserver.set_persistencetype(persistenceType);
                if ("SOURCEIP".equalsIgnoreCase(persistenceType)) {
                    vserver.set_persistenceid(persistenceId);
                }
                vserver.set_servicetype(serviceType);
                vserver.set_state("ENABLED");
                vserver.set_cookietimeout(null);
                vserver.set_domainname(null);
                if (isUpdateSite) {
                    // both netmask and LB method can not be specified while update so set to null
                    vserver.set_netmask(null);
                    vserver.set_v6netmasklen(null);
                    gslbvserver.update(client, vserver);
                } else {
                    gslbvserver.add(client, vserver);
                }

                if (s_logger.isDebugEnabled()) {
                    s_logger.debug("Successfully added GSLB virtual server: " + vserverName);
                }

            } catch (Exception e) {
                String errMsg = "Failed to add GSLB virtual server: " + vserverName + " due to " + e.getMessage();
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug(errMsg);
                }
                throw new ExecutionException(errMsg);
            }
        }
View Full Code Here

            } catch (Exception e) {
                String errMsg = "Failed to delete GSLB virtual server: " + vserverName + " due to " + e.getMessage();
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug(errMsg);
                }
                throw new ExecutionException(errMsg);
            }
        }
View Full Code Here

            } catch (Exception e) {
                String errMsg = "Failed to enable GSLB virtual server: " + vserverName + " due to " + e.getMessage();
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug(errMsg);
                }
                throw new ExecutionException(errMsg);
            }
        }
View Full Code Here

            } catch (Exception e) {
                String errMsg =  "Failed to disable GSLB virtual server: " + vserverName + " due to " + e.getMessage();
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug(errMsg);
                }
                throw new ExecutionException(errMsg);
            }
        }
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.