Package org.nimbustools.api.repr.vm

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


                    final StateChangeCallback scc =
                            (StateChangeCallback) this.stateListeners.get(i);
                   
                    if (scc != null) {
                        final State stateRepr = this.dataConvert.getState(this);
                        scc.newState(stateRepr);
                    }

                } catch (Throwable t) {
                    final String err = "Problem with asynchronous state " +
View Full Code Here


       
        if (vm == null) {
            throw new CannotTranslateException("vm may not be null");
        }

        final State state = vm.getState();
        if (state == null) {
            throw new CannotTranslateException("state may not be null");
        }


        final CurrentState_Enumeration stateEnum =
                (CurrentState_Enumeration) statusMap.get(state.getState());

        if (stateEnum == null) {
            throw new CannotTranslateException(
                    "do not recognize VM state '" + state.getState() + "'");
        }

        final CurrentState ret = new CurrentState();
        ret.setState(stateEnum);

        final Throwable t = state.getProblem();
        if (t != null) {
            ret.setWorkspaceFault(
                    InstanceUtil.makeWorkspaceFault(t.getMessage(), t));
        }
View Full Code Here

            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));
                        newStates[i] = ist;
                    }
View Full Code Here

        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();
View Full Code Here

        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;
        }
       
        final String msg = recurseForSomeString(t);
View Full Code Here

TOP

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

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.