~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupStore.java

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.hisp.dhis.organisationunit;
 
2
 
 
3
/*
 
4
 * Copyright (c) 2004-2007, University of Oslo
 
5
 * All rights reserved.
 
6
 *
 
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.
 
17
 *
 
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.
 
28
 */
 
29
 
 
30
import java.util.Collection;
 
31
 
 
32
/**
 
33
 * Defines methods for persisting OrganisationUnitGroups and
 
34
 * OrganisationUnitGroupSets.
 
35
 * 
 
36
 * @author Torgeir Lorange Ostby
 
37
 * @version $Id: OrganisationUnitGroupStore.java 3286 2007-05-07 18:05:21Z larshelg $
 
38
 */
 
39
public interface OrganisationUnitGroupStore
 
40
{
 
41
    String ID = OrganisationUnitGroupStore.class.getName();
 
42
 
 
43
    // -------------------------------------------------------------------------
 
44
    // OrganisationUnitGroup
 
45
    // -------------------------------------------------------------------------
 
46
 
 
47
    /**
 
48
     * Adds an OrganisationUnitGroup.
 
49
     * 
 
50
     * @param organisationUnitGroup the OrganisationUnitGroup to add.
 
51
     * @return a generated unique id of the added OrganisationUnitGroup.
 
52
     */
 
53
    int addOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup );
 
54
 
 
55
    /**
 
56
     * Updates an OrganisationUnitGroup.
 
57
     * 
 
58
     * @param organisationUnitGroup the OrganisationUnitGroup to update.
 
59
     */
 
60
    void updateOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup );
 
61
 
 
62
    /**
 
63
     * Deletes an OrganisationUnitGroup.
 
64
     * 
 
65
     * @param organisationUnitGroup the OrganisationUnitGroup to delete.
 
66
     */
 
67
    void deleteOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup );
 
68
 
 
69
    /**
 
70
     * Returns an OrganisationUnitGroup.
 
71
     * 
 
72
     * @param id the id of the OrganisationUnitGroup.
 
73
     * @return the OrganisationGroup with the given id, or null if no match.
 
74
     */
 
75
    OrganisationUnitGroup getOrganisationUnitGroup( int id );
 
76
 
 
77
    /**
 
78
     * Returns the OrganisationUnitGroup with the given UUID.
 
79
     * 
 
80
     * @param uuid the UUID of the OrganisationUnitGroup to return.
 
81
     * @return the OrganisationUnitGroup with the given UUID, or null if no match.
 
82
     */
 
83
    OrganisationUnitGroup getOrganisationUnitGroup( String uuid );
 
84
 
 
85
    /**
 
86
     * Returns an OrganisationUnitGroup with a given name.
 
87
     * 
 
88
     * @param name the name of the OrganisationUnitGroup.
 
89
     * @return the OrganisationUnitGroup with the given name, or null if no
 
90
     *         match.
 
91
     */
 
92
    OrganisationUnitGroup getOrganisationUnitGroupByName( String name );
 
93
 
 
94
    /**
 
95
     * Returns all OrganisationUnitGroups.
 
96
     * 
 
97
     * @return a collection of all the OrganisationUnitGroups, or an empty
 
98
     *         collection if no OrganisationUnitGroup exists.
 
99
     */
 
100
    Collection<OrganisationUnitGroup> getAllOrganisationUnitGroups();
 
101
 
 
102
    // -------------------------------------------------------------------------
 
103
    // OrganisationUnitGroupSet
 
104
    // -------------------------------------------------------------------------
 
105
 
 
106
    /**
 
107
     * Adds an OrganisationUnitGroupSet.
 
108
     * 
 
109
     * @param organisationUnitGroupSet the OrganisationUnitGroupSet to add.
 
110
     * @return the generated unique id of the added OrganisationUnitGroupSet.
 
111
     */
 
112
    int addOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet );
 
113
 
 
114
    /**
 
115
     * Updates an OrganisationUnitGroupSet.
 
116
     * 
 
117
     * @param organisationUnitGroupSet the OrganisationUnitGroupSet to update.
 
118
     */
 
119
    void updateOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet );
 
120
 
 
121
    /**
 
122
     * Deletes an OrganisationUnitGroupSet.
 
123
     * 
 
124
     * @param organisationUnitGroupSet the OrganisationUnitGroupSet to delete.
 
125
     */
 
126
    void deleteOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet );
 
127
 
 
128
    /**
 
129
     * Returns an OrganisationUnitGroupSet.
 
130
     * 
 
131
     * @param id the id of the OrganisationUnitGroupSet to return.
 
132
     * @return the OrganisationUnitGroupSet with the given id, or null if no
 
133
     *         match.
 
134
     */
 
135
    OrganisationUnitGroupSet getOrganisationUnitGroupSet( int id );
 
136
 
 
137
    /**
 
138
     * Returns an OrganisationUnitGroupSet with a given name.
 
139
     * 
 
140
     * @param name the name of the OrganisationUnitGroupSet to return.
 
141
     * @return the OrganisationUnitGroupSet with the given name, or null if no
 
142
     *         match.
 
143
     */
 
144
    OrganisationUnitGroupSet getOrganisationUnitGroupSetByName( String name );
 
145
 
 
146
    /**
 
147
     * Returns all OrganisationUnitGroupSets.
 
148
     * 
 
149
     * @return a collection of all OrganisationUnitGroupSets, or an empty
 
150
     *         collection if no OrganisationUnitGroupSet exists.
 
151
     */
 
152
    Collection<OrganisationUnitGroupSet> getAllOrganisationUnitGroupSets();
 
153
 
 
154
    /**
 
155
     * Returns all compulsory OrganisationUnitGroupSets.
 
156
     * 
 
157
     * @return a collection of all compulsory OrganisationUnitGroupSets, or an
 
158
     *         empty collection if there are no compulsory
 
159
     *         OrganisationUnitGroupSets.
 
160
     */
 
161
    Collection<OrganisationUnitGroupSet> getCompulsoryOrganisationUnitGroupSets();
 
162
 
 
163
    /**
 
164
     * Returns all exclusive OrganisationUnitGroupSets.
 
165
     * 
 
166
     * @return a collection of all exclusive OrganisationUnitGroupSets, or an
 
167
     *         empty collection if there are no exclusive
 
168
     *         OrganisationUnitGroupSets.
 
169
     */
 
170
    Collection<OrganisationUnitGroupSet> getExclusiveOrganisationUnitGroupSets();
 
171
}