Package org.nimbustools.api.repr.vm

Examples of org.nimbustools.api.repr.vm.VM


            buf.append("single VM '").append(vmidWhenJustOne);
        }
        buf.append("'.  Members:");

        for (int i = 0; i < vms.length; i++) {
            final VM vm = vms[i];
            final String id = vm.getID();
            if (id == null) {
                throw new CannotTranslateException("VM has no ID");
            }
            final String instID;
            if (vmidWhenJustOne != null) {
                // mapping already created:
                instID = this.ids.managerInstanceToElasticInstance(vmidWhenJustOne);
            } else {
                // this mapping may exist already, for secondary idempotent launches
                instID = this.ids.getOrNewInstanceID(vm.getID(), resID, sshKeyName);
            }

            if (i != 0) {
                buf.append(",");
            }
View Full Code Here


        }

        // add the VMs of interest
        final List newVMs = new LinkedList();
        for (int i = 0; i < vms.length; i++) {
            final VM vm = vms[i];
            if (vm == null) {
                logger.error("Manager implementation is invalid, received " +
                        "null VM in query response");
                continue; // *** GOTO NEXT VM ***
            }
            for (int j = 0; j < mgrIDs.length; j++) {
                final String id = mgrIDs[j];
                if (id != null && id.equals(vm.getID())) {
                    newVMs.add(vm);
                    break;
                }
            }
        }
View Full Code Here

                new RunningInstancesItemType[vms.size()];

        final Iterator iter = vms.iterator();
        int idx = 0;
        while (iter.hasNext()) {
            final VM vm = (VM) iter.next();
            final String elasticID;
            try {
                elasticID = this.ids.managerInstanceToElasticInstance(vm.getID());
            } catch (Exception e) {
                throw new CannotTranslateException(e.getMessage(), e);
            }
            riits[idx] = this.getInstanceItemType(vm, elasticID);
            idx += 1;
View Full Code Here

        final Set seenKeys = new HashSet();
        final Hashtable dict = new Hashtable();

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

            final VM vm = vms[i];
            if (vm == null) {
                logger.error("Manager implementation is invalid, received " +
                        "null VM in query response");
                continue; // *** GOTO NEXT VM ***
            }
           
            final String groupid = vm.getGroupID();

            if (groupid == null) {
                this._newNoGroupID(vm, seenKeys, dict);
            } else {
                this._newGroupReservation(vm, groupid, seenKeys, dict);
            }
        }

        // look at all VMs to make sure they have elastic instance IDs,
        // they will not if they were created via other protocols and have
        // never shown up to this messaging layer before

        final Iterator iter = dict.keySet().iterator();
        while (iter.hasNext()) {
            final String elasticReservationID = (String) iter.next();
            final List group = (List) dict.get(elasticReservationID);
            final Iterator groupiter = group.iterator();
            while (groupiter.hasNext()) {
                final VM vm = (VM) groupiter.next();
                try {
                    this.ids.checkInstanceAndReservation(vm.getID(),
                                                         elasticReservationID);
                } catch (Exception e) {

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

TOP

Related Classes of org.nimbustools.api.repr.vm.VM

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.