com.stratelia.webactiv.organization
Class UserTable

java.lang.Object
  extended by com.stratelia.webactiv.organization.Table<UserRow>
      extended by com.stratelia.webactiv.organization.UserTable

public class UserTable
extends Table<UserRow>

A UserTable object manages the ST_User table.


Constructor Summary
UserTable(OrganizationSchema schema)
           
 
Method Summary
 void createUser(UserRow user)
          Inserts in the database a new user row.
protected  UserRow fetchRow(ResultSet rs)
          Fetch the current user row from a resultSet.
protected  UserRow fetchUser(ResultSet rs)
          Fetch the current user row from a resultSet.
 String[] getAllAdminIds(UserDetail fromUser)
          Returns all the Admin ids.
 String[] getAllUserIds()
          Returns all the User ids.
 UserRow[] getAllUserOfDomain(int domainId)
          Returns all the Users having a given domain id.
 UserRow[] getAllUsers()
          Returns all the Users.
 String[] getDirectUserIdsOfGroup(int groupId)
          Returns all the User ids which compose a group.
 String[] getDirectUserIdsOfGroupUserRole(int groupUserRoleId)
          Returns all the User ids having directly a given group userRole.
 String[] getDirectUserIdsOfSpaceUserRole(int spaceUserRoleId)
          Returns all the User ids having directly a given space userRole.
 String[] getDirectUserIdsOfUserRole(int userRoleId)
          Returns all the User ids having directly a given role.
 UserRow[] getDirectUsersOfGroup(int groupId)
          Returns all the Users which compose a group.
 UserRow[] getDirectUsersOfGroupUserRole(int groupUserRoleId)
          Returns all the Users having directly a given group userRole.
 UserRow getUser(int id)
          Returns the User whith the given id.
 UserRow getUserByLogin(int domainId, String login)
          Returns the User with the given domainId and login.
 UserRow getUserBySpecificId(int domainId, String specificId)
          Returns the User with the given specificId and login.
 String[] getUserIdsByAccessLevel(UserAccessLevel accessLevel)
          Returns all the User ids.
 String[] getUserIdsOfDomain(int domainId)
          Returns all the User ids having a given domain id.
 String[] getUserIdsOfDomainByAccessLevel(int domainId, UserAccessLevel accessLevel)
          Returns all the User ids for the specified domain and access level.
 int getUserNumber()
          Returns the User number
 int getUserNumberOfDomain(int domainId)
           
 UserRow[] getUsersByEmail(String email)
          Returns the users whose fields match those of the given sample space fields.
 UserRow[] getUsersBySpecificIds(int domainId, List<String> specificIds)
          Returns the User with the given specificId and login.
protected  void prepareInsert(String insertQuery, PreparedStatement insert, UserRow row)
          Set all the parameters of the insert PreparedStatement built from the insertQuery in order to insert the given row.
protected  void prepareUpdate(String updateQuery, PreparedStatement update, UserRow row)
          Set all the parameters of the update PreparedStatement built from the updateQuery in order to update the given row.
 void removeUser(int id)
          Removes a user row.
 UserRow[] searchUsers(UserRow userModel, boolean isAnd)
          Returns all the Users satisfying the model.
 String[] searchUsersIds(List<String> userIds, UserRow userModel)
          Returns all user ids satisfying the model.
 void updateUser(UserRow user)
          Update a user row.
 
Methods inherited from class com.stratelia.webactiv.organization.Table
addIdToQuery, addParamToQuery, addParamToQuery, addParamToQuery, aliasColumns, getCount, getCount, getIds, getIds, getIds, getIds, getInteger, getInteger, getMatchingRows, getNextId, getRows, getRows, getRows, getRows, getUniqueRow, getUniqueRow, getUniqueRow, insertRow, performPrepareStatementParams, truncate, updateRelation, updateRelation, updateRelation, updateRow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserTable

public UserTable(OrganizationSchema schema)
Method Detail

fetchUser

protected UserRow fetchUser(ResultSet rs)
                     throws SQLException
Fetch the current user row from a resultSet.

Parameters:
rs -
Returns:
Throws:
SQLException

getUserNumberOfDomain

public int getUserNumberOfDomain(int domainId)
                          throws AdminPersistenceException
Throws:
AdminPersistenceException

getUserNumber

public int getUserNumber()
                  throws AdminPersistenceException
Returns the User number

Returns:
the User number
Throws:
AdminPersistenceException

getUser

public UserRow getUser(int id)
                throws AdminPersistenceException
Returns the User whith the given id.

Parameters:
id -
Returns:
the User whith the given id.
Throws:
AdminPersistenceException

getUserBySpecificId

public UserRow getUserBySpecificId(int domainId,
                                   String specificId)
                            throws AdminPersistenceException
Returns the User with the given specificId and login.

Parameters:
domainId -
specificId -
Returns:
the User with the given specificId and login.
Throws:
AdminPersistenceException

getUsersBySpecificIds

public UserRow[] getUsersBySpecificIds(int domainId,
                                       List<String> specificIds)
                                throws AdminPersistenceException
Returns the User with the given specificId and login.

Parameters:
domainId -
specificIds -
Returns:
Throws:
AdminPersistenceException

getUserByLogin

public UserRow getUserByLogin(int domainId,
                              String login)
                       throws AdminPersistenceException
Returns the User with the given domainId and login.

Parameters:
domainId -
login -
Returns:
the User with the given domainId and login.
Throws:
AdminPersistenceException

getAllUsers

public UserRow[] getAllUsers()
                      throws AdminPersistenceException
Returns all the Users.

Returns:
all the users.
Throws:
AdminPersistenceException

getAllUserIds

public String[] getAllUserIds()
                       throws AdminPersistenceException
