Class IRODSUsers
java.lang.Object
org.irods.irods4j.high_level.administration.IRODSUsers
A class providing high-level data types and functions for managing users and
groups.
- Since:
- 0.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA class designed to represent an iRODS group.static final classA class designed to represent an iRODS user.static enumDefines the set of operations for manipulating user authentication names.static final classTODO Consider removing support for this.static final classHolds the new password for a user.static classThe base class which modifiable user properties are derived from.static enumAn enumeration which defines all user types supported by iRODS.static final classHolds the new type of a user. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddGroup(IRODSApi.RcComm comm, IRODSUsers.Group group) Adds a new group to the local zone.static voidaddUser(IRODSApi.RcComm comm, IRODSUsers.User user, IRODSUsers.UserType userType, IRODSZones.ZoneType zoneType) Adds a new user to the local zone.static voidaddUserToGroup(IRODSApi.RcComm comm, IRODSUsers.Group group, IRODSUsers.User user) Adds a user to a group.static booleanexists(IRODSApi.RcComm comm, IRODSUsers.Group group) Checks if a group exists in the catalog.static booleanexists(IRODSApi.RcComm comm, IRODSUsers.User user) Checks if a user exists in the catalog.static List<IRODSUsers.Group>groups(IRODSApi.RcComm comm) Returns all groups in the local zone.static List<IRODSUsers.Group>groups(IRODSApi.RcComm comm, IRODSUsers.User user) Returns all groups a user is a member of.id(IRODSApi.RcComm comm, IRODSUsers.Group group) Returns the ID of a group.id(IRODSApi.RcComm comm, IRODSUsers.User user) Returns the ID of a user.static StringlocalUniqueName(IRODSApi.RcComm comm, IRODSUsers.User user) Generates the unique name of a user in the local zone.static voidmodifyUser(IRODSApi.RcComm comm, IRODSUsers.User user, IRODSUsers.UserProperty property) Modifies a property of a user.static voidremoveGroup(IRODSApi.RcComm comm, IRODSUsers.Group group) Removes a group from the local zone.static voidremoveUser(IRODSApi.RcComm comm, IRODSUsers.User user) Removes a user from the local zone.static voidremoveUserFromGroup(IRODSApi.RcComm comm, IRODSUsers.Group group, IRODSUsers.User user) Removes a user from a group.static StringConverts aIRODSUsers.UserTypeenumeration to a string.static IRODSUsers.UserTypetoUserType(String v) Converts a string to aIRODSUsers.UserTypeenumeration.static Optional<IRODSUsers.UserType>type(IRODSApi.RcComm comm, IRODSUsers.User user) Returns the type of a user.static booleanuserIsMemberOfGroup(IRODSApi.RcComm comm, IRODSUsers.Group group, IRODSUsers.User user) Checks if a user is a member of a group.static List<IRODSUsers.User>users(IRODSApi.RcComm comm) Returns all users in the local zone.static List<IRODSUsers.User>users(IRODSApi.RcComm comm, IRODSUsers.Group group) Returns all users in a group.
-
Constructor Details
-
IRODSUsers
public IRODSUsers()
-
-
Method Details
-
toUserType
Converts a string to aIRODSUsers.UserTypeenumeration.- Parameters:
v- The string to convert.- Returns:
- The enum representation of the string.
- Since:
- 0.1.0
-
toString
Converts aIRODSUsers.UserTypeenumeration to a string.- Parameters:
v- The enumeration to convert.- Returns:
- The string representation of the enumeration.
- Since:
- 0.1.0
-
localUniqueName
public static String localUniqueName(IRODSApi.RcComm comm, IRODSUsers.User user) throws IOException, IRODSException Generates the unique name of a user in the local zone.- Parameters:
comm- The connection to the iRODS server.user- The user to produce the unique name for.- Returns:
- A string representing the unique name of the user within the local zone.
- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
addUser
public static void addUser(IRODSApi.RcComm comm, IRODSUsers.User user, IRODSUsers.UserType userType, IRODSZones.ZoneType zoneType) throws IOException, IRODSException Adds a new user to the local zone.- Parameters:
comm- The connection to the iRODS server.user- The user to add.userType- The type of the user.zoneType- The zone that is responsible for the user.- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
removeUser
public static void removeUser(IRODSApi.RcComm comm, IRODSUsers.User user) throws IOException, IRODSException Removes a user from the local zone.- Parameters:
comm- The connection to the iRODS server.user- The user to remove.- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
modifyUser
public static void modifyUser(IRODSApi.RcComm comm, IRODSUsers.User user, IRODSUsers.UserProperty property) throws IOException, IRODSException, NoSuchAlgorithmException Modifies a property of a user.- Parameters:
comm- The connection to the iRODS server.user- The user to modify.property- An object containing the required information for applying the change.- Throws:
IOExceptionIRODSExceptionNoSuchAlgorithmException- Since:
- 0.1.0
-
addGroup
public static void addGroup(IRODSApi.RcComm comm, IRODSUsers.Group group) throws IOException, IRODSException Adds a new group to the local zone.- Parameters:
comm- The connection to the iRODS server.group- The group to add.- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
removeGroup
public static void removeGroup(IRODSApi.RcComm comm, IRODSUsers.Group group) throws IOException, IRODSException Removes a group from the local zone.- Parameters:
comm- The connection to the iRODS server.group- The group to remove.- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
addUserToGroup
public static void addUserToGroup(IRODSApi.RcComm comm, IRODSUsers.Group group, IRODSUsers.User user) throws IOException, IRODSException Adds a user to a group.- Parameters:
comm- The connection to the iRODS server.group- The group to add the user to.user- The user to add to the group.- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
removeUserFromGroup
public static void removeUserFromGroup(IRODSApi.RcComm comm, IRODSUsers.Group group, IRODSUsers.User user) throws IOException, IRODSException Removes a user from a group.- Parameters:
comm- The connection to the iRODS server.group- The group that contains the user.user- The user to remove from the group.- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
users
Returns all users in the local zone. The size of the list will be clamped to 100000 elements. If that is too small for your needs, consider using GenQuery directly.- Parameters:
comm- The connection to the iRODS server.- Returns:
- A list of users.
- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
users
public static List<IRODSUsers.User> users(IRODSApi.RcComm comm, IRODSUsers.Group group) throws IOException, IRODSException Returns all users in a group.- Parameters:
comm- The connection to the iRODS server.group- The group to check.- Returns:
- A list of users.
- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
groups
public static List<IRODSUsers.Group> groups(IRODSApi.RcComm comm) throws IOException, IRODSException Returns all groups in the local zone. The size of the list will be clamped to 100000 elements. If that is too small for your needs, consider using GenQuery directly.- Parameters:
comm- The connection to the iRODS server.- Returns:
- A list of groups.
- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
groups
public static List<IRODSUsers.Group> groups(IRODSApi.RcComm comm, IRODSUsers.User user) throws IOException, IRODSException Returns all groups a user is a member of.- Parameters:
comm- The connection to the iRODS server.user- The user to check for.- Returns:
- A list of groups.
- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
exists
public static boolean exists(IRODSApi.RcComm comm, IRODSUsers.User user) throws IOException, IRODSException Checks if a user exists in the catalog.- Parameters:
comm- The connection to the iRODS server.user- The user to find.- Returns:
- A boolean indicating whether the user exists.
- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
exists
public static boolean exists(IRODSApi.RcComm comm, IRODSUsers.Group group) throws IOException, IRODSException Checks if a group exists in the catalog.- Parameters:
comm- The connection to the iRODS server.group- The group to find.- Returns:
- A boolean indicating whether the group exists.
- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
id
public static Optional<String> id(IRODSApi.RcComm comm, IRODSUsers.User user) throws IOException, IRODSException Returns the ID of a user.- Parameters:
comm- The connection to the iRODS server.user- The user to find.- Returns:
- An optional which will contain the user's ID if the user exists.
- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
id
public static Optional<String> id(IRODSApi.RcComm comm, IRODSUsers.Group group) throws IOException, IRODSException Returns the ID of a group.- Parameters:
comm- The connection to the iRODS server.group- The group to find.- Returns:
- An optional which will contain the group's ID if the group exists.
- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
type
public static Optional<IRODSUsers.UserType> type(IRODSApi.RcComm comm, IRODSUsers.User user) throws IOException, IRODSException Returns the type of a user.- Parameters:
comm- The connection to the iRODS server.user- The user to find.- Returns:
- An optional which will contain the user's type if the user exists.
- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-
userIsMemberOfGroup
public static boolean userIsMemberOfGroup(IRODSApi.RcComm comm, IRODSUsers.Group group, IRODSUsers.User user) throws IOException, IRODSException Checks if a user is a member of a group.- Parameters:
comm- The connection to the iRODS server.group- The group to check.user- The user to look for.- Returns:
- A boolean indicating whether the user is a member of the group.
- Throws:
IOExceptionIRODSException- Since:
- 0.1.0
-