1 /*
2 * Copyright (c) 2002-2014, Mairie de Paris
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright notice
10 * and the following disclaimer.
11 *
12 * 2. Redistributions in binary form must reproduce the above copyright notice
13 * and the following disclaimer in the documentation and/or other materials
14 * provided with the distribution.
15 *
16 * 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 *
32 * License 1.0
33 */
34 package fr.paris.lutece.plugins.mylutece.modules.wssodatabase.authentication.business;
35
36 import fr.paris.lutece.portal.service.plugin.Plugin;
37
38 import java.util.Collection;
39 import java.util.List;
40
41
42 /**
43 *
44 * @author Etienne
45 */
46 public interface IWssoUserDAO
47 {
48 /**
49 * Generates a new primary key
50 * @param plugin The Plugin using this data access service
51 * @return The new primary key
52 */
53 int newPrimaryKey( Plugin plugin );
54
55 /**
56 * Insert a new record in the table.
57 *
58 * @param wssoUser The wssoUser object
59 * @param plugin The Plugin using this data access service
60 */
61 void insert( WssoUser wssoUser, Plugin plugin );
62
63 /**
64 * Load the data of WssoUser from the table
65 *
66 * @param nWssoUserId The identifier of WssoUser
67 * @param plugin The Plugin using this data access service
68 * @return the instance of the WssoUser
69 */
70 WssoUser load( int nWssoUserId, Plugin plugin );
71
72 /**
73 * Delete a record from the table
74 * @param wssoUser The WssoUser object
75 * @param plugin The Plugin using this data access service
76 */
77 void delete( WssoUser wssoUser, Plugin plugin );
78
79 /**
80 * Update the record in the table
81 * @param wssoUser The reference of wssoUser
82 * @param plugin The Plugin using this data access service
83 */
84 void store( WssoUser wssoUser, Plugin plugin );
85
86 /**
87 * Load the list of wssoUsers
88 * @param plugin The Plugin using this data access service
89 * @return The Collection of the WssoUsers
90 */
91 Collection<WssoUser> selectWssoUserList( Plugin plugin );
92
93 /**
94 * Load the list of wssoUsers for a role
95 * @param nIdRole The role of WssoUser
96 * @param plugin The Plugin using this data access service
97 * @return The Collection of the WssoUsers
98 */
99 Collection selectWssoUsersListForRole( int nIdRole, Plugin plugin );
100
101 /**
102 * Load the list of wssoUser ids for a role
103 *
104 * @param strIdRole
105 * The role of WssoUser
106 * @param plugin
107 * The Plugin using this data access service
108 * @return The Collection of the WssoUser ids
109 */
110 List<Integer> selectWssoUserIdsListForRole( String strIdRole, Plugin plugin );
111
112 /**
113 * Load the list of wssoUsers for a guid
114 * @param strGuid The guid of WssoUser
115 * @param plugin The Plugin using this data access service
116 * @return The Collection of the WssoUsers
117 */
118 Collection selectWssoUserListForGuid( String strGuid, Plugin plugin );
119
120 /**
121 * Load the list of wssoUsers for a last name or first name and profil
122 *
123 * @param strLastName The guid of WssoUser
124 * @param codeProfil The Plugin using this data access service
125 * @param strFirstName the first name
126 * @param strEmail the email
127 * @param plugin the current plugin
128 * @return The Collection of the WssoUsers
129 */
130 List<WssoUser> findWssoUserssByLastNameOrFirtNameOrEmailByProfil( String codeProfil, String strLastName,
131 String strFirstName, String strEmail, Plugin plugin );
132
133 /**
134 * Load the list of wssoUsers for a last name or first name and profil
135 *
136 * @param strLastName The guid of WssoUser
137 * @param strFirstName the first name
138 * @param strEmail the email
139 * @param plugin the current plugin
140 * @return The Collection of the WssoUsers
141 */
142 List<WssoUser> findWssoUsersByLastNameOrFirstNameOrEmailByProfil( String strLastName, String strFirstName,
143 String strEmail, Plugin plugin );
144
145 /**
146 * Get the id of the user with this guid
147 *
148 * @param strGuid the guid
149 * @param plugin the current plugin
150 * @return the id of the user with this guid
151 */
152 int findDatabaseUserIdFromGuid( String strGuid, Plugin plugin );
153 }