Interface IUserAccessor
-
- All Superinterfaces:
SnapshotProcessor
- All Known Implementing Classes:
LocalFileUserAccessor
public interface IUserAccessor extends SnapshotProcessor
This interface manages the serialization/deserialization of the user objects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleandeleteUser(java.lang.String username)Delete a user's from lower storage.java.lang.StringgetDirPath()get UserDirPathjava.util.List<java.lang.String>listAllUsers()List all users existing in the database.UserloadUser(java.lang.String username)Deserialize a user from lower storage.voidreset()Re-initialize this object.voidsaveUser(User user)Serialize the user object to lower storage.-
Methods inherited from interface org.apache.iotdb.commons.snapshot.SnapshotProcessor
processLoadSnapshot, processTakeSnapshot
-
-
-
-
Method Detail
-
loadUser
User loadUser(java.lang.String username) throws java.io.IOException
Deserialize a user from lower storage.- Parameters:
username- The name of the user to be deserialized.- Returns:
- The user object or null if no such user.
- Throws:
java.io.IOException- if an exception is raised when interacting with the lower storage.
-
saveUser
void saveUser(User user) throws java.io.IOException
Serialize the user object to lower storage.- Parameters:
user- The user object that is to be saved.- Throws:
java.io.IOException- if an exception is raised when interacting with the lower storage.
-
deleteUser
boolean deleteUser(java.lang.String username) throws java.io.IOExceptionDelete a user's from lower storage.- Parameters:
username- The name of the user to be deleted.- Returns:
- True if the user is successfully deleted, false if the user does not exists.
- Throws:
java.io.IOException- if an exception is raised when interacting with the lower storage.
-
listAllUsers
java.util.List<java.lang.String> listAllUsers()
List all users existing in the database.- Returns:
- A list that contains names of all users.
-
reset
void reset()
Re-initialize this object.
-
getDirPath
java.lang.String getDirPath()
get UserDirPath- Returns:
- userDirPath
-
-