1
package org.hisp.dhis.organisationunit;
4
* Copyright (c) 2004-2007, University of Oslo
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions are met:
9
* * Redistributions of source code must retain the above copyright notice, this
10
* list of conditions and the following disclaimer.
11
* * Redistributions in binary form must reproduce the above copyright notice,
12
* this list of conditions and the following disclaimer in the documentation
13
* and/or other materials provided with the distribution.
14
* * Neither the name of the HISP project nor the names of its contributors may
15
* be used to endorse or promote products derived from this software without
16
* specific prior written permission.
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
import java.util.Collection;
33
* Defines methods for persisting OrganisationUnitGroups and
34
* OrganisationUnitGroupSets.
36
* @author Torgeir Lorange Ostby
37
* @version $Id: OrganisationUnitGroupStore.java 3286 2007-05-07 18:05:21Z larshelg $
39
public interface OrganisationUnitGroupStore
41
String ID = OrganisationUnitGroupStore.class.getName();
43
// -------------------------------------------------------------------------
44
// OrganisationUnitGroup
45
// -------------------------------------------------------------------------
48
* Adds an OrganisationUnitGroup.
50
* @param organisationUnitGroup the OrganisationUnitGroup to add.
51
* @return a generated unique id of the added OrganisationUnitGroup.
53
int addOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup );
56
* Updates an OrganisationUnitGroup.
58
* @param organisationUnitGroup the OrganisationUnitGroup to update.
60
void updateOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup );
63
* Deletes an OrganisationUnitGroup.
65
* @param organisationUnitGroup the OrganisationUnitGroup to delete.
67
void deleteOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup );
70
* Returns an OrganisationUnitGroup.
72
* @param id the id of the OrganisationUnitGroup.
73
* @return the OrganisationGroup with the given id, or null if no match.
75
OrganisationUnitGroup getOrganisationUnitGroup( int id );
78
* Returns the OrganisationUnitGroup with the given UUID.
80
* @param uuid the UUID of the OrganisationUnitGroup to return.
81
* @return the OrganisationUnitGroup with the given UUID, or null if no match.
83
OrganisationUnitGroup getOrganisationUnitGroup( String uuid );
86
* Returns an OrganisationUnitGroup with a given name.
88
* @param name the name of the OrganisationUnitGroup.
89
* @return the OrganisationUnitGroup with the given name, or null if no
92
OrganisationUnitGroup getOrganisationUnitGroupByName( String name );
95
* Returns all OrganisationUnitGroups.
97
* @return a collection of all the OrganisationUnitGroups, or an empty
98
* collection if no OrganisationUnitGroup exists.
100
Collection<OrganisationUnitGroup> getAllOrganisationUnitGroups();
102
// -------------------------------------------------------------------------
103
// OrganisationUnitGroupSet
104
// -------------------------------------------------------------------------
107
* Adds an OrganisationUnitGroupSet.
109
* @param organisationUnitGroupSet the OrganisationUnitGroupSet to add.
110
* @return the generated unique id of the added OrganisationUnitGroupSet.
112
int addOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet );
115
* Updates an OrganisationUnitGroupSet.
117
* @param organisationUnitGroupSet the OrganisationUnitGroupSet to update.
119
void updateOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet );
122
* Deletes an OrganisationUnitGroupSet.
124
* @param organisationUnitGroupSet the OrganisationUnitGroupSet to delete.
126
void deleteOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet );
129
* Returns an OrganisationUnitGroupSet.
131
* @param id the id of the OrganisationUnitGroupSet to return.
132
* @return the OrganisationUnitGroupSet with the given id, or null if no
135
OrganisationUnitGroupSet getOrganisationUnitGroupSet( int id );
138
* Returns an OrganisationUnitGroupSet with a given name.
140
* @param name the name of the OrganisationUnitGroupSet to return.
141
* @return the OrganisationUnitGroupSet with the given name, or null if no
144
OrganisationUnitGroupSet getOrganisationUnitGroupSetByName( String name );
147
* Returns all OrganisationUnitGroupSets.
149
* @return a collection of all OrganisationUnitGroupSets, or an empty
150
* collection if no OrganisationUnitGroupSet exists.
152
Collection<OrganisationUnitGroupSet> getAllOrganisationUnitGroupSets();
155
* Returns all compulsory OrganisationUnitGroupSets.
157
* @return a collection of all compulsory OrganisationUnitGroupSets, or an
158
* empty collection if there are no compulsory
159
* OrganisationUnitGroupSets.
161
Collection<OrganisationUnitGroupSet> getCompulsoryOrganisationUnitGroupSets();
164
* Returns all exclusive OrganisationUnitGroupSets.
166
* @return a collection of all exclusive OrganisationUnitGroupSets, or an
167
* empty collection if there are no exclusive
168
* OrganisationUnitGroupSets.
170
Collection<OrganisationUnitGroupSet> getExclusiveOrganisationUnitGroupSets();