2 * Copyright (c) 2013 Plexxi, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.affinity.affinity;
11 import java.net.InetAddress;
12 import java.util.ArrayList;
13 import java.util.List;
15 import java.util.HashMap;
16 import java.util.concurrent.ConcurrentMap;
18 import java.util.Collection;
19 import java.util.Map.Entry;
21 import org.opendaylight.controller.sal.core.Host;
22 import org.opendaylight.controller.sal.core.Node;
23 import org.opendaylight.controller.sal.core.NodeConnector;
24 import org.opendaylight.controller.sal.core.Property;
25 import org.opendaylight.controller.sal.utils.Status;
26 import org.opendaylight.controller.sal.flowprogrammer.Flow;
28 import org.opendaylight.affinity.affinity.AffinityLink;
31 * Interface to class for maintaining affinity configuration.
33 public interface IAffinityManager {
35 public Status addAffinityGroup(AffinityGroup ag);
36 public Status removeAffinityGroup(String name);
38 public AffinityGroup getAffinityGroup(String name);
39 public List<AffinityGroup> getAllAffinityGroups();
41 public Status addAffinityLink(AffinityLink al);
42 public Status removeAffinityLink(AffinityLink al);
43 public Status removeAffinityLink(String linkName);
45 public AffinityLink getAffinityLink(String name);
46 public List<AffinityLink> getAllAffinityLinks();
48 /* Save all configs to their respective files. */
49 public Status saveAffinityConfig();
51 public ArrayList<AffinityIdentifier> getAllElementsByAffinityIdentifier(AffinityGroup ag);
52 public List<Host> getAllElementsByHost(AffinityGroup ag);
53 public List<Entry<Host, Host>> getAllFlowsByHost(AffinityLink al);
54 public List<Entry<AffinityIdentifier, AffinityIdentifier>> getAllFlowsByAffinityIdentifier(AffinityLink al);
57 * Returns a map of groupname, derived from affinity link name, to
58 * the list of flow objects corresponding to that link. This
59 * should be a consistent snapshot of all configured objects.
61 public HashMap<String, List<Flow>>getAllFlowGroups();
63 // For each flowgroup, there is a list of attributes. This api
64 // call fetches this as a hashmap. Key of the outer hashmap is the
65 // name of the affinity link (aka flowgroup). Key for the inner
66 // hashmap is the affinity attribute type.
67 public HashMap<String, HashMap<AffinityAttributeType,AffinityAttribute>>getAllAttributes();
69 public List<Flow> getFlowlist(AffinityLink al);