Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting VNFFG #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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
Expand Down Expand Up @@ -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<NetworkForwardingPath> 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<VNFDConnectionPoint> connection_point;
Expand All @@ -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() {}

Expand All @@ -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;
}

Expand Down Expand Up @@ -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<NetworkForwardingPath> 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<NetworkForwardingPath> network_forwarding_path) {
this.network_forwarding_path = network_forwarding_path;
}

Expand Down Expand Up @@ -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;
}
}