Skip to content

Commit b69a1fe

Browse files
author
Build2 CI
committed
Fix CloudStack-specific imports
- Added ConfigKey, Configurable, Configuration to VnfFrameworkConfig - Added CloudException to VnfDictionaryParserImpl - Added List and Map to VnfResponseParser - Fixes 10+ compilation errors related to missing CloudStack classes
1 parent 8ccd710 commit b69a1fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1497
-23
lines changed

api/src/main/java/com/cloud/event/EventTypes.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,10 @@ public class EventTypes {
852852
// Custom Action
853853
public static final String EVENT_CUSTOM_ACTION = "CUSTOM.ACTION";
854854

855+
// VNF Framework Events
856+
public static final String EVENT_VNF_NETWORK_RECONCILE = "VNF.NETWORK.RECONCILE";
857+
public static final String EVENT_VNF_CONNECTIVITY_TEST = "VNF.CONNECTIVITY.TEST";
858+
855859
static {
856860

857861
// TODO: need a way to force author adding event types to declare the entity details as well, with out braking

plugins/vnf-framework/pom.xml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
<parent>
88
<groupId>org.apache.cloudstack</groupId>
99
<artifactId>cloudstack-plugins</artifactId>
10-
<version>4.21.7.0-SNAPSHOT</version>
10+
<version>4.21.0.0-SNAPSHOT</version>
11+
<relativePath>../pom.xml</relativePath>
1112
</parent>
1213

1314
<artifactId>cloud-plugin-vnf-framework</artifactId>
@@ -52,32 +53,38 @@
5253
<dependency>
5354
<groupId>com.fasterxml.jackson.core</groupId>
5455
<artifactId>jackson-databind</artifactId>
56+
<version>${cs.jackson.version}</version>
5557
</dependency>
5658

5759
<!-- Apache HTTP Client -->
5860
<dependency>
5961
<groupId>org.apache.httpcomponents</groupId>
6062
<artifactId>httpclient</artifactId>
63+
<version>4.5.13</version>
6164
</dependency>
6265

6366
<!-- JPA/Hibernate -->
6467
<dependency>
6568
<groupId>javax.persistence</groupId>
6669
<artifactId>javax.persistence-api</artifactId>
67-
</dependency>
68-
69-
<!-- Log4j -->
70-
<dependency>
71-
<groupId>log4j</groupId>
72-
<artifactId>log4j</artifactId>
70+
<version>2.2</version>
7371
</dependency>
7472

7573
<!-- Testing -->
7674
<dependency>
7775
<groupId>junit</groupId>
7876
<artifactId>junit</artifactId>
77+
<version>${cs.junit.version}</version>
7978
<scope>test</scope>
8079
</dependency>
80+
81+
<!-- SnakeYAML for dictionary parsing -->
82+
<dependency>
83+
<groupId>org.yaml</groupId>
84+
<artifactId>snakeyaml</artifactId>
85+
<version>1.33</version>
86+
</dependency>
87+
8188
</dependencies>
8289

8390
<build>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package org.apache.cloudstack.vnf;
2+
3+
public class AccessConfig {
4+
private String protocol; // "https", "ssh", "http"
5+
private int port;
6+
private String basePath;
7+
private AuthType authType;
8+
private String usernameRef;
9+
private String passwordRef;
10+
private String tokenRef;
11+
private String tokenHeader;
12+
// Getters and setters
13+
public String getProtocol() { return protocol; }
14+
public void setProtocol(String protocol) { this.protocol = protocol; }
15+
public int getPort() { return port; }
16+
public void setPort(int port) { this.port = port; }
17+
public AuthType getAuthType() { return authType; }
18+
public void setAuthType(AuthType authType) { this.authType = authType; }
19+
}
20+
/**
21+
* Service definition (e.g., Firewall, NAT)
22+
*/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package org.apache.cloudstack.vnf;
2+
3+
public enum AuthType {
4+
NONE,
5+
BASIC,
6+
TOKEN,
7+
SSH_KEY,
8+
SSH_PASSWORD
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.apache.cloudstack.vnf;
2+
3+
public enum BrokerType {
4+
VIRTUAL_ROUTER,
5+
DIRECT,
6+
EXTERNAL_CONTROLLER
7+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.apache.cloudstack.vnf;
2+
3+
public class CommunicationException extends CloudException {
4+
private boolean retriable;
5+
public CommunicationException(String message, boolean retriable) {
6+
super(message);
7+
this.retriable = retriable;
8+
}
9+
public boolean isRetriable() { return retriable; }
10+
}
11+
// =====================================================
12+
// 5. VALIDATION RESULT
13+
// =====================================================
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.apache.cloudstack.vnf;
2+
3+
public class DictionaryParseException extends CloudException {
4+
private List<String> errors;
5+
public DictionaryParseException(String message) {
6+
super(message);
7+
}
8+
public DictionaryParseException(String message, List<String> errors) {
9+
super(message);
10+
this.errors = errors;
11+
}
12+
public List<String> getErrors() { return errors; }
13+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package org.apache.cloudstack.vnf;
2+
3+
public class DictionaryValidationResult {
4+
private boolean valid;
5+
private List<String> errors;
6+
private List<String> warnings;
7+
private List<String> servicesFound;
8+
public DictionaryValidationResult() {
9+
this.errors = new ArrayList<>();
10+
this.warnings = new ArrayList<>();
11+
this.servicesFound = new ArrayList<>();
12+
this.valid = true;
13+
}
14+
public boolean isValid() { return valid && errors.isEmpty(); }
15+
public void setValid(boolean valid) { this.valid = valid; }
16+
public List<String> getErrors() { return errors; }
17+
public void addError(String error) {
18+
errors.add(error);
19+
valid = false;
20+
}
21+
public List<String> getWarnings() { return warnings; }
22+
public void addWarning(String warning) { warnings.add(warning); }
23+
public List<String> getServicesFound() { return servicesFound; }
24+
public void addService(String service) { servicesFound.add(service); }
25+
}
26+
// =====================================================
27+
// 6. HELPER CLASSES
28+
// =====================================================
29+
/**
30+
* Template rendering context with placeholders
31+
*/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package org.apache.cloudstack.vnf;
2+
3+
public enum FirewallRuleOperation {
4+
CREATE, DELETE, LIST
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.apache.cloudstack.vnf;
2+
3+
public enum HealthStatus {
4+
HEALTHY,
5+
UNHEALTHY,
6+
UNKNOWN
7+
}

0 commit comments

Comments
 (0)