/**
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
*
* This software is licensed under the GNU General Public License v3 or later.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
*/
package com.cloud.host.dao;
import java.util.Date;
import java.util.List;
import com.cloud.host.Host;
import com.cloud.host.Host.Type;
import com.cloud.host.HostVO;
import com.cloud.host.Status;
import com.cloud.host.Status.Event;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.info.RunningHostCountInfo;
import com.cloud.resource.ResourceState;
import com.cloud.utils.db.GenericDao;
import com.cloud.utils.fsm.StateDao;
/**
* Data Access Object for server
*
*/
public interface HostDao extends GenericDao, StateDao {
long countBy(long clusterId, ResourceState... states);
/**
* Mark all hosts associated with a certain management server
* as disconnected.
*
* @param msId management server id.
*/
void markHostsAsDisconnected(long msId, long lastPing);
List findLostHosts(long timeout);
List findAndUpdateDirectAgentToLoad(long lastPingSecondsAfter, Long limit, long managementServerId);
List getRunningHostCounts(Date cutTime);
long getNextSequence(long hostId);
void loadDetails(HostVO host);
void saveDetails(HostVO host);
void loadHostTags(HostVO host);
List listByHostTag(Host.Type type, Long clusterId, Long podId, long dcId, String hostTag);
long countRoutingHostsByDataCenter(long dcId);
List findAndUpdateApplianceToLoad(long lastPingSecondsAfter, long managementServerId);
boolean updateResourceState(ResourceState oldState, ResourceState.Event event, ResourceState newState, Host vo);
HostVO findByGuid(String guid);
HostVO findByTypeNameAndZoneId(long zoneId, String name, Host.Type type);
}