Package com.cloud.resource

Examples of com.cloud.resource.ResourceState


    @Override
    public boolean agentStatusTransitTo(HostVO host, Status.Event e, long msId) {
        try {
            _agentStatusLock.lock();
            if (status_logger.isDebugEnabled()) {
                ResourceState state = host.getResourceState();
                StringBuilder msg = new StringBuilder("Transition:");
                msg.append("[Resource state = ").append(state);
                msg.append(", Agent event = ").append(e.toString());
                msg.append(", Host id = ").append(host.getId()).append(", name = " + host.getName()).append("]");
                status_logger.debug(msg);
View Full Code Here


        assertFalse(b);
    }

    @Test
    public void testGetResourceState() {
        ResourceState r = host.getResourceState();
        assertTrue(r == ResourceState.Enabled);
    }
View Full Code Here

                for (Long agentId : behindAgents) {
                  SearchCriteriaService<HostVO, HostVO> sc = SearchCriteria2.create(HostVO.class);
                  sc.addAnd(sc.getEntity().getId(), Op.EQ, agentId);
                  HostVO h = sc.find();
                    if (h != null) {
                        ResourceState resourceState = h.getResourceState();
                        if (resourceState == ResourceState.Disabled || resourceState == ResourceState.Maintenance
                                || resourceState == ResourceState.ErrorInMaintenance) {
                            /*
                             * Host is in non-operation state, so no
                             * investigation and direct put agent to
View Full Code Here

    @Override
    public boolean agentStatusTransitTo(HostVO host, Status.Event e, long msId) {
    try {
      _agentStatusLock.lock();
      if (status_logger.isDebugEnabled()) {
        ResourceState state = host.getResourceState();
        StringBuilder msg = new StringBuilder("Transition:");
        msg.append("[Resource state = ").append(state);
        msg.append(", Agent event = ").append(e.toString());
        msg.append(", Host id = ").append(host.getId()).append(", name = " + host.getName()).append("]");
        status_logger.debug(msg);
View Full Code Here

    @Override
    public boolean agentStatusTransitTo(HostVO host, Status.Event e, long msId) {
        try {
            _agentStatusLock.lock();
            if (status_logger.isDebugEnabled()) {
                ResourceState state = host.getResourceState();
                StringBuilder msg = new StringBuilder("Transition:");
                msg.append("[Resource state = ").append(state);
                msg.append(", Agent event = ").append(e.toString());
                msg.append(", Host id = ").append(host.getId()).append(", name = " + host.getName()).append("]");
                status_logger.debug(msg);
View Full Code Here

        assertFalse(b);
    }

    @Test
    public void testGetResourceState() {
        ResourceState r = host.getResourceState();
        assertTrue(r == ResourceState.Enabled);
    }
View Full Code Here

                List<Long> behindAgents = findAgentsBehindOnPing();
                for (Long agentId : behindAgents) {
                  SearchCriteriaService<HostVO, HostVO> sc = SearchCriteria2.create(HostVO.class);
                  sc.addAnd(sc.getEntity().getId(), Op.EQ, agentId);
                  HostVO h = sc.find();
                  ResourceState resourceState = h.getResourceState();
                  if (resourceState == ResourceState.Disabled || resourceState == ResourceState.Maintenance || resourceState == ResourceState.ErrorInMaintenance) {
                    /* Host is in non-operation state, so no investigation and direct put agent to Disconnected */
                    status_Logger.debug("Ping timeout but host " + agentId + " is in resource state of " + resourceState + ", so no investigation");
                    _agentMgr.disconnectWithoutInvestigation(agentId, Event.ShutdownRequested);
                  } else {
View Full Code Here

    @Override
    public boolean agentStatusTransitTo(HostVO host, Status.Event e, long msId) {
    try {
      _agentStatusLock.lock();
      if (status_logger.isDebugEnabled()) {
        ResourceState state = host.getResourceState();
        StringBuilder msg = new StringBuilder("Transition:");
        msg.append("[Resource state = ").append(state);
        msg.append(", Agent event = ").append(e.toString());
        msg.append(", Host id = ").append(host.getId()).append(", name = " + host.getName()).append("]");
        status_logger.debug(msg);
View Full Code Here

                for (Long agentId : behindAgents) {
                    QueryBuilder<HostVO> sc = QueryBuilder.create(HostVO.class);
                    sc.and(sc.entity().getId(), Op.EQ, agentId);
                    HostVO h = sc.find();
                    if (h != null) {
                        ResourceState resourceState = h.getResourceState();
                        if (resourceState == ResourceState.Disabled || resourceState == ResourceState.Maintenance || resourceState == ResourceState.ErrorInMaintenance) {
                            /*
                             * Host is in non-operation state, so no
                             * investigation and direct put agent to
                             * Disconnected
 
View Full Code Here

    @Override
    public boolean agentStatusTransitTo(HostVO host, Status.Event e, long msId) {
        try {
            _agentStatusLock.lock();
            if (status_logger.isDebugEnabled()) {
                ResourceState state = host.getResourceState();
                StringBuilder msg = new StringBuilder("Transition:");
                msg.append("[Resource state = ").append(state);
                msg.append(", Agent event = ").append(e.toString());
                msg.append(", Host id = ").append(host.getId()).append(", name = " + host.getName()).append("]");
                status_logger.debug(msg);
View Full Code Here

TOP

Related Classes of com.cloud.resource.ResourceState

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.