Package org.nimbustools.api.repr

Examples of org.nimbustools.api.repr.CannotTranslateException


    }

    public String getInstanceType(VM vm) throws CannotTranslateException {

        if (vm == null) {
            throw new CannotTranslateException("vm is missing");
        }

        final ResourceAllocation ra = vm.getResourceAllocation();
        if (ra == null) {
            throw new CannotTranslateException("ra is missing");
        }

        return this.RAs.getMatchingName(vm, ra, this.networks.getManagerPublicNetworkName(), this.networks.getManagerPrivateNetworkName());
    }
View Full Code Here


    public InstanceStateType getState(VM vm)
            throws CannotTranslateException {

        if (vm == null) {
            throw new CannotTranslateException("vm is missing");
        }

        final State state = vm.getState();

        if (state == null) {
            throw new CannotTranslateException("state is missing");
        }

        final String mgrState = state.getState();
        if (mgrState == null) {
            throw new CannotTranslateException("state string is missing");
        }

        final InstanceStateType ist = new InstanceStateType();
        ist.setName(StateMap.managerStringToElasticString(mgrState));
        ist.setCode(StateMap.managerStringToElasticInt(mgrState));
View Full Code Here

    }

    public String getReason(VM vm) throws CannotTranslateException {

        if (vm == null) {
            throw new CannotTranslateException("vm is missing");
        }

        final State state = vm.getState();
        if (state == null) {
            throw new CannotTranslateException("vm.state is missing");
        }

        final Throwable t = state.getProblem();
        if (t == null) {
            return null;
View Full Code Here

                    final String elasticSingleID =
                            this.ids.managerInstanceToElasticReservation(vm.getID());
                   
                    if (elasticSingleID == null) {
                        throw new CannotTranslateException(e.getMessage(), e);
                    }
                }
            }
        }
View Full Code Here

            // before than this means it did not get created via the elastic
            // interface and there is no way it will have a key nickname.
            reservationID =
                    this.ids.getOrNewInstanceReservationID(vm.getID(), null);
        } catch (Exception e) {
            throw new CannotTranslateException(e.getMessage(), e);
        }

        if (seenKeys.add(reservationID)) {
            final List thisGroup = new LinkedList();
            thisGroup.add(vm);
            dict.put(reservationID, thisGroup);
        } else {
            throw new CannotTranslateException("should not have " +
                    "seen this reservation ID before: " + reservationID);
        }
    }
View Full Code Here

        final String reservationID;
        try {
            reservationID = this.ids.getOrNewGroupReservationID(groupid);
        } catch (Exception e) {
            throw new CannotTranslateException(e.getMessage(), e);
        }

        final List thisGroup;
        if (seenKeys.add(reservationID)) {
            thisGroup = new LinkedList();
View Full Code Here

    public String getMatchingName(VM vm, ResourceAllocation ra, String managerPublicNetwork, String managerPrivateNetwork)
            throws CannotTranslateException {

        if (ra == null) {
            throw new CannotTranslateException("RA is missing");
        }

        String publicNetwork = null;
        String privateNetwork = null;
View Full Code Here

        final _ResourceAllocation ra = this.repr._newResourceAllocation();
        ra.setNodeNumber(minNumNodes); // only respecting min at the moment

        if(spot && !cmpName.equals(siType)){
            throw new CannotTranslateException(
                    "Unsupported spot instance type: '" + name + "'." +
                        " Currently supported SI type: " + siType);           
        }
       
        Integer memory = getInstanceMemory(cmpName);
View Full Code Here

        } else if (cmpName.equals(this.getXlargeName())) {
            return this.xlargeMemory;
        } else if (cmpName.equals(this.getCustomName())) {
            return this.customMemory;
        } else {
            throw new CannotTranslateException(
                    "Unknown instance type '" + cmpName + "'");
        }
    }
View Full Code Here

        } else if (cmpName.equals(this.getXlargeName())) {
            return this.xlargeCPUs;
        } else if (cmpName.equals(this.getCustomName())) {
            return this.customCPUs;
        } else {
            throw new CannotTranslateException(
                    "Unknown instance type '" + cmpName + "'");
        }
    }
View Full Code Here

TOP

Related Classes of org.nimbustools.api.repr.CannotTranslateException

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.