import java.util.List;
import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.yangtools.yang.common.OperationFailedException;
/**
* This interface defines the methods for CRUD of NB neutron objects.
* @param uuid UUID of the Neutron object
* @param tx the ReadTransaction within which to perform the check
* @return boolean
+ * @throws ReadFailedException if the read failed
*/
- boolean exists(String uuid, ReadTransaction tx);
+ boolean exists(String uuid, ReadTransaction tx) throws ReadFailedException;
/**
* Applications call this interface method to return if a particular
* UUID of the Neutron object
* @return {@link org.opendaylight.neutron.spi.INeutronObject}
* OpenStack Neutron class
+ * @throws ReadFailedException if the read failed
*/
- T get(String uuid);
+ T get(String uuid) throws ReadFailedException;
/**
* Applications call this interface method to return all Neutron objects.
*
* @return List of OpenStackNeutrons objects
+ * @throws ReadFailedRuntimeException if the read failed
*/
- List<T> getAll();
+ List<T> getAll() throws ReadFailedRuntimeException;
/**
* Applications call this interface method to add a Neutron object to the
* @param input
* OpenStackNeutron object
* @return result with indication on whether the object was added or not and if so why
+ * @throws OperationFailedException if the write (or a required implicit read) failed
*/
- Result add(T input);
+ Result add(T input) throws OperationFailedException;
/**
* Applications call this interface method to remove a Neutron object to the
* @param uuid
* identifier for the neutron object
* @return boolean on whether the object was removed or not
+ * @throws OperationFailedException if the remove (or a required implicit read) failed
*/
- boolean remove(String uuid);
+ boolean remove(String uuid) throws OperationFailedException;
/**
* Applications call this interface method to edit a Neutron object.
* @param delta
* OpenStackNeutron object containing changes to apply
* @return boolean on whether the object was updated or not
+ * @throws OperationFailedException if the update (or a required implicit read) failed
*/
- Result update(String uuid, T delta);
+ Result update(String uuid, T delta) throws OperationFailedException;
- enum Result { Success, AlreadyExists, DoesNotExist, DependencyMissing, Exception }
- // TODO The Result "Exception" should eventually be replaced by propagating exceptions, and removed
+ enum Result { Success, AlreadyExists, DoesNotExist, DependencyMissing }
}