Package org.ggf.jsdl

Examples of org.ggf.jsdl.Exact_Type


        if (memory == null) {
            throw new CannotTranslateException("no memory request");
        }

        //TODO: support ranges and Exact_Type[]
        final Exact_Type exact_mem = memory.getExact(0);
        if (exact_mem == null) {
            throw new CannotTranslateException("no exact memory request");
        }

        // casting double
        return (int) exact_mem.get_value();
    }
View Full Code Here


            // -1 is the default value of CPU count in DefaultResourceAllocation.java
            return -1;
        }

        //TODO: support ranges and Exact_Type[]
        final Exact_Type exact_cores = cores.getExact(0);
        if (exact_cores == null) {
            throw new CannotTranslateException("no exact multi core CPU request");
        }

        // casting double
        return (int) exact_cores.get_value();
    }
View Full Code Here

        for (int i = 0; i < entries.length; i++) {

            final Entry entry = entries[i];

            //TODO: support ranges and Exact_Type[]
            final Exact_Type exact_blank =
                    entry.getIndividualDiskSpace().getExact(0);
            if (exact_blank == null) {
                throw new CannotTranslateException(
                        "missing blankspace space specification");
            }

            // casting double
            final int space = (int) exact_blank.get_value();

            final String blankPartitionName = entry.getPartitionName();
            if (blankPartitionName == null) {
                throw new CannotTranslateException(
                        "missing blankspace name");
View Full Code Here

        this.setCPU(ra, alloc);

        final int raMem = ra.getMemory();
        if (raMem > -1) {
            final Exact_Type ex = new Exact_Type(raMem);
            final Exact_Type[] exacts = {ex};
            alloc.setIndividualPhysicalMemory(
                    new RangeValue_Type(exacts,null,null,null));
        }

        final int raCpus = ra.getIndCpuCount();
        if (raCpus > -1) {
            final Exact_Type ex = new Exact_Type(raCpus);
            final Exact_Type[] exacts = {ex};
            alloc.setIndividualCPUCount(
                    new RangeValue_Type(exacts,null,null,null));
        }

        final int raCpuPercent = ra.getCpuPercentage();
        if (raCpuPercent > -1) {
            final Exact_Type ex = new Exact_Type(raCpuPercent);
            final Exact_Type[] exacts = {ex};
            alloc.setCPUPercentage(
                    new RangeValue_Type(exacts,null,null,null));
        }
View Full Code Here

        final int raSpeed = ra.getIndCpuSpeed();
       
        RangeValue_Type indCPUspeed = null;
        if (raSpeed > -1) {
            final Exact_Type ex = new Exact_Type(raSpeed);
            final Exact_Type[] exacts = {ex};
            indCPUspeed = new RangeValue_Type(exacts,null,null,null);
        }

        if (arch != null || indCPUspeed != null) {
View Full Code Here

        if (resAlloc == null) {
            throw new IllegalArgumentException("resAlloc may not be null");
        }

        final Exact_Type[] exactMemAlloc = {new Exact_Type(memoryMegabytes)};
        final RangeValue_Type memRange = new RangeValue_Type();
        memRange.setExact(exactMemAlloc);
        resAlloc.setIndividualPhysicalMemory(memRange);
    }
View Full Code Here

        // below 1 signals to use default which is picked by the target cloud (the old behavior)
        if (cores < 1) {
            return;
        }

        final Exact_Type[] exactCoresAlloc = {new Exact_Type(cores)};
        final RangeValue_Type coresRange = new RangeValue_Type();
        coresRange.setExact(exactCoresAlloc);
        resAlloc.setIndividualCPUCount(coresRange);
    }
View Full Code Here

        if (jsdlRange == null) {
            throw new IllegalArgumentException("jsdlRange may not be null");
        }

        //TODO: support ranges and Exact_Type[]
        final Exact_Type exact = jsdlRange.getExact(0);
        if (exact == null) {
            throw new IllegalArgumentException(
                                "jsdlRange may not be a range yet ;-)");
        }

        // casting double, possible precision loss
        final int val = (int) exact.get_value();
        this.min = val;
        this.max = val;
    }
View Full Code Here

TOP

Related Classes of org.ggf.jsdl.Exact_Type

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.