View Javadoc
1   /*
2    * Copyright (c) 2002-2017, 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.ldapdatabase.authentication.business;
35  
36  import fr.paris.lutece.portal.service.role.RoleRemovalListenerService;
37  
38  
39  /**
40   * This class represents the business object LdapUser
41   */
42  public class LdapUser
43  {
44      // Variables declarations
45      private static LdapUserRoleRemovalListener _listenerRole;
46      private int _nUserId;
47      private String _strLdapGuid;
48      private String _strLastName;
49      private String _strFirstName;
50      private String _strEmail;
51  
52      /**
53       * Initialize the LdapDatabaseUser
54       */
55      public static void init(  )
56      {
57          // Create removal listeners and register them
58          if ( _listenerRole == null )
59          {
60              _listenerRole = new LdapUserRoleRemovalListener(  );
61              RoleRemovalListenerService.getService(  ).registerListener( _listenerRole );
62          }
63      }
64  
65      /**
66       * Returns the UserId
67       *
68       * @return The UserId
69       */
70      public int getUserId(  )
71      {
72          return _nUserId;
73      }
74  
75      /**
76       * Sets the UserId
77       *
78       * @param nUserId The UserId
79       */
80      public void setUserId( int nUserId )
81      {
82          _nUserId = nUserId;
83      }
84  
85      /**
86       * Returns the Ldap Guid
87       *
88       * @return The Ldap Guid
89       */
90      public String getLdapGuid(  )
91      {
92          return _strLdapGuid;
93      }
94  
95      /**
96       * Sets the Ldap Guid
97       *
98       * @param strLdapGuid The Ldap Guid
99       */
100     public void setLdapGuid( String strLdapGuid )
101     {
102         _strLdapGuid = strLdapGuid;
103     }
104 
105     /**
106      * Returns the Email
107      *
108      * @return The Email
109      */
110     public String getEmail(  )
111     {
112         return _strEmail;
113     }
114 
115     /**
116      * Sets the Email
117      *
118      * @param strEmail The email
119      */
120     public void setEmail( String strEmail )
121     {
122         _strEmail = strEmail;
123     }
124 
125     /**
126      * Returns user first name
127      *
128      * @return The first name
129      */
130     public String getFirstName(  )
131     {
132         return _strFirstName;
133     }
134 
135     /**
136      * Sets the first name
137      *
138      * @param strFirstName The first name
139      */
140     public void setFirstName( String strFirstName )
141     {
142         _strFirstName = strFirstName;
143     }
144 
145     /**
146      * Returns the last name
147      *
148      * @return The last name
149      */
150     public String getLastName(  )
151     {
152         return _strLastName;
153     }
154 
155     /**
156      * Sets the last name
157      *
158      * @param strLastName The last name
159      */
160     public void setLastName( String strLastName )
161     {
162         _strLastName = strLastName;
163     }
164 }