com.stratelia.webactiv.organization
Class SpaceUserRoleTable

java.lang.Object
  extended by com.stratelia.webactiv.organization.Table<SpaceUserRoleRow>
      extended by com.stratelia.webactiv.organization.SpaceUserRoleTable

public class SpaceUserRoleTable
extends Table<SpaceUserRoleRow>

A SpaceUserRoleTable object manages the ST_SpaceUserRole table.


Constructor Summary
SpaceUserRoleTable(OrganizationSchema organization)
           
 
Method Summary
 void addGroupInSpaceUserRole(int groupId, int spaceUserRoleId)
          Adds a group in a spaceUserRole.
 void addUserInSpaceUserRole(int userId, int spaceUserRoleId)
          Add an user in a spaceUserRole.
 void createSpaceUserRole(SpaceUserRoleRow spaceUserRole)
          Inserts in the database a new spaceUserRole row.
protected  SpaceUserRoleRow fetchRow(ResultSet rs)
          Fetch the current spaceUserRole row from a resultSet.
protected  SpaceUserRoleRow fetchSpaceUserRole(ResultSet rs)
          Fetch the current spaceUserRole row from a resultSet.
 SpaceUserRoleRow[] getAllMatchingSpaceUserRoles(SpaceUserRoleRow sampleSpaceUserRole)
          Returns the SpaceUserRole whose fields match those of the given sample SpaceUserRole fields.
 String[] getAllSpaceUserRoleIdsOfSpace(int spaceId)
          Returns all the SpaceUserRole ids of a space.
 SpaceUserRoleRow[] getAllSpaceUserRoles()
          Returns all the SpaceUserRoles.
 SpaceUserRoleRow[] getAllSpaceUserRolesOfSpace(int spaceId)
          Returns all the SpaceUserRoles of a space.
 SpaceUserRoleRow[] getDirectSpaceUserRolesOfGroup(int groupId)
          Returns all the direct SpaceUserRoles of a group.
 SpaceUserRoleRow[] getDirectSpaceUserRolesOfUser(int userId)
          Returns all the direct SpaceUserRoles of user.
 SpaceUserRoleRow getSpaceUserRole(int id)
          Returns the SpaceUserRole whith the given id.
 SpaceUserRoleRow getSpaceUserRole(int spaceId, String roleName, int inherited)
          Returns the SpaceUserRole whith the given RoleName in the given space.
 boolean isGroupDirectlyInRole(int groupId, int spaceUserRoleId)
          Tests if a group has a given role (not recursive).
 boolean isUserDirectlyInRole(int userId, int spaceUserRoleId)
          Tests if a user has a given role (not recursive).
protected  void prepareInsert(String insertQuery, PreparedStatement insert, SpaceUserRoleRow 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, SpaceUserRoleRow row)
          Set all the parameters of the update PreparedStatement built from the updateQuery in order to update the given row.
 void removeAllGroupsFromSpaceUserRole(int spaceUserRoleId)
          Removes all groups from a spaceUserRole.
 void removeAllUsersFromSpaceUserRole(int spaceUserRoleId)
          Removes all users from a spaceUserRole.
 void removeGroupFromSpaceUserRole(int groupId, int spaceUserRoleId)
          Removes a group from a spaceUserRole.
 void removeSpaceUserRole(int id)
          Delete the spaceUserRole
 void removeUserFromSpaceUserRole(int userId, int spaceUserRoleId)
          Removes an user from a spaceUserRole.
 void updateSpaceUserRole(SpaceUserRoleRow spaceUserRole)
          Updates a spaceUserRole
 
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

SpaceUserRoleTable

public SpaceUserRoleTable(OrganizationSchema organization)
Method Detail

fetchSpaceUserRole

protected SpaceUserRoleRow fetchSpaceUserRole(ResultSet rs)
                                       throws SQLException
Fetch the current spaceUserRole row from a resultSet.

Throws:
SQLException

getSpaceUserRole

public SpaceUserRoleRow getSpaceUserRole(int id)
                                  throws AdminPersistenceException
Returns the SpaceUserRole whith the given id.

Throws:
AdminPersistenceException

getSpaceUserRole

public SpaceUserRoleRow getSpaceUserRole(int spaceId,
                                         String roleName,
                                         int inherited)
                                  throws AdminPersistenceException
Returns the SpaceUserRole whith the given RoleName in the given space.

Throws:
AdminPersistenceException

getAllSpaceUserRoles

public SpaceUserRoleRow[] getAllSpaceUserRoles()
                                        throws AdminPersistenceException
