Class UserParentProvider
java.lang.Object
de.murmelmeister.murmelapi.user.parent.UserParentProvider
- All Implemented Interfaces:
UserParent
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddExpiredTime(int userId, int parentId, long time) Adds an expired time to a parent.voidaddParent(int userId, int creatorId, int parentId, long time) Adds a parent to a user.voidclearParent(int userId) Clears all parents from a user.private voidcreateTable(String tableName) booleanexistsParent(int userId, int parentId) Checks if a parent exists.getCreatedDate(int userId, int parentId) Obtains the created date of a parent.longgetCreatedTime(int userId, int parentId) Obtains the created time of a parent.intgetCreatorId(int userId, int parentId) Obtains the creator id of a parent.getExpiredDate(int userId, int parentId) Obtains the expired date of a parent.longgetExpiredTime(int userId, int parentId) Obtains the expired time of a parent.intgetParentId(int userId) Obtains the parent id of a user.getParentIds(int userId) Obtains all parent ids of a user.getParentNames(Group group, int userId) Obtains all parent names of a user.voidloadExpired(User user) Loads all expired parents of a user.removeExpiredTime(int userId, int parentId, long time) Removes an expired time from a parent.voidremoveParent(int userId, int parentId) Removes a parent from a user.setExpiredTime(int userId, int parentId, long time) Sets the expired time of a parent.
-
Field Details
-
dateFormat
-
-
Constructor Details
-
UserParentProvider
public UserParentProvider()
-
-
Method Details
-
createTable
-
existsParent
public boolean existsParent(int userId, int parentId) Description copied from interface:UserParentChecks if a parent exists.- Specified by:
existsParentin interfaceUserParent- Parameters:
userId- The id of the user.parentId- The id of the parent.- Returns:
- True if the parent exists, otherwise false.
-
addParent
public void addParent(int userId, int creatorId, int parentId, long time) Description copied from interface:UserParentAdds a parent to a user.- Specified by:
addParentin interfaceUserParent- Parameters:
userId- The id of the user.creatorId- The id of the creator.parentId- The id of the parent.time- The time the parent was added.
-
removeParent
public void removeParent(int userId, int parentId) Description copied from interface:UserParentRemoves a parent from a user.- Specified by:
removeParentin interfaceUserParent- Parameters:
userId- The id of the user.parentId- The id of the parent.
-
clearParent
public void clearParent(int userId) Description copied from interface:UserParentClears all parents from a user.- Specified by:
clearParentin interfaceUserParent- Parameters:
userId- The id of the user.
-
getParentId
public int getParentId(int userId) Description copied from interface:UserParentObtains the parent id of a user.- Specified by:
getParentIdin interfaceUserParent- Parameters:
userId- The id of the user.- Returns:
- The parent id of the user.
-
getParentIds
Description copied from interface:UserParentObtains all parent ids of a user.- Specified by:
getParentIdsin interfaceUserParent- Parameters:
userId- The id of the user.- Returns:
- A list of all parent ids of the user.
-
getParentNames
Description copied from interface:UserParentObtains all parent names of a user.- Specified by:
getParentNamesin interfaceUserParent- Parameters:
group- The group.userId- The id of the user.- Returns:
- A list of all parent names of the user.
-
getCreatorId
public int getCreatorId(int userId, int parentId) Description copied from interface:UserParentObtains the creator id of a parent.- Specified by:
getCreatorIdin interfaceUserParent- Parameters:
userId- The id of the user.parentId- The id of the parent.- Returns:
- The creator id of the parent.
-
getCreatedTime
public long getCreatedTime(int userId, int parentId) Description copied from interface:UserParentObtains the created time of a parent.- Specified by:
getCreatedTimein interfaceUserParent- Parameters:
userId- The id of the user.parentId- The id of the parent.- Returns:
- The created time of the parent.
-
getCreatedDate
Description copied from interface:UserParentObtains the created date of a parent.- Specified by:
getCreatedDatein interfaceUserParent- Parameters:
userId- The id of the user.parentId- The id of the parent.- Returns:
- The created date of the parent.
-
getExpiredTime
public long getExpiredTime(int userId, int parentId) Description copied from interface:UserParentObtains the expired time of a parent.- Specified by:
getExpiredTimein interfaceUserParent- Parameters:
userId- The id of the user.parentId- The id of the parent.- Returns:
- The expired time of the parent.
-
getExpiredDate
Description copied from interface:UserParentObtains the expired date of a parent.- Specified by:
getExpiredDatein interfaceUserParent- Parameters:
userId- The id of the user.parentId- The id of the parent.- Returns:
- The expired date of the parent.
-
setExpiredTime
Description copied from interface:UserParentSets the expired time of a parent.- Specified by:
setExpiredTimein interfaceUserParent- Parameters:
userId- The id of the user.parentId- The id of the parent.time- The time the parent expires.- Returns:
- The date the parent will expire.
-
addExpiredTime
Description copied from interface:UserParentAdds an expired time to a parent.- Specified by:
addExpiredTimein interfaceUserParent- Parameters:
userId- The id of the user.parentId- The id of the parent.time- The time to add to the expired time.- Returns:
- The date the parent will expire.
-
removeExpiredTime
Description copied from interface:UserParentRemoves an expired time from a parent.- Specified by:
removeExpiredTimein interfaceUserParent- Parameters:
userId- The id of the user.parentId- The id of the parent.time- The time to remove from the expired time.- Returns:
- The date the parent will expire.
-
loadExpired
Description copied from interface:UserParentLoads all expired parents of a user.- Specified by:
loadExpiredin interfaceUserParent- Parameters:
user- The user.
-