Interface IRoleAccessor

    • Method Detail

      • loadRole

        Role loadRole​(java.lang.String rolename)
               throws java.io.IOException
        Deserialize a role from lower storage.
        Parameters:
        rolename - The name of the role to be deserialized.
        Returns:
        The role object or null if no such role.
        Throws:
        java.io.IOException - if IOException is raised when interacting with lower storage.
      • saveRole

        void saveRole​(Role role)
               throws java.io.IOException
        Serialize the role object to lower storage.
        Parameters:
        role - The role object that is to be saved.
        Throws:
        java.io.IOException - if IOException is raised when interacting with lower storage.
      • deleteRole

        boolean deleteRole​(java.lang.String rolename)
                    throws java.io.IOException
        Delete a role's in lower storage.
        Parameters:
        rolename - The name of the role to be deleted.
        Returns:
        True if the role is successfully deleted, false if the role does not exists.
        Throws:
        java.io.IOException - if IOException is raised when interacting with lower storage.
      • listAllRoles

        java.util.List<java.lang.String> listAllRoles()
        List all roles in this database.
        Returns:
        A list contains all names of the roles.
      • reset

        void reset()
        Re-initialize this object.