Interface PermissionManagement

All Known Subinterfaces:
CachedPermissionManagement
All Known Implementing Classes:
DefaultCachedPermissionManagement, DefaultPermissionManagement

@RPCValidation public interface PermissionManagement
The main api point for accessing and managing permissions, permission users and permission groups. This management contains some helpful methods to check a permissible for a certain permission and removing outdated permissions. Updating the permissible is handled by the permission management too.
Since:
4.0
  • Method Details

    • childPermissionManagement

      @Nullable @Nullable PermissionManagement childPermissionManagement()
      Gets the child permission management of this permission management. The child is null if there is no child permission management.
      Returns:
      the child management, null if there is no child.
    • init

      void init()
      Initializes this permission management.
    • close

      void close()
      Closes the permission management.
    • reload

      boolean reload()
      Reloads this permission management.
      Returns:
      true if reloading was successful, false otherwise.
    • testPermissionUser

      boolean testPermissionUser(@Nullable @Nullable PermissionUser permissionUser)
      Removes all timed-out permissions and groups of the given permission user.
      Parameters:
      permissionUser - the permission user to check.
      Returns:
      true if at least one permission was removed, false otherwise.
    • testPermissible

      boolean testPermissible(@Nullable @Nullable Permissible permissible)
      Removes the timed-out permissions of the given permissible.
      Parameters:
      permissible - the permissible to check.
      Returns:
      true if at least one permission was removed, false otherwise.
    • addPermissionUser

      @NonNull @NonNull PermissionUser addPermissionUser(@NonNull @NonNull String name, @NonNull @NonNull String password, int potency)
      Creates a new permission user and inserts it into the database. If the there already is a user in the database the user is updated.
      Parameters:
      name - the name of the new user.
      password - the password of the new user.
      potency - the potency of the new user.
      Returns:
      the newly created permission user.
      Throws:
      NullPointerException - if the given name or password is null.
    • addPermissionUser

      @NonNull @NonNull PermissionUser addPermissionUser(@NonNull @NonNull PermissionUser permissionUser)
      Inserts the given permission user into the database. If there already is a permission user with the same unique id the old one is replaced by the given permission user.
      Parameters:
      permissionUser - the user to add.
      Returns:
      the same instance that was given.
      Throws:
      NullPointerException - if the given user is null.
    • groupsOf

      Gets all groups that are associated with the given permissible.
      Parameters:
      permissible - the permissible to retrieve the groups for.
      Returns:
      all found groups.
    • hasPermission

      default boolean hasPermission(@NonNull @NonNull Permissible permissible, @NonNull @NonNull Permission permission)
      Checks if the given permissible or any group that is associated with the permissible has the permission, and it is not overriden by another permission with a negative potency.
      Parameters:
      permissible - the permissible to check if the permission is set.
      permission - the permission to check for.
      Returns:
      true if the permissible has the permission, false otherwise.
      Throws:
      NullPointerException - if the given permissible or permission is null.
      See Also:
    • hasGroupPermission

      default boolean hasGroupPermission(@NonNull @NonNull Permissible permissible, @NonNull @NonNull String group, @NonNull @NonNull Permission permission)
      Checks if the given permissible has the given permission for the given group.
      Parameters:
      permissible - the permissible to check if the permission is set.
      group - the group that the permission is assigned to.
      permission - the permission to check.
      Returns:
      true if the permissible has the permission on the given group, false otherwise.
      Throws:
      NullPointerException - if the given permissible, group or permission is null.
      See Also:
    • permissionResult

      Checks if the given permissible or any group that is associated with the permissible has the permission, and it is not overriden by another permission with a negative potency.
      Parameters:
      permissible - the permissible to check if the permission is set.
      permission - the permission to check.
      Returns:
      the result of the permission check.
      Throws:
      NullPointerException - if the given permissible or permission is null.
    • groupPermissionResult

      Checks if the given permissible has the given permission for the given group.
      Parameters:
      permissible - the permissible to check if the permission is set.
      group - the group to get the permissions on.
      permission - the permission to check.
      Returns:
      the result of the permission check.
      Throws:
      NullPointerException - if the given permissible, group or permission is null.
    • groupsPermissionResult

      Checks if the given permissible has the given permission for the given groups.
      Parameters:
      permissible - the permissible to check if the permission is set.
      groups - the groups to get the permissions on.
      permission - the permission to check.
      Returns:
      the result of the permission check.
      Throws:
      NullPointerException - if the given permissible, groups or permission is null.
    • findHighestPermission

      @Nullable @Nullable Permission findHighestPermission(@NonNull @NonNull Collection<Permission> permissions, @NonNull @NonNull Permission permission)
      Finds the highest permission (sorted by the potency) in the given permission collection using the given permission potency as the starting point.
      Parameters:
      permissions - the permissions to check through.
      permission - the starting point for the check to run.
      Returns:
      the highest permission in the given permission or null if there is no permission with a higher potency in the given collection.
      Throws:
      NullPointerException - if the given permissions or permission is null.
    • allPermissions

      Gets all permission of the specified permissible.
      Parameters:
      permissible - the permissible to get the permission of.
      Returns:
      all permissions of the permissible.
      Throws:
      NullPointerException - if the given permissible is null.
    • allGroupPermissions

      Gets all permission of the specified permissible on the given group.
      Parameters:
      permissible - the permissible to get the permission of.
      group - the group to get the permission on or null if no specific group should be used.
      Returns:
      all permissions of the permissible on the specified group if provided.
      Throws:
      NullPointerException - if the given permissible or group is null.
    • updateUser

      void updateUser(@NonNull @NonNull PermissionUser permissionUser)
      Updates the given permission user in the database. If there is no user with the unique id the user is just inserted into the database.
      Parameters:
      permissionUser - the user to update in the database.
      Throws:
      NullPointerException - if the given user is null.
    • deleteUser

      boolean deleteUser(@NonNull @NonNull String name)
      Deletes all users in the database matching the given name. The given name is case-sensitive.
      Parameters:
      name - the name of the users to be deleted
      Returns:
      true if any user was deleted, false if none was deleted.
      Throws:
      NullPointerException - if the given name is null.
    • deletePermissionUser

      boolean deletePermissionUser(@NonNull @NonNull PermissionUser permissionUser)
      Deletes the given user from the database.
      Parameters:
      permissionUser - the user to delete from the database.
      Returns:
      if there was a user with the unique id of the given user, false otherwise.
      Throws:
      NullPointerException - if the given user is null.
    • containsUser

      boolean containsUser(@NonNull @NonNull UUID uniqueId)
      Checks if a user with the given unique id is stored in the database.
      Parameters:
      uniqueId - the unique id of the user.
      Returns:
      true if there is a user with the given unique id, false otherwise.
      Throws:
      NullPointerException - if the given unique id is null.
    • containsOneUser

      boolean containsOneUser(@NonNull @NonNull String name)
      Checks if at least one user with the given name is stored in the database. This given name is case-sensitive.
      Parameters:
      name - the name of the user
      Returns:
      true if there is a user with that name, false otherwise
      Throws:
      NullPointerException - if the given name is null.
    • user

      Searches for the user with the given unique id.
      Parameters:
      uniqueId - the unique id of the user.
      Returns:
      the found permission user, null if no user was found.
      Throws:
      NullPointerException - if the given unique id is null.
    • getOrCreateUser

      Searches the database for a permission user with the given unique id. If no user with the given id is found a new user is stored in the database.

      The given name is not used to search for the user.

      Parameters:
      uniqueId - the uniqueId of the user.
      name - the name of the user.
      Returns:
      the found or created permission user.
      Throws:
      NullPointerException - if the given unique id or name is null.
    • firstUser

      Searches all users matching the given name and selecting the first one.
      Parameters:
      name - the name of the user to search.
      Returns:
      the found user or null if no user with this name exists.
      Throws:
      NullPointerException - if the given name is null.
    • usersByName

      Gets a list of all users with the given name out of the database.
      Parameters:
      name - the name to search in the database for.
      Returns:
      all found users that have the given name.
      Throws:
      NullPointerException - if the given name is null.
    • users

      Gets a list of all stored permission users in the database.

      Note: If there are many users in the database this might lead to memory issues as all of them are loaded into memory.

      Returns:
      all permission users.
    • usersByGroup

      Gets a list of all stored permission users in the database that are in the given group.

      Note: If there are many users in the database this might lead to memory issues as all of them are loaded into memory.

      Returns:
      all permission users in the given group.
      Throws:
      NullPointerException - if the given group is null.
    • defaultPermissionGroup

      @Nullable @Nullable PermissionGroup defaultPermissionGroup()
      Gets the default permission group. The default group is determined by the PermissionGroup.defaultGroup() property. If multiple groups are the default group this method might return another result for each call.
      Returns:
      the default permission group, null if no group is marked as default.
    • highestPermissionGroup

      @Nullable @Nullable PermissionGroup highestPermissionGroup(@NonNull @NonNull PermissionUser permissionUser)
      Gets the highest permission group for the given user. The highest permission group is determined by the potency of the group. A higher potency results in the highest group.
      Parameters:
      permissionUser - the user to get the group for.
      Returns:
      the highest permission group, null if the user is not in any group and there is no default group.
      Throws:
      NullPointerException - if the given user is null.
    • addPermissionGroup

      @NonNull @NonNull PermissionGroup addPermissionGroup(@NonNull @NonNull String name, int potency)
      Creates a new permission group with the given name and potency. If there already is group with the given name the old group is replaced by the newly created one.
      Parameters:
      name - the case-sensitive name of the new group.
      potency - the potency of the new group.
      Returns:
      the newly created permission group.
      Throws:
      NullPointerException - if the given name is null.
    • addPermissionGroup

      @NonNull @NonNull PermissionGroup addPermissionGroup(@NonNull @NonNull PermissionGroup permissionGroup)
      Stores the given permission group. If there already is a group with the same name the old group is replaced by the given one.
      Parameters:
      permissionGroup - the group to add.
      Returns:
      the same instance that was given.
      Throws:
      NullPointerException - if the given permission group is null.
    • updateGroup

      void updateGroup(@NonNull @NonNull PermissionGroup permissionGroup)
      Updates the given permission group. If there is no group with the given name the group is added.
      Parameters:
      permissionGroup - the group to update.
      Throws:
      NullPointerException - if the given permission group is null.
    • deleteGroup

      boolean deleteGroup(@NonNull @NonNull String name)
      Deletes the group by the given name.
      Parameters:
      name - the name of the group to delete.
      Returns:
      true if a group with the name was found and deleted, false otherwise.
      Throws:
      NullPointerException - if the given name is null.
    • deletePermissionGroup

      boolean deletePermissionGroup(@NonNull @NonNull PermissionGroup permissionGroup)
      Deletes the given permission group.
      Parameters:
      permissionGroup - the permission group to delete.
      Returns:
      always true as the group is already present.
      Throws:
      NullPointerException - if the given group is null.
    • containsGroup

      boolean containsGroup(@NonNull @NonNull String group)
      Checks if the given group exists.
      Parameters:
      group - the case-sensitive name of the group.
      Returns:
      true if the group exists, false otherwise.
      Throws:
      NullPointerException - if the given group is null.
    • group

      Gets the permission group by the given name.
      Parameters:
      name - the case-sensitive name of the group.
      Returns:
      the permission group with the given name, null if there is no group with the given name.
      Throws:
      NullPointerException - if the given name is null.
    • groups

      Gets all known permission groups.
      Returns:
      all permissions groups.
    • groups

      Overwrites all known groups with the given collection of groups. Null is allowed and results in the removal of all groups without a replacement.
      Parameters:
      groups - the groups to add after clearing all other groups.
    • modifyGroup

      Gets the permission group with the given name by using group(String) and, if not null, puts it into the consumer, after that, the group will be updated by using updateGroup(PermissionGroup).
      Parameters:
      name - the name of the group.
      modifier - the consumer to modify the user.
      Returns:
      the modified group, null if no group was found with the given name.
      Throws:
      NullPointerException - if the given name or consumer is null.
    • modifyUser

      Gets the permission user with the given unique id using user(UUID) and, if not null, puts them into the consumer, after that, the user will be updated by using updateUser(PermissionUser).
      Parameters:
      uniqueId - the unique id of the user
      modifier - the consumer to modify the user
      Returns:
      the modified user, null if no user was found with the given unique id.
      Throws:
      NullPointerException - if the given unique id or consumer is null.
    • modifyUsers

      Gets every user matching the given name using usersByName(String) and puts them into the consumer, after that, every user will be updated by using updateUser(PermissionUser).
      Parameters:
      name - the name of the users.
      modifier - the consumer to modify the available users.
      Returns:
      a list containing all modified users.
      Throws:
      NullPointerException - if the given name or consumer is null.
    • sendCommandLine

      Sends a command line to the node the method is called on or the node the wrapper is connected to. The command line is executed and all resulting messages are collected in the collection of strings.
      Parameters:
      user - the user to execute the command line with.
      commandLine - the command line to execute on the node.
      Returns:
      all messages regarding the command execution.
      Throws:
      NullPointerException - if the given user or command line is null.
    • groupsOfAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Collection<PermissionGroup>> groupsOfAsync(@Nullable @Nullable Permissible permissible)
      Gets all groups that are associated with the given permissible.
      Parameters:
      permissible - the permissible to retrieve the groups for.
      Returns:
      a task containing all found groups.
    • addPermissionUserAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<PermissionUser> addPermissionUserAsync(@NonNull @NonNull PermissionUser permissionUser)
      Inserts the given permission user into the database. If there already is a permission user with the same unique id the old one is replaced by the given permission user.
      Parameters:
      permissionUser - the user to add.
      Returns:
      a task containing the same instance that was given.
      Throws:
      NullPointerException - if the given user is null.
    • addUserAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<PermissionUser> addUserAsync(@NonNull @NonNull String name, @NonNull @NonNull String password, int potency)
      Creates a new permission user and inserts it into the database. If the there already is a user in the database the user is updated.
      Parameters:
      name - the name of the new user.
      password - the password of the new user.
      potency - the potency of the new user.
      Returns:
      a task containing the newly created permission user.
      Throws:
      NullPointerException - if the given name or password is null.
    • updateUserAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Void> updateUserAsync(@NonNull @NonNull PermissionUser permissionUser)
      Updates the given permission user in the database. If there is no user with the unique id the user is just inserted into the database.
      Parameters:
      permissionUser - the user to update in the database.
      Returns:
      a task that completes when the user was updated.
      Throws:
      NullPointerException - if the given user is null.
    • deleteUserAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Boolean> deleteUserAsync(@NonNull @NonNull String name)
      Deletes all users in the database matching the given name. The given name is case-sensitive.
      Parameters:
      name - the name of the users to be deleted
      Returns:
      a task containing true if any user was deleted, false if none was deleted.
      Throws:
      NullPointerException - if the given name is null.
    • deletePermissionUserAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Boolean> deletePermissionUserAsync(@NonNull @NonNull PermissionUser permissionUser)
      Deletes the given user from the database.
      Parameters:
      permissionUser - the user to delete from the database.
      Returns:
      a task containing if there was a user with the unique id of the given user, false otherwise.
      Throws:
      NullPointerException - if the given user is null.
    • containsUserAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Boolean> containsUserAsync(@NonNull @NonNull UUID uniqueId)
      Checks if a user with the given unique id is stored in the database.
      Parameters:
      uniqueId - the unique id of the user.
      Returns:
      a task containing true if there is a user with the given unique id, false otherwise.
      Throws:
      NullPointerException - if the given unique id is null.
    • containsOneUserAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Boolean> containsOneUserAsync(@NonNull @NonNull String name)
      Checks if at least one user with the given name is stored in the database. This given name is case-sensitive.
      Parameters:
      name - the name of the user
      Returns:
      a task containing true if there is a user with that name, false otherwise
      Throws:
      NullPointerException - if the given name is null.
    • userAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<PermissionUser> userAsync(@NonNull @NonNull UUID uniqueId)
      Searches for the user with the given unique id.
      Parameters:
      uniqueId - the unique id of the user.
      Returns:
      a task containing the found permission user, null if no user was found.
      Throws:
      NullPointerException - if the given unique id is null.
    • getOrCreateUserAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<PermissionUser> getOrCreateUserAsync(@NonNull @NonNull UUID uniqueId, @NonNull @NonNull String name)
      Searches the database for a permission user with the given unique id. If no user with the given id is found a new user is stored in the database.

      The given name is not used to search for the user.

      Parameters:
      uniqueId - the uniqueId of the user.
      name - the name of the user.
      Returns:
      a task containing the found or created permission user.
      Throws:
      NullPointerException - if the given unique id or name is null.
    • usersByNameAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<List<PermissionUser>> usersByNameAsync(@NonNull @NonNull String name)
      Gets a list of all users with the given name out of the database.
      Parameters:
      name - the name to search in the database for.
      Returns:
      a task containing all found users that have the given name.
      Throws:
      NullPointerException - if the given name is null.
    • firstUserAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<PermissionUser> firstUserAsync(String name)
      Searches all users matching the given name and selecting the first one.
      Parameters:
      name - the name of the user to search.
      Returns:
      a task containing the found user or null if no user with this name exists.
      Throws:
      NullPointerException - if the given name is null.
    • usersAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Collection<PermissionUser>> usersAsync()
      Gets a list of all stored permission users in the database.

      Note: If there are many users in the database this might lead to memory issues as all of them are loaded into memory.

      Returns:
      a task containing all permission users.
    • usersByGroupAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Collection<PermissionUser>> usersByGroupAsync(@NonNull @NonNull String group)
      Gets a list of all stored permission users in the database that are in the given group.

      Note: If there are many users in the database this might lead to memory issues as all of them are loaded into memory.

      Returns:
      a task containing all permission users in the given group.
      Throws:
      NullPointerException - if the given group is null.
    • addPermissionGroupAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<PermissionGroup> addPermissionGroupAsync(@NonNull @NonNull PermissionGroup permissionGroup)
      Stores the given permission group. If there already is a group with the same name the old group is replaced by the given one.
      Parameters:
      permissionGroup - the group to add.
      Returns:
      a task containing the same instance that was given.
      Throws:
      NullPointerException - if the given permission group is null.
    • addGroupAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<PermissionGroup> addGroupAsync(@NonNull @NonNull String name, int potency)
      Creates a new permission group with the given name and potency. If there already is group with the given name the old group is replaced by the newly created one.
      Parameters:
      name - the case-sensitive name of the new group.
      potency - the potency of the new group.
      Returns:
      a task containing the newly created permission group.
      Throws:
      NullPointerException - if the given name is null.
    • updateGroupAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Void> updateGroupAsync(@NonNull @NonNull PermissionGroup permissionGroup)
      Updates the given permission group. If there is no group with the given name the group is added.
      Parameters:
      permissionGroup - the group to update.
      Returns:
      a task that completes after the group is updated.
      Throws:
      NullPointerException - if the given permission group is null.
    • deleteGroupAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Boolean> deleteGroupAsync(@NonNull @NonNull String name)
      Deletes the group by the given name.
      Parameters:
      name - the name of the group to delete.
      Returns:
      a task containing true if a group with the name was found and deleted, false otherwise.
      Throws:
      NullPointerException - if the given name is null.
    • deletePermissionGroupAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Boolean> deletePermissionGroupAsync(@NonNull @NonNull PermissionGroup permissionGroup)
      Deletes the given permission group.
      Parameters:
      permissionGroup - the permission group to delete.
      Returns:
      a task containing always true as the group is already present.
      Throws:
      NullPointerException - if the given group is null.
    • containsGroupAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Boolean> containsGroupAsync(@NonNull @NonNull String group)
      Checks if the given group exists.
      Parameters:
      group - the case-sensitive name of the group.
      Returns:
      a task containing true if the group exists, false otherwise.
      Throws:
      NullPointerException - if the given group is null.
    • groupAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<PermissionGroup> groupAsync(@NonNull @NonNull String name)
      Gets the permission group by the given name.
      Parameters:
      name - the case-sensitive name of the group.
      Returns:
      a task containing the permission group with the given name, null if there is no group with the given name.
      Throws:
      NullPointerException - if the given name is null.
    • defaultPermissionGroupAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<PermissionGroup> defaultPermissionGroupAsync()
      Gets the default permission group. The default group is determined by the PermissionGroup.defaultGroup() property. If multiple groups are the default group this method might return another result for each call.
      Returns:
      a task containing the default permission group, null if no group is marked as default.
    • groupsAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Collection<PermissionGroup>> groupsAsync()
      Gets all known permission groups.
      Returns:
      a task containing all permissions groups.
    • groupsAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Void> groupsAsync(@Nullable @Nullable Collection<PermissionGroup> groups)
      Overwrites all known groups with the given collection of groups. Null is allowed and results in the removal of all groups without a replacement.
      Parameters:
      groups - the groups to add after clearing all other groups.
      Returns:
      a task that completes after the groups were replaced.
    • modifyGroupAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<PermissionGroup> modifyGroupAsync(@NonNull @NonNull String name, @NonNull @NonNull BiConsumer<PermissionGroup,PermissionGroup.Builder> modifier)
      Gets the permission group with the given name by using group(String) and, if not null, puts it into the consumer, after that, the group will be updated by using updateGroup(PermissionGroup).
      Parameters:
      name - the name of the group.
      modifier - the consumer to modify the user.
      Returns:
      a task containing the modified group, null if no group was found with the given name.
      Throws:
      NullPointerException - if the given name or consumer is null.
    • modifyUserAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<PermissionUser> modifyUserAsync(@NonNull @NonNull UUID uniqueId, @NonNull @NonNull BiConsumer<PermissionUser,PermissionUser.Builder> modifier)
      Gets the permission user with the given unique id using user(UUID) and, if not null, puts them into the consumer, after that, the user will be updated by using updateUser(PermissionUser).
      Parameters:
      uniqueId - the unique id of the user
      modifier - the consumer to modify the user
      Returns:
      a task containing the modified user, null if no user was found with the given unique id.
      Throws:
      NullPointerException - if the given unique id or consumer is null.
    • modifyUsersAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<List<PermissionUser>> modifyUsersAsync(@NonNull @NonNull String name, @NonNull @NonNull BiConsumer<PermissionUser,PermissionUser.Builder> modifier)
      Gets every user matching the given name using usersByName(String) and puts them into the consumer, after that, every user will be updated by using updateUser(PermissionUser).
      Parameters:
      name - the name of the users.
      modifier - the consumer to modify the available users.
      Returns:
      a task containing a list containing all modified users.
      Throws:
      NullPointerException - if the given name or consumer is null.
    • sendCommandLineAsync

      @NonNull default @NonNull eu.cloudnetservice.common.concurrent.Task<Collection<String>> sendCommandLineAsync(@NonNull @NonNull PermissionUser user, @NonNull @NonNull String commandLine)
      Sends a command line to the node the method is called on or the node the wrapper is connected to. The command line is executed and all resulting messages are collected in the collection of strings.
      Parameters:
      user - the user to execute the command line with.
      commandLine - the command line to execute on the node.
      Returns:
      a task containing all messages regarding the command execution.
      Throws:
      NullPointerException - if the given user or command line is null.