* Moved all l2 forwarding services based on OF to a separate OSGi
[affinity.git] / affinity / api / src / main / java / org / opendaylight / affinity / affinity / IAffinityManager.java
1 /*
2  * Copyright (c) 2013 Plexxi, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.affinity.affinity;
10
11 import java.net.InetAddress;
12 import java.util.ArrayList;
13 import java.util.List;
14 import java.util.Map;
15 import java.util.HashMap;
16 import java.util.concurrent.ConcurrentMap;
17 import java.util.Set;
18 import java.util.Collection;
19 import java.util.Map.Entry;
20
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;
27
28 import org.opendaylight.affinity.affinity.AffinityLink;
29
30 /**
31  * Interface to class for maintaining affinity configuration.
32  */
33 public interface IAffinityManager {
34
35     public Status addAffinityGroup(AffinityGroup ag);
36     public Status removeAffinityGroup(String name);
37     
38     public AffinityGroup getAffinityGroup(String name);
39     public List<AffinityGroup> getAllAffinityGroups();
40
41     public Status addAffinityLink(AffinityLink al);
42     public Status removeAffinityLink(AffinityLink al);
43     public Status removeAffinityLink(String linkName);
44
45     public AffinityLink getAffinityLink(String name);    
46     public List<AffinityLink> getAllAffinityLinks();
47
48     /* Save all configs to their respective files. */
49     public Status saveAffinityConfig();
50
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);
55
56     /** 
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.
60      */
61     public HashMap<String, List<Flow>>getAllFlowGroups();
62
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();
68
69     public List<Flow> getFlowlist(AffinityLink al);
70 }