| | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.ResultCode; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | |
| | | import java.util.List; |
| | | import java.util.ArrayList; |
| | |
| | | RotationPolicy<TimeLimitLogRotationPolicyCfg>, |
| | | ConfigurationChangeListener<TimeLimitLogRotationPolicyCfg> |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | |
| | | private long timeInterval = 0; |
| | | |
| | | /** |
| | |
| | | public boolean rotateFile(MultifileTextWriter writer) |
| | | { |
| | | long currTime = TimeThread.getTime(); |
| | | return currTime - writer.getLastRotationTime() > timeInterval; |
| | | long currInterval = currTime - writer.getLastRotationTime(); |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("Last rotation occured %ds ago. " + |
| | | "Next rotation in %ds", currInterval / 1000, |
| | | (timeInterval - currInterval)/1000); |
| | | } |
| | | |
| | | return currInterval > timeInterval; |
| | | } |
| | | |
| | | } |