Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.log
Class RotateStrategyBySize

java.lang.Object
  extended by com.jivesoftware.base.log.RotateStrategyBySize
All Implemented Interfaces:
RotateStrategy

public class RotateStrategyBySize
extends java.lang.Object
implements RotateStrategy

Rotation stragety based on size written to log file.


Constructor Summary
RotateStrategyBySize()
          Rotate logs by size.
RotateStrategyBySize(long maxSize)
          Rotate logs by size.
 
Method Summary
 void initializeSize(java.io.File file)
          Initializes the size of the strategy from the length of the given file.
 boolean isRotationNeeded(java.lang.String data, java.io.File file)
          Check if now a log rotation is neccessary.
 void reset()
          reset log size written so far.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RotateStrategyBySize

public RotateStrategyBySize()
Rotate logs by size. By default do log rotation after writing approx. 1MB of messages


RotateStrategyBySize

public RotateStrategyBySize(long maxSize)
Rotate logs by size.

Parameters:
maxSize - rotate after writing max_size [byte] of messages
Method Detail

initializeSize

public void initializeSize(java.io.File file)
Initializes the size of the strategy from the length of the given file.

Specified by:
initializeSize in interface RotateStrategy
Parameters:
file - the File that will be written to

reset

public void reset()
reset log size written so far.

Specified by:
reset in interface RotateStrategy

isRotationNeeded

public boolean isRotationNeeded(java.lang.String data,
                                java.io.File file)
Check if now a log rotation is neccessary.

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

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.