1 package org.opendaylight.affinity.nfchainagent;
3 import org.opendaylight.controller.sal.utils.NetUtils;
4 import java.io.Serializable;
5 import java.net.InetAddress;
6 import java.net.UnknownHostException;
8 import java.util.ArrayList;
10 import org.opendaylight.controller.sal.utils.Status;
11 import org.opendaylight.controller.sal.utils.StatusCode;
13 import javax.ws.rs.Consumes;
14 import javax.ws.rs.DELETE;
15 import javax.ws.rs.GET;
16 import javax.ws.rs.POST;
17 import javax.ws.rs.PUT;
18 import javax.ws.rs.Path;
19 import javax.ws.rs.PathParam;
20 import javax.ws.rs.Produces;
21 import javax.ws.rs.core.Context;
22 import javax.ws.rs.core.MediaType;
23 import javax.ws.rs.core.Response;
24 import javax.ws.rs.core.SecurityContext;
26 import org.codehaus.enunciate.jaxrs.ResponseCode;
27 import org.codehaus.enunciate.jaxrs.StatusCodes;
28 import org.codehaus.enunciate.jaxrs.TypeHint;
30 import javax.xml.bind.annotation.XmlAccessType;
31 import javax.xml.bind.annotation.XmlAccessorType;
32 import javax.xml.bind.annotation.XmlAttribute;
33 import javax.xml.bind.annotation.XmlElement;
34 import javax.xml.bind.annotation.XmlRootElement;
36 import org.opendaylight.controller.sal.flowprogrammer.Flow;
39 * Configuration object representing a network function chain.
40 * flowlist is the set of flows to be redirected.
41 * dstIP is the singleton waypoint, representing the waypoint server.
45 @XmlAccessorType(XmlAccessType.NONE)
46 public class NFchainconfig implements Cloneable, Serializable {
47 private static final long serialVersionUID = 1L;
52 private final List<Flow> flowlist;
53 private InetAddress dstIP;
55 public NFchainconfig(String name) {
57 flowlist = new ArrayList<Flow>();
61 // Set the flowlist and destination IP of the network function.
62 public NFchainconfig(String name, List<Flow> flowlist, InetAddress dstIP) {
64 this.flowlist = flowlist;
68 // add a flow to the flowlist.
69 public Status addFlow(Flow f) {
71 return new Status(StatusCode.SUCCESS);
74 public List<Flow> getFlowList() {
77 public InetAddress getWaypointIP() {
81 System.out.println("Printing NFchain config " + this.name);
82 for (Flow value : flowlist) {
83 System.out.println("flow is " + value);
86 public String getName() {