Class LogProvider
java.lang.Object
de.murmelmeister.murmelapi.bansystem.log.LogProvider
- All Implemented Interfaces:
Log
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddExpiredTime(int logId, long time) Adds an expired time to the log entry with the specified log ID.intaddLog(int userId, int creatorId, int reasonId, long time) Adds a log entry to the logger.voidcreateTable(String tableName) voiddeleteLog(int userId) Deletes all logs associated with a specific user.booleanexistsLog(int logId) Checks if a log with the specified log ID exists.getCreatedDate(int logId) Retrieves the created date of the log entry with the specified log ID.longgetCreatedTime(int logId) Retrieves the created time of the log entry with the specified log ID.intgetCreatorId(int logId) Retrieves the ID of the user who created the log entry with the specified log ID.getExpiredDate(int logId) Retrieves the expiration date of the log entry with the specified log ID.longgetExpiredTime(int logId) Retrieves the expiration time of the log entry with the specified log ID.intgetLogId(int userId) Retrieves the log ID associated with the specified user ID.getLogs(int userId) Retrieves the logs associated with the specified user ID.getReason(int logId) Retrieves the reason associated with the specified log ID.intgetReasonId(int logId) Retrieves the reason ID associated with the specified log ID.intgetUserId(int logId) Retrieves the user ID associated with the specified log ID.removeExpiredTime(int logId, long time) Removes the expired time from a log entry with the specified log ID.voidremoveLog(int logId) Removes a log entry from the logger.setExpiredTime(int logId, long time) Sets the expiration time for a log entry with the specified log ID.voidsetReasonId(int logId, int reasonId) Sets the reason ID for a log entry with the specified log ID.
-
Field Details
-
reason
-
dateFormat
-
-
Constructor Details
-
LogProvider
-
-
Method Details
-
createTable
-
existsLog
public boolean existsLog(int logId) Description copied from interface:LogChecks if a log with the specified log ID exists. -
addLog
public int addLog(int userId, int creatorId, int reasonId, long time) Description copied from interface:LogAdds a log entry to the logger.- Specified by:
addLogin interfaceLog- Parameters:
userId- The ID of the user associated with the log entry.creatorId- The ID of the user who created the log entry.reasonId- The ID of the reason for the log entry.time- The timestamp of the log entry in milliseconds.- Returns:
- The ID of the newly added log entry.
-
removeLog
public void removeLog(int logId) Description copied from interface:LogRemoves a log entry from the logger. -
deleteLog
public void deleteLog(int userId) Description copied from interface:LogDeletes all logs associated with a specific user. -
getLogId
public int getLogId(int userId) Description copied from interface:LogRetrieves the log ID associated with the specified user ID. -
getLogs
Description copied from interface:LogRetrieves the logs associated with the specified user ID. -
getUserId
public int getUserId(int logId) Description copied from interface:LogRetrieves the user ID associated with the specified log ID. -
getCreatorId
public int getCreatorId(int logId) Description copied from interface:LogRetrieves the ID of the user who created the log entry with the specified log ID.- Specified by:
getCreatorIdin interfaceLog- Parameters:
logId- The ID of the log entry.- Returns:
- The ID of the user who created the log entry.
-
getCreatedTime
public long getCreatedTime(int logId) Description copied from interface:LogRetrieves the created time of the log entry with the specified log ID.- Specified by:
getCreatedTimein interfaceLog- Parameters:
logId- The ID of the log entry.- Returns:
- The created time of the log entry, represented as a long value in milliseconds.
-
getCreatedDate
Description copied from interface:LogRetrieves the created date of the log entry with the specified log ID.- Specified by:
getCreatedDatein interfaceLog- Parameters:
logId- The ID of the log entry.- Returns:
- The created date of the log entry, represented as a string.
-
getExpiredTime
public long getExpiredTime(int logId) Description copied from interface:LogRetrieves the expiration time of the log entry with the specified log ID.- Specified by:
getExpiredTimein interfaceLog- Parameters:
logId- The ID of the log entry.- Returns:
- The expiration time of the log entry, represented as a long value in milliseconds.
-
getExpiredDate
Description copied from interface:LogRetrieves the expiration date of the log entry with the specified log ID.- Specified by:
getExpiredDatein interfaceLog- Parameters:
logId- The ID of the log entry.- Returns:
- The expiration date of the log entry, represented as a string.
-
setExpiredTime
Description copied from interface:LogSets the expiration time for a log entry with the specified log ID.- Specified by:
setExpiredTimein interfaceLog- Parameters:
logId- The ID of the log entry.time- The new expiration time in milliseconds.- Returns:
- A string representing the result of setting the expiration time. Returns an empty string if successful.
-
addExpiredTime
Description copied from interface:LogAdds an expired time to the log entry with the specified log ID.- Specified by:
addExpiredTimein interfaceLog- Parameters:
logId- The ID of the log entry.time- The expired time to be added, represented as a long value in milliseconds.- Returns:
- A string representing the result of adding the expired time. Returns an empty string if successful.
-
removeExpiredTime
Description copied from interface:LogRemoves the expired time from a log entry with the specified log ID.- Specified by:
removeExpiredTimein interfaceLog- Parameters:
logId- The ID of the log entry.time- The expired time to be removed, represented as a long value in milliseconds.- Returns:
- A string representing the result of removing the expired time. Returns an empty string if successful.
-
getReasonId
public int getReasonId(int logId) Description copied from interface:LogRetrieves the reason ID associated with the specified log ID.- Specified by:
getReasonIdin interfaceLog- Parameters:
logId- The ID of the log entry.- Returns:
- The reason ID associated with the specified log ID.
-
setReasonId
public void setReasonId(int logId, int reasonId) Description copied from interface:LogSets the reason ID for a log entry with the specified log ID.- Specified by:
setReasonIdin interfaceLog- Parameters:
logId- The ID of the log entry.reasonId- The reason ID to be set for the log entry.
-
getReason
Description copied from interface:LogRetrieves the reason associated with the specified log ID.
-