Package org.zaproxy.zap.extension.users
Class ContextUserAuthManager
- java.lang.Object
-
- org.zaproxy.zap.extension.users.ContextUserAuthManager
-
public class ContextUserAuthManager extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ContextUserAuthManager(int contextId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUser(User user)
Adds an user.int
getContextId()
Gets the context id to which this object corresponds.User
getUserById(int id)
Gets the user with a given id.java.util.List<User>
getUsers()
Gets an unmodifiable view of the list of users.UsersTableModel
getUsersModel()
Builds a table model for the users.void
removeAllUsers()
Removes all the users.void
removeUser(User user)
Removes an user.boolean
removeUserById(int id)
Removes the user with a given id.void
setUsers(java.util.List<User> users)
Sets a new list of users for this context.
-
-
-
Method Detail
-
getUsersModel
public UsersTableModel getUsersModel()
Builds a table model for the users.- Returns:
- the model
-
getContextId
public int getContextId()
Gets the context id to which this object corresponds.- Returns:
- the context id
-
getUsers
public java.util.List<User> getUsers()
Gets an unmodifiable view of the list of users.- Returns:
- the users
-
setUsers
public void setUsers(java.util.List<User> users)
Sets a new list of users for this context. An internal copy of the provided list is stored.- Parameters:
users
- the users- Throws:
java.lang.IllegalArgumentException
- (since 2.8.0) if any of the given users isnull
.
-
addUser
public void addUser(User user)
Adds an user.- Parameters:
user
- the user- Throws:
java.lang.IllegalArgumentException
- (since 2.8.0) if the given user isnull
.
-
removeUser
public void removeUser(User user)
Removes an user.- Parameters:
user
- the user- Throws:
java.lang.IllegalArgumentException
- (since 2.8.0) if the given user isnull
.
-
getUserById
public User getUserById(int id)
Gets the user with a given id.- Parameters:
id
- the id- Returns:
- the user by id
-
removeUserById
public boolean removeUserById(int id)
Removes the user with a given id.- Parameters:
id
- the id- Returns:
- true, if successful
-
removeAllUsers
public void removeAllUsers()
Removes all the users.
-
-