// Copyright 2012 Citrix Systems, Inc. Licensed under the
// Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License. Citrix Systems, Inc.
// reserves all rights not expressly granted by the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.vm.dao;
import java.util.List;
import com.cloud.network.Network;
import com.cloud.network.router.VirtualRouter.Role;
import com.cloud.utils.db.GenericDao;
import com.cloud.vm.DomainRouterVO;
import com.cloud.vm.VirtualMachine.State;
/**
*
* DomainRouterDao implements
*/
public interface DomainRouterDao extends GenericDao<DomainRouterVO, Long> {
/**
* gets the DomainRouterVO by user id and data center
* @Param dcId data center Id.
* @return list of DomainRouterVO
*/
public List<DomainRouterVO> listByDataCenter(long dcId);
/**
* gets the DomainRouterVO by account id and data center
* @param account id of the user.
* @Param dcId data center Id.
* @return DomainRouterVO
*/
public List<DomainRouterVO> findBy(long accountId, long dcId);
/**
* gets the DomainRouterVO by user id.
* @param userId id of the user.
* @Param dcId data center Id.
* @return list of DomainRouterVO
*/
public List<DomainRouterVO> listBy(long userId);
/**
* list virtual machine routers by host id. pass in null to get all
* virtual machine routers.
* @param hostId id of the host. null if to get all.
* @return list of DomainRouterVO
*/
public List<DomainRouterVO> listByHostId(Long hostId);
public List<DomainRouterVO> listByLastHostId(Long hostId);
/**
* list virtual machine routers by host id.
* pass in null to get all
* virtual machine routers.
* @param hostId id of the host. null if to get all.
* @return list of DomainRouterVO
*/
public List<DomainRouterVO> listVirtualByHostId(Long hostId);
/**
* list virtual machine routers by host id. exclude destroyed, stopped, expunging VM,
* pass in null to get all
* virtual machine routers.
* @param hostId id of the host. null if to get all.
* @return list of DomainRouterVO
*/
public List<DomainRouterVO> listVirtualUpByHostId(Long hostId);
/**
* Find the list of domain routers for a domain
* @param id
* @return
*/
public List<DomainRouterVO> listByDomain(Long id);
List<DomainRouterVO> findBy(long accountId, long dcId, Role role);
List<DomainRouterVO> findByNetwork(long networkId);
List<DomainRouterVO> listActive(long networkId);
/**
* List domain routers by state and network type which reside on Host managed by the specified management server
* @return
*/
List<DomainRouterVO> listByStateAndNetworkType(State state, Network.GuestType type, long mgmtSrvrId);
List<DomainRouterVO> findByNetworkOutsideThePod(long networkId, long podId, State state, Role role);
List<DomainRouterVO> listByNetworkAndPodAndRole(long networkId, long podId, Role role);
List<DomainRouterVO> listByNetworkAndRole(long networkId, Role role);
List<DomainRouterVO> listByElementId(long elementId);
}