View Javadoc
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 java.util.Collection;
37  import java.util.List;
38  
39  import fr.paris.lutece.plugins.mylutece.modules.wssodatabase.authentication.IdxWSSODatabaseUser;
40  import fr.paris.lutece.portal.service.plugin.Plugin;
41  import fr.paris.lutece.portal.service.security.LuteceAuthentication;
42  
43  
44  /**
45   * 
46   * @author Etienne
47   */
48  public interface IIdxWSSODatabaseDAO
49  {
50      /**
51       * Find users by guid
52       * 
53       * @param strGuid the WSSO guid
54       * @param plugin The Plugin using this data access service
55       * @param authenticationService the LuteceAuthentication object
56       * @return IdxWSSODatabaseUser the user corresponding to the guid
57       */
58      IdxWSSODatabaseUser findUserByGuid( String strGuid, Plugin plugin, LuteceAuthentication authenticationService );
59  
60      /**
61       * Find user's roles by guid
62       * 
63       * @param strGuid the WSSO guid
64       * @param plugin The Plugin using this data access service
65       * @param authenticationService the LuteceAuthentication object
66       * @return ArrayList the roles list corresponding to the guid
67       */
68      List<String> findUserRolesFromGuid( String strGuid, Plugin plugin, LuteceAuthentication authenticationService );
69  
70      /**
71       * Update the date of last login of a user
72       * @param strGuid The GUID of the user to update
73       * @param dateLastLogin The new last connection date
74       * @param plugin The plugin
75       */
76      void updateDateLastLogin( String strGuid, java.util.Date dateLastLogin, Plugin plugin );
77  
78      /**
79       * Find users list
80       * 
81       * @param plugin The Plugin using this data access service
82       * @param authenticationService the LuteceAuthentication object
83       * @return A Collection of users
84       */
85      Collection<IdxWSSODatabaseUser> findUsersList( Plugin plugin, LuteceAuthentication authenticationService );
86  
87      /**
88       * Find roles by a profil
89       * 
90       * @param codeProfil code of the profil
91       * @param plugin the current plugin
92       * @return the role list for the profil
93       */
94      List<String> findRolesFromProfil( String codeProfil, Plugin plugin );
95  
96      /**
97       * Remove roles fora profil
98       * 
99       * @param codeProfil code of the profil
100      * @param plugin the current plugin
101      */
102     void removeRolesForProfil( String codeProfil, Plugin plugin );
103 
104     /**
105      * Add role for a profil
106      * 
107      * @param codeProfil code of the profil
108      * @param codeRole code of the role
109      * @param plugin the current plugin
110      */
111     void addRoleForProfil( String codeProfil, String codeRole, Plugin plugin );
112 
113     /**
114      * Find users for a profil
115      * 
116      * @param codeProfil code of the profil
117      * @param plugin the current plugin
118      * @return the user list for the profil
119      */
120     List<WssoUser> findWssoUsersForProfil( String codeProfil, Plugin plugin );
121 
122     /**
123      * Add user for a profil
124      * 
125      * @param wssoUserId the user id
126      * @param codeProfil code of the profil
127      * @param plugin the current plugin
128      */
129     void addUserForProfil( int wssoUserId, String codeProfil, Plugin plugin );
130 
131     /**
132      * Remove user for a profil
133      * 
134      * @param wssoUserId the user id
135      * @param codeProfil code of the profil
136      * @param plugin the current plugin
137      */
138     void removeUserForProfil( int wssoUserId, String codeProfil, Plugin plugin );
139 
140     /**
141      * remove profils for a user
142      * 
143      * @param wssoUserId the user id
144      * @param plugin the current plugin
145      */
146     void removeProfilsForUser( int wssoUserId, Plugin plugin );
147 
148 }