forked from apache/cloudstack
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathNicDao.java
More file actions
104 lines (66 loc) · 3.8 KB
/
NicDao.java
File metadata and controls
104 lines (66 loc) · 3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with 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.
package com.cloud.vm.dao;
import java.net.URI;
import java.util.List;
import com.cloud.utils.db.GenericDao;
import com.cloud.vm.NicVO;
import com.cloud.vm.VirtualMachine;
public interface NicDao extends GenericDao<NicVO, Long> {
List<NicVO> listByVmId(long instanceId);
List<NicVO> listByVmIdOrderByDeviceId(long instanceId);
List<String> listIpAddressInNetwork(long networkConfigId);
List<NicVO> listByVmIdIncludingRemoved(long instanceId);
List<NicVO> listByNetworkId(long networkId);
NicVO findByNtwkIdAndInstanceId(long networkId, long instanceId);
NicVO findByInstanceIdAndNetworkIdIncludingRemoved(long networkId, long instanceId);
NicVO findByNetworkIdTypeAndGateway(long networkId, VirtualMachine.Type vmType, String gateway);
void removeNicsForInstance(long instanceId);
NicVO findByNetworkIdAndType(long networkId, VirtualMachine.Type vmType);
NicVO findByNetworkIdAndTypeIncludingRemoved(long networkId, VirtualMachine.Type vmType);
NicVO findByIp4AddressAndNetworkId(String ip4Address, long networkId);
NicVO findByNetworkIdAndMacAddress(long networkId, String mac);
NicVO findDefaultNicForVM(long instanceId);
NicVO findFirstNicForVM(long instanceId);
/**
* @param networkId
* @param instanceId
* @return
*/
NicVO findNonReleasedByInstanceIdAndNetworkId(long networkId, long instanceId);
String getIpAddress(long networkId, long instanceId);
int getFreeDeviceId(long instanceId);
NicVO findByNetworkIdInstanceIdAndBroadcastUri(long networkId, long instanceId, String broadcastUri);
NicVO findByIp4AddressAndNetworkIdAndInstanceId(long networkId, long instanceId, String ip4Address);
List<NicVO> listByVmIdAndNicIdAndNtwkId(long vmId, Long nicId, Long networkId);
NicVO findByIp4AddressAndVmId(String ip4Address, long instance);
List<NicVO> listPlaceholderNicsByNetworkId(long networkId);
List<NicVO> listPlaceholderNicsByNetworkIdAndVmType(long networkId, VirtualMachine.Type vmType);
NicVO findByInstanceIdAndIpAddressAndVmtype(long instanceId, String ipaddress, VirtualMachine.Type type);
List<NicVO> listByNetworkIdTypeAndGatewayAndBroadcastUri(long networkId, VirtualMachine.Type vmType, String gateway, URI broadcastUri);
int countNicsForNonStoppedVms(long networkId);
int countNicsForNonStoppedRunningVrs(long networkId);
NicVO getControlNicForVM(long vmId);
Long getPeerRouterId(String publicMacAddress, long routerId);
List<NicVO> listByVmIdAndKeyword(long instanceId, String keyword);
NicVO findByMacAddress(String macAddress, long networkId);
NicVO findByNetworkIdAndMacAddressIncludingRemoved(long networkId, String mac);
List<NicVO> findNicsByIpv6GatewayIpv6CidrAndReserver(String ipv6Gateway, String ipv6Cidr, String reserverName);
NicVO findByIpAddressAndVmType(String ip, VirtualMachine.Type vmType);
List<NicVO> listByNetworkIdAndType(long networkId, VirtualMachine.Type vmType);
List<NicVO> searchRemovedByVms(List<Long> vmIds, Long batchSize);
}