Returns all the User ids.

Returns:
all the User ids.
Throws:
AdminPersistenceException

getAllAdminIds

public String[] getAllAdminIds(UserDetail fromUser)
                        throws AdminPersistenceException
Returns all the Admin ids.

Parameters:
fromUser -
Returns:
all the Admin ids.
Throws:
AdminPersistenceException

getUserIdsByAccessLevel

public String[] getUserIdsByAccessLevel(UserAccessLevel accessLevel)
                                 throws AdminPersistenceException
Returns all the User ids.

Parameters:
accessLevel -
Returns:
all the User ids.
Throws:
AdminPersistenceException

getUserIdsOfDomainByAccessLevel

public String[] getUserIdsOfDomainByAccessLevel(int domainId,
                                                UserAccessLevel accessLevel)
                                         throws AdminPersistenceException
Returns all the User ids for the specified domain and access level.

Parameters:
domainId -
accessLevel -
Returns:
all the User ids for the specified domain and access level.
Throws:
AdminPersistenceException

getDirectUsersOfGroup

public UserRow[] getDirectUsersOfGroup(int groupId)
                                throws AdminPersistenceException
Returns all the Users which compose a group.

Parameters:
groupId -
Returns:
all the Users which compose a group.
Throws:
AdminPersistenceException

getDirectUserIdsOfGroup

public String[] getDirectUserIdsOfGroup(int groupId)
                                 throws AdminPersistenceException
Returns all the User ids which compose a group.

Parameters:
groupId -
Returns:
all the User ids which compose a group.
Throws:
AdminPersistenceException

getDirectUserIdsOfUserRole

public String[] getDirectUserIdsOfUserRole(int userRoleId)
                                    throws AdminPersistenceException
Returns all the User ids having directly a given role.

Parameters:
userRoleId -
Returns:
all the User ids having directly a given role.
Throws:
AdminPersistenceException

getAllUserOfDomain

public UserRow[] getAllUserOfDomain(int domainId)
                             throws AdminPersistenceException
Returns all the Users having a given domain id.

Parameters:
domainId -
Returns:
all the Users having a given domain id.
Throws:
AdminPersistenceException

getUserIdsOfDomain

public String[] getUserIdsOfDomain(int domainId)
                            throws AdminPersistenceException
Returns all the User ids having a given domain id.

Parameters:
domainId -
Returns:
all the User ids having a given domain id.
Throws:
AdminPersistenceException

getDirectUserIdsOfSpaceUserRole

public String[] getDirectUserIdsOfSpaceUserRole(int spaceUserRoleId)
                                         throws AdminPersistenceException
Returns all the User ids having directly a given space userRole.

Parameters:
spaceUserRoleId -
Returns:
all the User ids having directly a given space userRole.
Throws:
AdminPersistenceException

getDirectUsersOfGroupUserRole

public UserRow[] getDirectUsersOfGroupUserRole(int groupUserRoleId)
                                        throws AdminPersistenceException
Returns all the Users having directly a given group userRole.

Parameters:
groupUserRoleId -
Returns:
all the Users having directly a given group userRole.
Throws:
AdminPersistenceException

getDirectUserIdsOfGroupUserRole

public String[] getDirectUserIdsOfGroupUserRole(int groupUserRoleId)
                                         throws AdminPersistenceException
Returns all the User ids having directly a given group userRole.

Parameters:
groupUserRoleId -
Returns:
all the User ids having directly a given group userRole.
Throws:
AdminPersistenceException

searchUsersIds

public String[] searchUsersIds(List<String> userIds,
                               UserRow userModel)
                        throws AdminPersistenceException
Returns all user ids satisfying the model.

Parameters:
userIds -
userModel -
Returns:
Throws:
AdminPersistenceException

searchUsers

public UserRow[] searchUsers(UserRow userModel,
                             boolean isAnd)
                      throws AdminPersistenceException
Returns all the Users satisfying the model.

Parameters:
userModel -
isAnd -
Returns:
all the Users satisfying the model.
Throws:
AdminPersistenceException

getUsersByEmail

public UserRow[] getUsersByEmail(String email)
                          throws AdminPersistenceException
Returns the users whose fields match those of the given sample space fields.

Parameters:
email -
Returns:
the users whose fields match those of the given sample space fields.
Throws:
AdminPersistenceException

createUser

public void createUser(UserRow user)
                throws AdminPersistenceException
Inserts in the database a new user row.

Parameters:
user -
Throws:
AdminPersistenceException

prepareInsert

protected void prepareInsert(String insertQuery,
                             PreparedStatement insert,
                             UserRow row)
                      throws SQLException
Description copied from class: Table
Set all the parameters of the insert PreparedStatement built from the insertQuery in order to insert the given row.

Specified by:
prepareInsert in class Table<UserRow>
Throws:
SQLException

updateUser

public void updateUser(UserRow user)
                throws AdminPersistenceException
Update a user row.

Parameters:
user -
Throws:
AdminPersistenceException

prepareUpdate

protected void prepareUpdate(String updateQuery,
                             PreparedStatement update,
                             UserRow row)
                      throws SQLException
Description copied from class: Table
Set all the parameters of the update PreparedStatement built from the updateQuery in order to update the given row.

Specified by:
prepareUpdate in class Table<UserRow>
Throws:
SQLException

removeUser

public void removeUser(int id)
                throws AdminPersistenceException
Removes a user row.

Parameters:
id -
Throws:
AdminPersistenceException

fetchRow

protected UserRow fetchRow(ResultSet rs)
                    throws SQLException
Fetch the current user row from a resultSet.

Specified by:
fetchRow in class Table<UserRow>
Returns:
Throws:
SQLException


Copyright © 2016 Silverpeas. All Rights Reserved.