Package org.nimbustools.api.repr.vm

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


     */
    protected String localHostname(String remoteAddress)
            throws MetadataServerException,
                   MetadataServerUnauthorizedException {

        final VM vm = this.getCachedAndValidatedVM(remoteAddress);
        final NIC nic = this.getLocalNIC(vm);
        if (nic != null) {
            final String hostname = nic.getHostname();
            if (hostname != null) {
                return hostname.trim();
View Full Code Here


     */
    protected String publicHostname(String remoteAddress)
            throws MetadataServerException,
                   MetadataServerUnauthorizedException {
       
        final VM vm = this.getCachedAndValidatedVM(remoteAddress);
        final NIC nic = this.getPublicNIC(vm);
        if (nic != null) {
            final String hostname = nic.getHostname();
            if (hostname != null) {
                return hostname.trim();
View Full Code Here

        final CreateResult result2 = rm.create(request2, caller);


        assertEquals(3, result2.getVMs().length);
        for (int i=0; i<result1.getVMs().length; i++) {
            final VM vm1 = result1.getVMs()[i];
            final VM vm2 = result2.getVMs()[i];

            assertEquals(vm1.getID(), vm2.getID());
            assertEquals(vm1.getClientToken(), vm2.getClientToken());
        }

        assertEquals(3, rm.getAllByCaller(caller).length);

View Full Code Here

    // INFORMATION QUERIES
    // -------------------------------------------------------------------------

    public CurrentState getCurrentState() {
        try {
            final VM vm = this.manager.getInstance(this.id);
            return this.translate.getCurrentState(vm);
        } catch (DoesNotExistException e) {
            logger.warn("no current-state for id '" + this.id + "': race on " +
                    "destruction between proxy object and the real system");
            return null;
View Full Code Here

        }
    }

    public Logistics getLogistics() {
        try {
            final VM vm = this.manager.getInstance(this.id);
            return this.translate.getLogistics(vm);
        } catch (DoesNotExistException e) {
            logger.warn("no current-state for id '" + this.id + "': race on " +
                    "destruction between proxy object and the real system");
            return null;
View Full Code Here

        }
    }

    public Schedule_Type getSchedule() {
        try {
            final VM vm = this.manager.getInstance(this.id);
            return this.translate.getSchedule_Type(vm);
        } catch (DoesNotExistException e) {
            logger.warn("no current-state for id '" + this.id + "': race on " +
                    "destruction between proxy object and the real system");
            return null;
View Full Code Here

        }
    }

    public ResourceAllocation_Type getResourceAllocation() {
        try {
            final VM vm = this.manager.getInstance(this.id);
            return this.translate.getResourceAllocation_Type(vm);
        } catch (DoesNotExistException e) {
            logger.warn("no current-state for id '" + this.id + "': race on " +
                    "destruction between proxy object and the real system");
            return null;
View Full Code Here

        if (vms == null || vms.length == 0) {
            throw new IllegalArgumentException("result has no VMs");
        }

        for (int i = 0; i < vms.length; i++) {
            final VM vm = vms[i];
            this.brokerHome.addWorkspace(ctxEPR,
                                         new Integer(vm.getID()),
                                         callerDN,
                                         this.translate.getWSnics(vm.getNics()),
                                         ctx);
        }

        if (lockCtx) {
            this.brokerHome.lockResource(ctxEPR);
View Full Code Here

       
        if (result != null) {
            final VM[] vms = result.getVMs();
            if (vms != null && vms.length > 0) {
                for (int i = 0; i < vms.length; i++) {
                    final VM vm = vms[i];
                    if (vm != null) {
                        _backout(vm, manager, caller);
                    }
                }
            }
View Full Code Here

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

            final String mgrInstanceID = managerInstances[i];

            try {
                final VM vm = manager.getInstance(mgrInstanceID);

                if (vm != null) {
                    final State state = vm.getState();
                    if (state != null) {
                        final String mgrState = state.getState();
                        final InstanceStateType ist = new InstanceStateType();
                        ist.setName(StateMap.managerStringToElasticString(mgrState));
                        ist.setCode(StateMap.managerStringToElasticInt(mgrState));
                        currentStates[i] = ist;
                    }
                }

            } catch (DoesNotExistException e) {
                currentStates[i] = null;
            } catch (ManageException e) {
                currentStates[i] = null;
                logger.error(e.getMessage());
            }
        }

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

            if (currentStates[i] == null) {
                continue;
            }

            final String mgrID = managerInstances[i];
            try {
                manager.trash(mgrID, Manager.INSTANCE, caller);
            } catch (DoesNotExistException e) {
                // do nothing, already accomplished
            } catch (ManageException e) {
                if (logger.isDebugEnabled()) {
                    logger.error(e.getMessage(), e);
                } else {
                    logger.error(e.getMessage());
                }
            }
        }


        final InstanceStateType terminated = new InstanceStateType();
        terminated.setCode(StateMap.STATE_TERMINATED.intValue());
        terminated.setName(StateMap.STATE_TERMINATED_STR);

        final InstanceStateType[] newStates =
                        new InstanceStateType[managerInstances.length];

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

            if (currentStates[i] == null) {
                continue;
            }

            final String mgrInstanceID = managerInstances[i];

            try {
                final VM vm = manager.getInstance(mgrInstanceID);

                if (vm != null) {
                    final State state = vm.getState();
                    if (state != null) {
                        final String mgrState = state.getState();
                        final InstanceStateType ist = new InstanceStateType();
                        ist.setName(StateMap.managerStringToElasticString(mgrState));
                        ist.setCode(StateMap.managerStringToElasticInt(mgrState));
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.