Examples of HypervisorPluginException


Examples of com.abiquo.hypervisor.plugin.exception.HypervisorPluginException

        if (plugin == null)
        {
            LOG.error(
                "Trying to get the connection instance for the non supported hypervisor type {}",
                type);
            throw new HypervisorPluginException(HypervisorPluginError.THURMAN0, "Hypervisor type "
                + type);
        }

        try
        {
            return plugin.connectionClass.newInstance();
        }
        catch (Exception e)
        {
            LOG.error("Unable to create new plugin instance hypervisor type {}", type);
            throw new HypervisorPluginException(HypervisorPluginError.PLUGIN_NEW_INSTANCE_ERROR,
                "Hypervisor type " + type);
        }
    }
View Full Code Here

Examples of com.abiquo.hypervisor.plugin.exception.HypervisorPluginException

        throws HypervisorPluginException
    {
        List<ResolvedType> rt = typeResolver.resolve(hclass).typeParametersFor(IHypervisor.class);
        if (rt == null || 1 != rt.size())
        {
            throw new HypervisorPluginException(HypervisorPluginError.THURMAN0, hclass.toString());
        }

        return (Class<IHypervisorConnection>) rt.get(0).getErasedType();
    }
View Full Code Here

Examples of com.abiquo.hypervisor.plugin.exception.HypervisorPluginException

        if (virtualMachineDefinition.getPrimaryDisk().isStateful())
        {
            if (!supportedTypes.contains(virtualMachineDefinition.getPrimaryDisk()
                .getDiskStateful().getType()))
            {
                throw new HypervisorPluginException(HypervisorPluginError.VIRTUALMACHINE_DEFINITION_VALIDATION_ERROR,
                    "All external disks must be of one of the following types: "
                        + Joiner.on(',').join(supportedTypes));
            }
        }

        boolean unsupportedSecondaries =
            any(virtualMachineDefinition.getSecondaryDisks().getStatefulDisks(),
                new Predicate<SecondaryDiskStateful>()
                {
                    @Override
                    public boolean apply(final SecondaryDiskStateful input)
                    {
                        return !supportedTypes.contains(input.getType());
                    }

                });

        if (unsupportedSecondaries)
        {
            throw new HypervisorPluginException(HypervisorPluginError.VIRTUALMACHINE_DEFINITION_VALIDATION_ERROR,
                "All external disks must be of one of the following types: "
                    + Joiner.on(',').join(supportedTypes));
        }
    }
View Full Code Here

Examples of com.abiquo.hypervisor.plugin.exception.HypervisorPluginException

        Optional<LoadedPlugin> plugin = plugins.tryGet(type);
        if (!plugin.isPresent())
        {
            LOG.error("Trying to get the connection instance for the non supported plugin type {}",
                type);
            throw new HypervisorPluginException(HypervisorPluginError.THURMAN0, "Plugin type "
                + type);
        }

        try
        {
            return plugin.get().connectionClass.newInstance();
        }
        catch (Exception e)
        {
            LOG.error("Unable to create new plugin instance plugin type {}", type);

            throw new HypervisorPluginException(HypervisorPluginError.PLUGIN_NEW_INSTANCE_ERROR,
                "Plugin type " + type);
        }
    }
View Full Code Here

Examples of com.abiquo.hypervisor.plugin.exception.HypervisorPluginException

        throws HypervisorPluginException
    {
        List<ResolvedType> rt = typeResolver.resolve(hclass).typeParametersFor(ICompute.class);
        if (rt == null || rt.size() != 1)
        {
            throw new HypervisorPluginException(HypervisorPluginError.THURMAN0, hclass.toString());
        }
        return (Class<IConnection>) rt.get(0).getErasedType();
    }
View Full Code Here

Examples of com.abiquo.hypervisor.plugin.exception.HypervisorPluginException

        if (virtualMachineDefinition.getPrimaryDisk().isStateful())
        {
            if (!supportedTypes.contains(virtualMachineDefinition.getPrimaryDisk()
                .getDiskStateful().getType()))
            {
                throw new HypervisorPluginException(HypervisorPluginError.VIRTUALMACHINE_DEFINITION_VALIDATION_ERROR,
                    "All external disks must be of one of the following types: "
                        + Joiner.on(',').join(supportedTypes));
            }
        }

        boolean unsupportedSecondaries =
            any(virtualMachineDefinition.getSecondaryDisks().getStatefulDisks(),
                new Predicate<SecondaryDiskStateful>()
                {
                    @Override
                    public boolean apply(final SecondaryDiskStateful input)
                    {
                        return !supportedTypes.contains(input.getType());
                    }

                });

        if (unsupportedSecondaries)
        {
            throw new HypervisorPluginException(HypervisorPluginError.VIRTUALMACHINE_DEFINITION_VALIDATION_ERROR,
                "All external disks must be of one of the following types: "
                    + Joiner.on(',').join(supportedTypes));
        }
    }
View Full Code Here

Examples of com.abiquo.hypervisor.plugin.exception.HypervisorPluginException

    public static void checkVirtualNicsNotEmpty(
        final VirtualMachineDefinition virtualMachineDefinition) throws HypervisorPluginException
    {
        if (isEmpty(virtualMachineDefinition.getNetworkConfiguration().getVirtualNICs()))
        {
            throw new HypervisorPluginException(HypervisorPluginError.VIRTUAL_MACHINE_AT_LEAST_ONE_NIC_SHOULD_BE_LINKED);
        }
    }
View Full Code Here

Examples of com.abiquo.hypervisor.plugin.exception.HypervisorPluginException

    public static void checkCoresPerSocketNotSet(
        final VirtualMachineDefinition virtualMachineDefinition) throws HypervisorPluginException
    {
        if (virtualMachineDefinition.getHardwareConfiguration().getCoresPerSocket() != null)
        {
            throw new HypervisorPluginException(HypervisorPluginError.CORES_PER_SOCKET_UNSUPPORTED);
        }
    }
View Full Code Here

Examples of com.abiquo.hypervisor.plugin.exception.HypervisorPluginException

        Optional<LoadedPlugin> plugin = plugins.tryGet(type);
        if (!plugin.isPresent())
        {
            LOG.error("Trying to get the connection instance for the non supported plugin type {}",
                type);
            throw new HypervisorPluginException(HypervisorPluginError.THURMAN0, "Plugin type "
                + type);
        }

        try
        {
            return plugin.get().connectionClass.newInstance();
        }
        catch (Exception e)
        {
            LOG.error("Unable to create new plugin instance plugin type {}", type);

            throw new HypervisorPluginException(HypervisorPluginError.PLUGIN_NEW_INSTANCE_ERROR,
                "Plugin type " + type);
        }
    }
View Full Code Here

Examples of com.abiquo.hypervisor.plugin.exception.HypervisorPluginException

        throws HypervisorPluginException
    {
        List<ResolvedType> rt = typeResolver.resolve(hclass).typeParametersFor(ICompute.class);
        if (rt == null || rt.size() != 1)
        {
            throw new HypervisorPluginException(HypervisorPluginError.THURMAN0, hclass.toString());
        }
        return (Class<IConnection>) rt.get(0).getErasedType();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.