2 * Copyright IBM Corporation, 2013. 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
8 package org.opendaylight.controller.samples.loadbalancer;
12 import org.opendaylight.controller.samples.loadbalancer.entities.Pool;
13 import org.opendaylight.controller.samples.loadbalancer.entities.PoolMember;
14 import org.opendaylight.controller.samples.loadbalancer.entities.VIP;
17 * Interface implemented by the configuration manager.
20 public interface IConfigManager {
23 * Return all existing VIPs
24 * @return Set of VIP's
25 * if there is no VIP, it will return empty set.
27 public Set<VIP> getAllVIPs();
30 * Check if VIP with the 'name' exists
31 * @param name Name of the VIP
32 * @return true if exists
35 public boolean vipExists(String name);
38 * Check if VIP exists with the details 'VIP'
39 * @param vip Search for this VIP
40 * @return true if exists
43 public boolean vipExists(VIP vip);
46 * Check if VIP with the provided details exists
47 * @param name Name of the VIP
48 * @param ip IP of the VIP
49 * @param protocol IP Protocol of the VIP (TCP/UDP)
50 * @param protocolPort Transport port of the VIP (e.g 5550)
51 * @param poolName Name of the pool attached with the VIP
52 * @return true if exists
55 public boolean vipExists(String name,String ip,String protocol,short protocolPort,String poolName);
58 * Add VIP to the configuration
59 * @param name Name of the VIP
60 * @param ip IP of the VIP
61 * @param protocol IP Protocol of the VIP (TCP/UDP)
62 * @param protocolPort Transport port of the VIP
63 * @param poolName Name of the pool that VIP will use for load balancing its traffic
64 * @return Newly created VIP
66 public VIP createVIP(String name,String ip,String protocol,short protocolPort,String poolName);
69 * Return pool attached to VIP
70 * @param name Name of the VIP
71 * @return Name of the pool attached to VIP
74 public String getVIPAttachedPool(String name);
76 * Update pool name of the VIP.
77 * @param name Name of the VIP
78 * @param poolName Attach this pool to VIP
79 * @return Updated VIP If successful
80 * null If this VIP is already attached to any existing pool.
82 public VIP updateVIP(String name, String poolName);
86 * @param name Delete VIP with this name
87 * @return Details of the deleted VIP
89 public VIP deleteVIP(String name);
92 * Check if pool member with the 'name' present in the pool with name 'poolName'
93 * @param name Name of the pool member
94 * @param poolName Name of the pool, you want to search for pool member
95 * @return true If exist
98 public boolean memberExists(String name, String poolName);
101 * Check if pool member with name 'name' and IP 'memberIP' exist in the pool 'poolName'
102 * @param name Name of the pool member
103 * @param memberIP IP of the pool member
104 * @param poolName Name of the pool member you want to search
105 * @return true If Exist
108 public boolean memberExists(String name, String memberIP,String poolName);
111 * Return all pool members of the pool 'poolName'
112 * @param poolName Name of the pool
113 * @return Set of all the pool members if pool with the name present in the configuration
117 public Set<PoolMember> getAllPoolMembers(String poolName);
120 * Add new pool member to the configuration
121 * @param name Name of the pool
122 * @param memberIP IP of the pool
123 * @param poolName Attach pool member to this pool
124 * @return Newly created pool member
126 public PoolMember addPoolMember(String name, String memberIP, String poolName);
129 * Remove pool member from the pool
130 * @param name Name of the pool member
131 * @param poolName Name of the pool
132 * @return Details of the removed pool member
134 public PoolMember removePoolMember(String name, String poolName);
137 * Return all the existing pools
138 * @return Set of Pools
140 public Set<Pool> getAllPools();
143 * Return pool with input name
144 * @param poolName Name of the pool
145 * @return Details of the pool if pool exist
148 public Pool getPool(String poolName);
151 * Check if pool exists with the input name
152 * @param name Name of the pool
153 * @return true If exists
156 public boolean poolExists(String name);
159 * Check if pool exists with the input name and loadbalancing method.
160 * @param name Name of the pool
161 * @param lbMethod Load balancing method name
162 * @return true If exists
165 public boolean poolExists(String name, String lbMethod);
168 * Create new pool with the provided details
169 * @param name Name of the pool
170 * @param lbMethod Load balancing method this pool will use
171 * @return Details of the newly created pool
173 public Pool createPool(String name, String lbMethod);
176 * Delete pool with the provided name
177 * @param poolName Name of the pool
178 * @return Details of the deleted pool
180 public Pool deletePool(String poolName);