001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2015-2016 ForgeRock AS.
015 */
016package org.forgerock.audit.rotation;
017
018import java.io.File;
019import java.io.Writer;
020
021/**
022 * This class holds some information while a file is being rotated. It will be passed as arguments to the
023 * {@code RotationHooks}.
024 */
025public class RotationContext {
026
027    private File initialFile;
028    private File nextFile;
029    private Writer writer;
030
031    /**
032     * Get the initial file.
033     * @return The file.
034     */
035    public File getInitialFile() {
036        return initialFile;
037    }
038
039    /**
040     * Set the initial file.
041     * @param initialFile The file.
042     */
043    public void setInitialFile(File initialFile) {
044        this.initialFile = initialFile;
045    }
046
047    /**
048     * Get the next file.
049     * @return The file.
050     */
051    public File getNextFile() {
052        return nextFile;
053    }
054
055    /**
056     * Set the next file.
057     * @param nextFile The file.
058     */
059    public void setNextFile(File nextFile) {
060        this.nextFile = nextFile;
061    }
062
063    /**
064     * Get the writer.
065     * @return The writer.
066     */
067    public Writer getWriter() {
068        return writer;
069    }
070
071    /**
072     * Set the writer.
073     * @param writer The writer.
074     */
075    public void setWriter(Writer writer) {
076        this.writer = writer;
077    }
078}