a88fc2e7c120fce99a45bec621fb155430ede768
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / INeutronCRUD.java
1 /*
2  * Copyright (c) 2015 Intel Corporation.  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
12 /**
13  * This interface defines the methods for CRUD of NB neutron objects.
14  */
15 public interface INeutronCRUD<T extends INeutronObject<T>> {
16
17     /**
18      * Applications call this interface method to determine if a particular
19      * Neutron object exists.
20      *
21      * @param uuid
22      *            UUID of the Neutron object
23      * @return boolean
24      */
25     boolean exists(String uuid);
26
27     /**
28      * Applications call this interface method to return if a particular
29      * Neutron object exists.
30      *
31      * @param uuid
32      *            UUID of the Neutron object
33      * @return {@link org.opendaylight.neutron.spi.INeutronObject}
34      *          OpenStack Neutron class
35      */
36     T get(String uuid);
37
38     /**
39      * Applications call this interface method to return all Neutron objects.
40      *
41      * @return List of OpenStackNeutrons objects
42      */
43     List<T> getAll();
44
45     /**
46      * Applications call this interface method to add a Neutron object to the
47      * concurrent map.
48      *
49      * @param input
50      *            OpenStackNeutron object
51      * @return boolean on whether the object was added or not
52      */
53     boolean add(T input);
54
55     /**
56      * Applications call this interface method to remove a Neutron object to the
57      * concurrent map.
58      *
59      * @param uuid
60      *            identifier for the neutron object
61      * @return boolean on whether the object was removed or not
62      */
63     boolean remove(String uuid);
64
65     /**
66      * Applications call this interface method to edit a Neutron object.
67      *
68      * @param uuid
69      *            identifier of the neutron object
70      * @param delta
71      *            OpenStackNeutron object containing changes to apply
72      * @return boolean on whether the object was updated or not
73      */
74     boolean update(String uuid, T delta);
75 }