Skip to content

Commit e683408

Browse files
author
Build2 CI
committed
Create missing VnfOperationVO and VnfService interface
VnfOperationVO: - JPA entity for vnf_operations table - Tracks operation ID, rule ID, status, timestamps - Full getter/setter implementation VnfService interface: - findOperationByRuleId() method - listDictionaries(), uploadDictionary() - testConnectivity(), reconcileNetwork() - Fixes 20+ compilation errors
1 parent b69a1fe commit e683408

File tree

2 files changed

+138
-0
lines changed

2 files changed

+138
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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;
19+
20+
import org.apache.cloudstack.vnf.dao.VnfOperationVO;
21+
import com.cloud.exception.CloudException;
22+
import java.util.List;
23+
24+
public interface VnfService {
25+
26+
/**
27+
* Find VNF operation by rule ID
28+
*/
29+
VnfOperationVO findOperationByRuleId(String ruleId) throws CloudException;
30+
31+
/**
32+
* List all VNF dictionaries
33+
*/
34+
List<VnfDictionary> listDictionaries(Long zoneId);
35+
36+
/**
37+
* Upload VNF dictionary
38+
*/
39+
VnfDictionary uploadDictionary(String name, String content, Long zoneId) throws CloudException;
40+
41+
/**
42+
* Test VNF connectivity
43+
*/
44+
VnfConnectivityResult testConnectivity(Long applianceId) throws CloudException;
45+
46+
/**
47+
* Reconcile VNF network
48+
*/
49+
VnfReconciliationResult reconcileNetwork(Long networkId) throws CloudException;
50+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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 javax.persistence.Column;
21+
import javax.persistence.Entity;
22+
import javax.persistence.GeneratedValue;
23+
import javax.persistence.GenerationType;
24+
import javax.persistence.Id;
25+
import javax.persistence.Table;
26+
import java.util.Date;
27+
28+
@Entity
29+
@Table(name = "vnf_operations")
30+
public class VnfOperationVO {
31+
32+
@Id
33+
@GeneratedValue(strategy = GenerationType.IDENTITY)
34+
@Column(name = "id")
35+
private Long id;
36+
37+
@Column(name = "operation_id", nullable = false, unique = true)
38+
private String operationId;
39+
40+
@Column(name = "rule_id")
41+
private String ruleId;
42+
43+
@Column(name = "vnf_appliance_id")
44+
private Long vnfApplianceId;
45+
46+
@Column(name = "operation_type")
47+
private String operationType;
48+
49+
@Column(name = "status")
50+
private String status;
51+
52+
@Column(name = "created")
53+
private Date created;
54+
55+
@Column(name = "completed")
56+
private Date completed;
57+
58+
@Column(name = "error_message", length = 1024)
59+
private String errorMessage;
60+
61+
// Getters and Setters
62+
public Long getId() { return id; }
63+
public void setId(Long id) { this.id = id; }
64+
65+
public String getOperationId() { return operationId; }
66+
public void setOperationId(String operationId) { this.operationId = operationId; }
67+
68+
public String getRuleId() { return ruleId; }
69+
public void setRuleId(String ruleId) { this.ruleId = ruleId; }
70+
71+
public Long getVnfApplianceId() { return vnfApplianceId; }
72+
public void setVnfApplianceId(Long vnfApplianceId) { this.vnfApplianceId = vnfApplianceId; }
73+
74+
public String getOperationType() { return operationType; }
75+
public void setOperationType(String operationType) { this.operationType = operationType; }
76+
77+
public String getStatus() { return status; }
78+
public void setStatus(String status) { this.status = status; }
79+
80+
public Date getCreated() { return created; }
81+
public void setCreated(Date created) { this.created = created; }
82+
83+
public Date getCompleted() { return completed; }
84+
public void setCompleted(Date completed) { this.completed = completed; }
85+
86+
public String getErrorMessage() { return errorMessage; }
87+
public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; }
88+
}

0 commit comments

Comments
 (0)