Interface IRoleAccessor
-
- All Superinterfaces:
SnapshotProcessor
- All Known Implementing Classes:
LocalFileRoleAccessor
public interface IRoleAccessor extends SnapshotProcessor
This interface manages the serialization/deserialization of the role objects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleandeleteRole(java.lang.String rolename)Delete a role's in lower storage.java.util.List<java.lang.String>listAllRoles()List all roles in this database.RoleloadRole(java.lang.String rolename)Deserialize a role from lower storage.voidreset()Re-initialize this object.voidsaveRole(Role role)Serialize the role object to lower storage.-
Methods inherited from interface org.apache.iotdb.commons.snapshot.SnapshotProcessor
processLoadSnapshot, processTakeSnapshot
-
-
-
-
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.IOExceptionDelete 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.
-
-