01: /*
02: * Copyright (C) The Apache Software Foundation. All rights reserved.
03: *
04: * This software is published under the terms of the Apache Software License
05: * version 1.1, a copy of which has been included with this distribution in
06: * the LICENSE file.
07: */
08: package org.jivesoftware.util.log.output.io.rotate;
09:
10: import java.io.File;
11:
12: /**
13: * Strategy that checks condition under which file rotation is needed.
14: *
15: * @author <a href="mailto:bh22351@i-one.at">Bernhard Huber</a>
16: */
17: public interface RotateStrategy {
18: /**
19: * reset cumulative rotation history data.
20: * Called after rotation.
21: */
22: void reset();
23:
24: /**
25: * Check if a log rotation is neccessary at this time.
26: *
27: * @param data the serialized version of last message written to the log system
28: * @param file the File that we are writing to
29: * @return boolean return true if log rotation is neccessary, else false
30: */
31: boolean isRotationNeeded(String data, File file);
32: }
|