propagate datastore exceptions all the way to northbound
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / INeutronLoadBalancerPoolCRUD.java
1 /*
2  * Copyright (C) 2014 Red Hat, Inc.  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.neutron.spi;
9
10 import java.util.List;
11 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
12 import org.opendaylight.yangtools.yang.common.OperationFailedException;
13
14 /**
15  * This interface defines the methods for CRUD of NB OpenStack LoadBalancerPool objects.
16  */
17 public interface INeutronLoadBalancerPoolCRUD extends INeutronCRUD<NeutronLoadBalancerPool> {
18
19     /**
20      * Applications call this interface method to determine if a particular
21      * NeutronLoadBalancerPoolMember object exists.
22      *
23      * @param poolUuid
24      *            UUID of the NeutronLoadBalancerPool object
25      * @param uuid
26      *            UUID of the NeutronLoadBalancerPoolMember object
27      * @return boolean
28      * @throws ReadFailedException if the read failed
29      */
30     boolean neutronLoadBalancerPoolMemberExists(String poolUuid, String uuid) throws ReadFailedException;
31
32     /**
33      * Applications call this interface method to return if a particular
34      * NeutronLoadBalancerPoolMember object exists.
35      *
36      * @param poolUuid
37      *            UUID of the NeutronLoadBalancerPool object
38      * @param uuid
39      *            UUID of the NeutronLoadBalancerPoolMember object
40      * @return {@link org.opendaylight.neutron.spi.NeutronLoadBalancerPoolMember}
41      *          OpenStackNeutronLoadBalancerPoolMember class
42      * @throws ReadFailedException if the read failed
43      */
44     NeutronLoadBalancerPoolMember getNeutronLoadBalancerPoolMember(String poolUuid, String uuid)
45             throws ReadFailedException;
46
47     /**
48      * Applications call this interface method to return all NeutronLoadBalancerPoolMember objects.
49      *
50      * @param poolUuid
51      *            UUID of the NeutronLoadBalancerPool object
52      * @return List of OpenStackNetworks objects
53      * @throws ReadFailedException if the read failed
54      */
55     List<NeutronLoadBalancerPoolMember> getAllNeutronLoadBalancerPoolMembers(String poolUuid)
56             throws ReadFailedException;
57
58     /**
59      * Applications call this interface method to add a NeutronLoadBalancerPoolMember object to the
60      * concurrent map.
61      *
62      * @param poolUuid
63      *            UUID of the NeutronLoadBalancerPool object
64      * @param input
65      *            OpenStackNetwork object
66      * @return boolean on whether the object was added or not
67      * @throws OperationFailedException if the read or write failed
68      */
69     boolean addNeutronLoadBalancerPoolMember(String poolUuid, NeutronLoadBalancerPoolMember input)
70             throws OperationFailedException;
71
72     /**
73      * Applications call this interface method to remove a Neutron NeutronLoadBalancerPoolMember object to the
74      * concurrent map.
75      *
76      * @param poolUuid
77      *            UUID of the NeutronLoadBalancerPool object
78      * @param uuid
79      *            identifier for the NeutronLoadBalancerPoolMember object
80      * @return boolean on whether the object was removed or not
81      * @throws OperationFailedException if the read or write failed
82      */
83     boolean removeNeutronLoadBalancerPoolMember(String poolUuid, String uuid) throws OperationFailedException;
84
85     /**
86      * Applications call this interface method to edit a NeutronLoadBalancerPoolMember object.
87      *
88      * @param poolUuid
89      *            identifier of the NeutronLoadBalancerPool object
90      * @param uuid
91      *            identifier of the NeutronLoadBalancerPoolMember object
92      * @param delta
93      *            OpenStackNeutronLoadBalancerPoolMember object containing changes to apply
94      * @return boolean on whether the object was updated or not
95      * @throws OperationFailedException if the read or write operation failed
96      */
97     boolean updateNeutronLoadBalancerPoolMember(String poolUuid, String uuid, NeutronLoadBalancerPoolMember delta)
98             throws OperationFailedException;
99
100     /**
101      * Applications call this interface method to see if a MAC address is in use.
102      *
103      * @param poolUuid
104      *            identifier of the NeutronLoadBalancerPool object
105      * @param uuid
106      *            identifier of the NeutronLoadBalancerPoolMember object
107      * @return boolean on whether the macAddress is already associated with a
108      *             port or not
109      * @throws ReadFailedException if the read operation failed
110      */
111     boolean neutronLoadBalancerPoolMemberInUse(String poolUuid, String uuid) throws ReadFailedException;
112 }