Class JDBCBackingEngine

    • Constructor Detail

      • JDBCBackingEngine

        public JDBCBackingEngine​(DataSource dataSource)
    • Method Detail

      • addUser

        public void addUser​(String username,
                            String password)
        Add a new user.
        Specified by:
        addUser in interface BackingEngine
        Parameters:
        username - the user name.
        password - the user password.
      • deleteUser

        public void deleteUser​(String username)
        Delete user by username.
        Specified by:
        deleteUser in interface BackingEngine
        Parameters:
        username - the user name.
      • listUsers

        public List<org.apache.karaf.jaas.boot.principal.UserPrincipal> listUsers()
        List all users.
        Specified by:
        listUsers in interface BackingEngine
        Returns:
        the list of UserPrincipal.
      • lookupUser

        public org.apache.karaf.jaas.boot.principal.UserPrincipal lookupUser​(String username)
        Description copied from interface: BackingEngine
        Retrieve the UserPrincipal corresponding to an username, or null if user doesn't exist.
        Specified by:
        lookupUser in interface BackingEngine
        Parameters:
        username - The username.
        Returns:
        The UserPrincipal or null.
      • listRoles

        public List<org.apache.karaf.jaas.boot.principal.RolePrincipal> listRoles​(Principal principal)
        List the roles of the principal.
        Specified by:
        listRoles in interface BackingEngine
        Parameters:
        principal - the principal (user or group).
        Returns:
        the list of RolePrincipal.
      • addRole

        public void addRole​(String username,
                            String role)
        Add a role to a user.
        Specified by:
        addRole in interface BackingEngine
        Parameters:
        username - the user name.
        role - the role.
      • deleteRole

        public void deleteRole​(String username,
                               String role)
        Remove role from user.
        Specified by:
        deleteRole in interface BackingEngine
        Parameters:
        username - the user name.
        role - the role to remove.
      • listGroups

        public List<org.apache.karaf.jaas.boot.principal.GroupPrincipal> listGroups​(org.apache.karaf.jaas.boot.principal.UserPrincipal principal)
        Description copied from interface: BackingEngine
        List groups that a user is member of.
        Specified by:
        listGroups in interface BackingEngine
        Parameters:
        principal - the UserPrincipal.
        Returns:
        the list of GroupPrincipal.
      • addGroup

        public void addGroup​(String username,
                             String group)
        Description copied from interface: BackingEngine
        Add a user into a given group.
        Specified by:
        addGroup in interface BackingEngine
        Parameters:
        username - the user name.
        group - the group.
      • deleteGroup

        public void deleteGroup​(String username,
                                String group)
        Description copied from interface: BackingEngine
        Remove a user from a group.
        Specified by:
        deleteGroup in interface BackingEngine
        Parameters:
        username - the user name.
        group - the group.
      • addGroupRole

        public void addGroupRole​(String group,
                                 String role)
        Description copied from interface: BackingEngine
        Add a role in a group.
        Specified by:
        addGroupRole in interface BackingEngine
        Parameters:
        group - the group.
        role - the role.
      • getAddUserStatement

        public String getAddUserStatement()
      • setAddUserStatement

        public void setAddUserStatement​(String addUserStatement)
      • getAddRoleStatement

        public String getAddRoleStatement()
      • setAddRoleStatement

        public void setAddRoleStatement​(String addRoleStatement)
      • getDeleteRoleStatement

        public String getDeleteRoleStatement()
      • setDeleteRoleStatement

        public void setDeleteRoleStatement​(String deleteRoleStatement)
      • getDeleteAllUserRolesStatement

        public String getDeleteAllUserRolesStatement()
      • setDeleteAllUserRolesStatement

        public void setDeleteAllUserRolesStatement​(String deleteAllUserRolesStatement)
      • getDeleteUserStatement

        public String getDeleteUserStatement()
      • setDeleteUserStatement

        public void setDeleteUserStatement​(String deleteUserStatement)
      • getSelectUsersQuery

        public String getSelectUsersQuery()
      • setSelectUsersQuery

        public void setSelectUsersQuery​(String selectUsersQuery)
      • getSelectRolesQuery

        public String getSelectRolesQuery()
      • setSelectRolesQuery

        public void setSelectRolesQuery​(String selectRolesQuery)
      • listGroups

        public Map<org.apache.karaf.jaas.boot.principal.GroupPrincipal,​String> listGroups()
        Description copied from interface: BackingEngine
        List all groups.
        Specified by:
        listGroups in interface BackingEngine
        Returns:
        the groups.