Openfire 3.6.3 Javadoc

org.jivesoftware.util.log.output.io.rotate
Class RotateStrategyByTime

java.lang.Object
  extended by org.jivesoftware.util.log.output.io.rotate.RotateStrategyByTime
All Implemented Interfaces:
RotateStrategy

public class RotateStrategyByTime
extends Object
implements RotateStrategy

rotation stragety based when log writting started.

Author:
Bernhard Huber

Constructor Summary
RotateStrategyByTime()
          Rotate logs by time.
RotateStrategyByTime(long timeInterval)
          Rotate logs by time.
 
Method Summary
 boolean isRotationNeeded(String data, File file)
          Check if now a log rotation is neccessary.
 void reset()
          reset interval history counters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RotateStrategyByTime

public RotateStrategyByTime()
Rotate logs by time. By default do log rotation every 24 hours


RotateStrategyByTime

public RotateStrategyByTime(long timeInterval)
Rotate logs by time.

Parameters:
timeInterval - rotate after time-interval [ms] has expired
Method Detail

reset

public void reset()
reset interval history counters.

Specified by:
reset in interface RotateStrategy

isRotationNeeded

public boolean isRotationNeeded(String data,
                                File file)
Check if now a log rotation is neccessary. If (current_time - m_startingTime) / m_timeInterval > m_currentRotation rotation is needed.

Specified by:
isRotationNeeded in interface RotateStrategy
Parameters:
data - the last message written to the log system
file - the File that we are writing to
Returns:
boolean return true if log rotation is neccessary, else false

Openfire 3.6.3 Javadoc

Copyright © 2003-2008 Jive Software.