class OpenStackParser {

    public String toOpenStackComputeState(ComputeState state)
                                                       throws OCCIException {
    	switch(state) {
	    	case ACTIVE:
	    		return OSSTATE_ACTIVE;
	    	case CANCEL:
	    		return OSSTATE_DELETED;
	    	case DONE:
	    		return OSSTATE_DELETED;
	    	case FAILED:
	    		return OSSTATE_ERROR;
	    	case HOLD:
	    		return OSSTATE_PAUSED;
	    	case INIT:
	    		return OSSTATE_BUILDING;
	    	case PENDING:
	    		return OSSTATE_BUILDING;
	    	case REBOOT:
	    		return OSSTATE_REBOOT;
	    	case RESET:
	    		return OSSTATE_REBUILD;
	    	case RESUME:
	    		return OSSTATE_ACTIVE;
	    	case SHUTDOWN:
	    		return OSSTATE_SHUTOFF;
	    	case STOPPED:
	    		return OSSTATE_STOPPED;
	    	case SUSPENDED:
	    		return OSSTATE_SUSPENDED;
	    	default:
	    		OCCIException exception = new OCCIException();
	            exception.setMessage(String.format(BADSTATE, state));
	            log.error(String.format(BADSTATE, state));
	            throw exception;
    	}
    }

}