Returns all the SpaceUserRoles.

Throws:
AdminPersistenceException

getAllSpaceUserRolesOfSpace

public SpaceUserRoleRow[] getAllSpaceUserRolesOfSpace(int spaceId)
                                               throws AdminPersistenceException
Returns all the SpaceUserRoles of a space.

Throws:
AdminPersistenceException

getAllSpaceUserRoleIdsOfSpace

public String[] getAllSpaceUserRoleIdsOfSpace(int spaceId)
                                       throws AdminPersistenceException
Returns all the SpaceUserRole ids of a space.

Throws:
AdminPersistenceException

getDirectSpaceUserRolesOfUser

public SpaceUserRoleRow[] getDirectSpaceUserRolesOfUser(int userId)
                                                 throws AdminPersistenceException
Returns all the direct SpaceUserRoles of user.

Throws:
AdminPersistenceException

getDirectSpaceUserRolesOfGroup

public SpaceUserRoleRow[] getDirectSpaceUserRolesOfGroup(int groupId)
                                                  throws AdminPersistenceException
Returns all the direct SpaceUserRoles of a group.

Throws:
AdminPersistenceException

getAllMatchingSpaceUserRoles

public SpaceUserRoleRow[] getAllMatchingSpaceUserRoles(SpaceUserRoleRow sampleSpaceUserRole)
                                                throws AdminPersistenceException
Returns the SpaceUserRole whose fields match those of the given sample SpaceUserRole fields.

Throws:
AdminPersistenceException

createSpaceUserRole

public void createSpaceUserRole(SpaceUserRoleRow spaceUserRole)
                         throws AdminPersistenceException
Inserts in the database a new spaceUserRole row.

Throws:
AdminPersistenceException

prepareInsert

protected void prepareInsert(String insertQuery,
                             PreparedStatement insert,
                             SpaceUserRoleRow 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<SpaceUserRoleRow>
Throws:
SQLException

updateSpaceUserRole

public void updateSpaceUserRole(SpaceUserRoleRow spaceUserRole)
                         throws AdminPersistenceException
Updates a spaceUserRole

Throws:
AdminPersistenceException

prepareUpdate

protected void prepareUpdate(String updateQuery,
                             PreparedStatement update,
                             SpaceUserRoleRow 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<SpaceUserRoleRow>
Throws:
SQLException

removeSpaceUserRole

public void removeSpaceUserRole(int id)
                         throws AdminPersistenceException
Delete the spaceUserRole

Throws:
AdminPersistenceException

isUserDirectlyInRole

public boolean isUserDirectlyInRole(int userId,
                                    int spaceUserRoleId)
                             throws AdminPersistenceException
Tests if a user has a given role (not recursive).

Throws:
AdminPersistenceException

addUserInSpaceUserRole

public void addUserInSpaceUserRole(int userId,
                                   int spaceUserRoleId)
                            throws AdminPersistenceException
Add an user in a spaceUserRole.

Throws:
AdminPersistenceException

removeUserFromSpaceUserRole

public void removeUserFromSpaceUserRole(int userId,
                                        int spaceUserRoleId)
                                 throws AdminPersistenceException
Removes an user from a spaceUserRole.

Throws:
AdminPersistenceException

removeAllUsersFromSpaceUserRole

public void removeAllUsersFromSpaceUserRole(int spaceUserRoleId)
                                     throws AdminPersistenceException
Removes all users from a spaceUserRole.

Throws:
AdminPersistenceException

isGroupDirectlyInRole

public boolean isGroupDirectlyInRole(int groupId,
                                     int spaceUserRoleId)
                              throws AdminPersistenceException
Tests if a group has a given role (not recursive).

Throws:
AdminPersistenceException

addGroupInSpaceUserRole

public void addGroupInSpaceUserRole(int groupId,
                                    int spaceUserRoleId)
                             throws AdminPersistenceException
Adds a group in a spaceUserRole.

Throws:
AdminPersistenceException

removeGroupFromSpaceUserRole

public void removeGroupFromSpaceUserRole(int groupId,
                                         int spaceUserRoleId)
                                  throws AdminPersistenceException
Removes a group from a spaceUserRole.

Throws:
AdminPersistenceException

removeAllGroupsFromSpaceUserRole

public void removeAllGroupsFromSpaceUserRole(int spaceUserRoleId)
                                      throws AdminPersistenceException
Removes all groups from a spaceUserRole.

Throws:
AdminPersistenceException

fetchRow

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

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


Copyright © 2016 Silverpeas. All Rights Reserved.