From beca76e711731b6896bd36674a14a069e4c19c5c Mon Sep 17 00:00:00 2001 From: "Ahmed M. Medhat" Date: Fri, 28 Apr 2017 23:00:36 +0200 Subject: [PATCH] Supporting VNFFG --- .../descriptor/ACL_Matching_Criteria.java | 80 +++++++++++++++++++ .../catalogue/mano/descriptor/Policy.java | 18 +++++ .../VNFForwardingGraphDescriptor.java | 11 +++ .../mano/record/VNFForwardingGraphRecord.java | 36 ++++++--- 4 files changed, 136 insertions(+), 9 deletions(-) create mode 100755 catalogue/src/main/java/org/openbaton/catalogue/mano/descriptor/ACL_Matching_Criteria.java diff --git a/catalogue/src/main/java/org/openbaton/catalogue/mano/descriptor/ACL_Matching_Criteria.java b/catalogue/src/main/java/org/openbaton/catalogue/mano/descriptor/ACL_Matching_Criteria.java new file mode 100755 index 00000000..7e973061 --- /dev/null +++ b/catalogue/src/main/java/org/openbaton/catalogue/mano/descriptor/ACL_Matching_Criteria.java @@ -0,0 +1,80 @@ +package org.openbaton.catalogue.mano.descriptor; + +import java.io.Serializable; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.PrePersist; +import javax.persistence.Version; +import org.openbaton.catalogue.util.IdGenerator; + +/** Created by mah on 4/28/16. */ +@Entity +public class ACL_Matching_Criteria implements Serializable { + @Id private String id; + @Version private int version = 0; + + private String source_ip; + + private String destination_ip; + + private int source_port; + + private int destination_port; + + private int protocol; + + public ACL_Matching_Criteria() {} + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getSourceIP() { + return source_ip; + } + + public void setSourceIP(String src_ip) { + this.source_ip = src_ip; + } + + public String getDestinationIP() { + return destination_ip; + } + + public void setDestinationIP(String dest_ip) { + this.destination_ip = dest_ip; + } + + public int getSourcePort() { + return source_port; + } + + public void setSourcePort(int src_port) { + this.source_port = src_port; + } + + public int getDestinationPort() { + return destination_port; + } + + public void setDestinationPort(int dest_port) { + this.destination_port = dest_port; + } + + public int getProtocol() { + return protocol; + } + + public void setProtocol(int protocol) { + this.protocol = protocol; + } + + @PrePersist + public void ensureId() { + id = IdGenerator.createUUID(); + } +} diff --git a/catalogue/src/main/java/org/openbaton/catalogue/mano/descriptor/Policy.java b/catalogue/src/main/java/org/openbaton/catalogue/mano/descriptor/Policy.java index 78b91c92..7c4c81d3 100644 --- a/catalogue/src/main/java/org/openbaton/catalogue/mano/descriptor/Policy.java +++ b/catalogue/src/main/java/org/openbaton/catalogue/mano/descriptor/Policy.java @@ -36,6 +36,8 @@ public class Policy implements Serializable { @Id private String id; @Version private int version = 0; + private ACL_Matching_Criteria acl_matching_criteria; + private String qos_level; public Policy() {} @@ -51,4 +53,20 @@ public void setId(String id) { public void ensureId() { id = IdGenerator.createUUID(); } + + public ACL_Matching_Criteria getMatchingCriteria() { + return acl_matching_criteria; + } + + public void setMatchingCriteria(ACL_Matching_Criteria matching_criteria) { + this.acl_matching_criteria = matching_criteria; + } + + public String getQoSLevel() { + return qos_level; + } + + public void setQoSLevel(String qos) { + this.qos_level = qos; + } } diff --git a/catalogue/src/main/java/org/openbaton/catalogue/mano/descriptor/VNFForwardingGraphDescriptor.java b/catalogue/src/main/java/org/openbaton/catalogue/mano/descriptor/VNFForwardingGraphDescriptor.java index 3f01588a..97f4028c 100644 --- a/catalogue/src/main/java/org/openbaton/catalogue/mano/descriptor/VNFForwardingGraphDescriptor.java +++ b/catalogue/src/main/java/org/openbaton/catalogue/mano/descriptor/VNFForwardingGraphDescriptor.java @@ -44,6 +44,9 @@ public class VNFForwardingGraphDescriptor implements Serializable { * describing */ private String version; + /* * Specify the symmetricity of the VNFFG */ + private boolean symmetrical; + /** * Count of the external endpoints (connection_point elements) included in this VNFFG, to form an * index @@ -110,6 +113,14 @@ public void setVersion(String version) { this.version = version; } + public boolean isSymmetrical() { + return symmetrical; + } + + public void setSymmetricity(boolean sym) { + this.symmetrical = sym; + } + public int getNumber_of_endpoints() { return number_of_endpoints; } diff --git a/catalogue/src/main/java/org/openbaton/catalogue/mano/record/VNFForwardingGraphRecord.java b/catalogue/src/main/java/org/openbaton/catalogue/mano/record/VNFForwardingGraphRecord.java index fb0c8da4..53eb609d 100644 --- a/catalogue/src/main/java/org/openbaton/catalogue/mano/record/VNFForwardingGraphRecord.java +++ b/catalogue/src/main/java/org/openbaton/catalogue/mano/record/VNFForwardingGraphRecord.java @@ -23,7 +23,6 @@ import org.openbaton.catalogue.mano.common.LifecycleEvent; import org.openbaton.catalogue.mano.descriptor.NetworkForwardingPath; import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; -import org.openbaton.catalogue.mano.descriptor.VNFForwardingGraphDescriptor; import org.openbaton.catalogue.util.IdGenerator; /** @@ -35,8 +34,10 @@ public class VNFForwardingGraphRecord implements Serializable { @Id private String id; /** Record of the VNFFGD (vnffgd:id) used to instantiate this VNFFG */ - @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - private VNFForwardingGraphDescriptor descriptor_reference; + // @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + // private VNFForwardingGraphDescriptor descriptor_reference; + private String descriptor_reference; + /** * Reference to the record (nsr:id) for Network Service instance that this VNFFG instance is part * of @@ -64,8 +65,12 @@ public class VNFForwardingGraphRecord implements Serializable { * Set of Connection Points which form a Network Forwarding Path and description of policies to * establish and rules to choose the path */ - @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - private NetworkForwardingPath network_forwarding_path; + //@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + //private NetworkForwardingPath network_forwarding_path; + // should be Set as in the VNFFG Descriptor + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + private Set network_forwarding_path; + /** Reference to Connection Points (nsr/vnfr/pnfr:connection_point:id) forming the VNFFG */ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) private Set connection_point; @@ -80,6 +85,7 @@ public class VNFForwardingGraphRecord implements Serializable { private int number_of_vnfs; private int number_of_pnfs; private int number_of_virtual_links; + private boolean symmetrical; public VNFForwardingGraphRecord() {} @@ -96,11 +102,13 @@ public void setId(String id) { this.id = id; } - public VNFForwardingGraphDescriptor getDescriptor_reference() { + // public VNFForwardingGraphDescriptor getDescriptor_reference() { + public String getDescriptor_reference() { return descriptor_reference; } - public void setDescriptor_reference(VNFForwardingGraphDescriptor descriptor_reference) { + // public void setDescriptor_reference(VNFForwardingGraphDescriptor descriptor_reference) { + public void setDescriptor_reference(String descriptor_reference) { this.descriptor_reference = descriptor_reference; } @@ -152,11 +160,13 @@ public void setAudit_log(String audit_log) { this.audit_log = audit_log; } - public NetworkForwardingPath getNetwork_forwarding_path() { + //public NetworkForwardingPath getNetwork_forwarding_path() { + public Set getNetwork_forwarding_path() { return network_forwarding_path; } - public void setNetwork_forwarding_path(NetworkForwardingPath network_forwarding_path) { + // public void setNetwork_forwarding_path(NetworkForwardingPath network_forwarding_path) { + public void setNetwork_forwarding_path(Set network_forwarding_path) { this.network_forwarding_path = network_forwarding_path; } @@ -223,4 +233,12 @@ public int getNumber_of_virtual_links() { public void setNumber_of_virtual_links(int number_of_virtual_links) { this.number_of_virtual_links = number_of_virtual_links; } + + public boolean isSymmetrical() { + return symmetrical; + } + + public void setSymmetricity(boolean sym) { + this.symmetrical = sym; + } }