2 * Copyright (c) 2015 Intel Corporation. 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.neutron.spi;
10 import java.util.List;
11 import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
14 * This interface defines the methods for CRUD of NB neutron objects.
16 public interface INeutronCRUD<T extends INeutronObject<T>> {
19 * Applications call this interface method to determine if a particular Neutron
22 * @param uuid UUID of the Neutron object
23 * @param tx the ReadTransaction within which to perform the check
26 boolean exists(String uuid, ReadTransaction tx);
29 * Applications call this interface method to return if a particular
30 * Neutron object exists.
33 * UUID of the Neutron object
34 * @return {@link org.opendaylight.neutron.spi.INeutronObject}
35 * OpenStack Neutron class
40 * Applications call this interface method to return all Neutron objects.
42 * @return List of OpenStackNeutrons objects
47 * Applications call this interface method to add a Neutron object to the
51 * OpenStackNeutron object
52 * @return result with indication on whether the object was added or not and if so why
57 * Applications call this interface method to remove a Neutron object to the
61 * identifier for the neutron object
62 * @return boolean on whether the object was removed or not
64 boolean remove(String uuid);
67 * Applications call this interface method to edit a Neutron object.
70 * identifier of the neutron object
72 * OpenStackNeutron object containing changes to apply
73 * @return boolean on whether the object was updated or not
75 boolean update(String uuid, T delta);
77 // TODO The Exception Result should eventually be replaced by propagating exceptions, and removed
78 enum Result { Success, AlreadyExists, DependencyMissing, Exception }