Checkstyle enforcer
[controller.git] / opendaylight / samples / loadbalancer / src / main / java / org / opendaylight / controller / samples / loadbalancer / IConfigManager.java
1 /*
2  * Copyright IBM Corporation, 2013.  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 package org.opendaylight.controller.samples.loadbalancer;
9
10 import java.util.Set;
11
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;
15
16 /**
17  * Interface implemented by the configuration manager.
18  *
19  */
20 public interface IConfigManager {
21
22     /**
23      * Return all existing VIPs
24      * @return Set of VIP's
25      * if there is no VIP, it will return empty set.
26      */
27     public Set<VIP> getAllVIPs();
28
29     /**
30      * Check if VIP with the 'name' exists
31      * @param name  Name of the VIP
32      * @return  true    if exists
33      *                  false   else
34      */
35     public boolean vipExists(String name);
36
37     /**
38      * Check if VIP exists with the details 'VIP'
39      * @param vip Search for this VIP
40      * @return  true    if exists
41      *                  false   else
42      */
43     public boolean vipExists(VIP vip);
44
45     /**
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
53      *                  false   else
54      */
55     public boolean vipExists(String name,String ip,String protocol,short protocolPort,String poolName);
56
57     /**
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
65      */
66     public VIP createVIP(String name,String ip,String protocol,short protocolPort,String poolName);
67
68     /**
69      * Return pool attached to VIP
70      * @param name Name of the VIP
71      * @return  Name of the pool attached to VIP
72      *                  else null
73      */
74     public String getVIPAttachedPool(String name);
75     /**
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.
81      */
82     public VIP updateVIP(String name, String poolName);
83
84     /**
85      * Delete the VIP
86      * @param name  Delete VIP with this name
87      * @return  Details of the deleted VIP
88      */
89     public VIP deleteVIP(String name);
90
91     /**
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
96      *                  false   else
97      */
98     public boolean memberExists(String name, String poolName);
99
100     /**
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
106      *                  false   else
107      */
108     public boolean memberExists(String name, String memberIP,String poolName);
109
110     /**
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
114      *                  null                            else
115      *
116      */
117     public Set<PoolMember> getAllPoolMembers(String poolName);
118
119     /**
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
125      */
126     public PoolMember addPoolMember(String name, String memberIP, String poolName);
127
128     /**
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
133      */
134     public PoolMember removePoolMember(String name, String poolName);
135
136     /**
137      * Return all the existing pools
138      * @return  Set of Pools
139      */
140     public Set<Pool> getAllPools();
141
142     /**
143      * Return pool with input name
144      * @param poolName  Name of the pool
145      * @return  Details of the pool     if pool exist
146      *                  null                    else
147      */
148     public Pool getPool(String poolName);
149
150     /**
151      * Check if pool exists with the input name
152      * @param name  Name of the pool
153      * @return  true    If exists
154      *                  false   else
155      */
156     public boolean poolExists(String name);
157
158     /**
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
163      *                  false   else
164      */
165     public boolean poolExists(String name, String lbMethod);
166
167     /**
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
172      */
173     public Pool createPool(String name, String lbMethod);
174
175     /**
176      * Delete pool with the provided name
177      * @param poolName  Name of the pool
178      * @return  Details of the deleted pool
179      */
180     public Pool deletePool(String poolName);
181
182 }