PolicyDailyPolicy, MonthlyPolicypublic abstract class AbstractDatePolicy extends java.lang.Object implements Policy
DailyPolicy,
MonthlyPolicy| Modifier | Constructor | Description |
|---|---|---|
protected |
AbstractDatePolicy(java.lang.String name,
java.lang.String argument) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
continueCurrentFile(byte[] entry) |
Checks if a log entry can be appended to the current log file.
|
boolean |
continueExistingFile(java.lang.String path) |
Checks if an existing log file can be continued.
|
void |
reset() |
Resets this policy as a new log file has been started.
|
protected abstract void |
scrollAhead(java.util.Calendar calendar) |
Scrolls a calendar ahead to the next policy epoch.
|
protected abstract void |
scrollBack(java.util.Calendar calendar) |
Scrolls a calendar back to the previous policy epoch.
|
protected abstract void |
truncate(java.util.Calendar calendar,
int hourOfDay,
int minuteOfHour) |
Truncates a calendar to the start of a policy epoch.
|
protected AbstractDatePolicy(java.lang.String name,
java.lang.String argument)
name - Human-readable policy name that can be used in error messagesargument - Time for starting new log file (e.g. "23:30")java.lang.IllegalArgumentException - Invalid time or zone passed in argumentpublic boolean continueExistingFile(java.lang.String path)
PolicycontinueExistingFile in interface Policypath - Path to log filetrue if existing log file can be continued, false if a new log file should be createdpublic boolean continueCurrentFile(byte[] entry)
PolicycontinueCurrentFile in interface Policyentry - Log entrytrue if log entry can be appended to the current log file, false if a new log file should
be createdpublic void reset()
Policyprotected abstract void truncate(java.util.Calendar calendar,
int hourOfDay,
int minuteOfHour)
calendar - Calendar to manipulatehourOfDay - Start hourminuteOfHour - Start minute of passed hourprotected abstract void scrollBack(java.util.Calendar calendar)
calendar - Calendar to manipulateprotected abstract void scrollAhead(java.util.Calendar calendar)
calendar - Calendar to manipulateCopyright © 2022. All rights reserved.