|
| 1 | +// Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +// or more contributor license agreements. See the NOTICE file |
| 3 | +// distributed with this work for additional information |
| 4 | +// regarding copyright ownership. The ASF licenses this file |
| 5 | +// to you under the Apache License, Version 2.0 (the |
| 6 | +// "License"); you may not use this file except in compliance |
| 7 | +// with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +// Unless required by applicable law or agreed to in writing, |
| 12 | +// software distributed under the License is distributed on an |
| 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +// KIND, either express or implied. See the License for the |
| 15 | +// specific language governing permissions and limitations |
| 16 | +// under the License. |
| 17 | + |
| 18 | +package org.apache.cloudstack.vnf.dao; |
| 19 | + |
| 20 | +import com.cloud.utils.db.GenericDao; |
| 21 | +import org.apache.cloudstack.vnf.entity.VnfApplianceVO; |
| 22 | +import org.apache.cloudstack.vnf.entity.VnfApplianceVO.VnfState; |
| 23 | +import org.apache.cloudstack.vnf.entity.VnfApplianceVO.HealthStatus; |
| 24 | + |
| 25 | +import java.util.List; |
| 26 | + |
| 27 | +public interface VnfApplianceDao extends GenericDao<VnfApplianceVO, Long> { |
| 28 | + |
| 29 | + /** |
| 30 | + * Find appliance by UUID |
| 31 | + */ |
| 32 | + VnfApplianceVO findByUuid(String uuid); |
| 33 | + |
| 34 | + /** |
| 35 | + * Find appliance by network ID |
| 36 | + */ |
| 37 | + VnfApplianceVO findByNetworkId(Long networkId); |
| 38 | + |
| 39 | + /** |
| 40 | + * Find appliance by VM instance ID |
| 41 | + */ |
| 42 | + VnfApplianceVO findByVmInstanceId(Long vmInstanceId); |
| 43 | + |
| 44 | + /** |
| 45 | + * List all appliances for a template |
| 46 | + */ |
| 47 | + List<VnfApplianceVO> listByTemplateId(Long templateId); |
| 48 | + |
| 49 | + /** |
| 50 | + * List appliances by state |
| 51 | + */ |
| 52 | + List<VnfApplianceVO> listByState(VnfState state); |
| 53 | + |
| 54 | + /** |
| 55 | + * List appliances by health status |
| 56 | + */ |
| 57 | + List<VnfApplianceVO> listByHealthStatus(HealthStatus healthStatus); |
| 58 | + |
| 59 | + /** |
| 60 | + * List all active (non-removed) appliances |
| 61 | + */ |
| 62 | + List<VnfApplianceVO> listActive(); |
| 63 | + |
| 64 | + /** |
| 65 | + * Find appliances with stale last contact time (for health checks) |
| 66 | + */ |
| 67 | + List<VnfApplianceVO> listStaleContacts(int minutesStale); |
| 68 | +} |
0 commit comments