2 * jSite2 - Insert.java - Copyright © 2008 David Roden
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License as published by the Free Software
6 * Foundation; either version 2 of the License, or (at your option) any later
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307, USA.
19 package net.pterodactylus.jsite.core;
22 * Represents a currently running or past insert.
24 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
26 public class Insert extends Request {
28 /** The project that was inserted. */
29 private final Project project;
31 /** The start time of the insert. */
32 private final long startTime;
34 /** The end time of the insert. */
38 * Creates a new insert.
41 * The project that is inserted
43 * The node the project is inserted to
45 * The identifier of the insert request
47 * The time the insert was started
49 public Insert(Project project, Node node, String identifier, long startTime) {
50 super(node, identifier);
51 this.project = project;
52 this.startTime = startTime;
56 * Returns the project that is inserted.
58 * @return The inserted project
60 public Project getProject() {
65 * Returns the start time of the insert.
67 * @return The start time of the insert
69 public long getStartTime() {
74 * Returns the end time of the insert. If the insert has not yet finished,
75 * <code>-1</code> is returned.
77 * @return The end time of the insert, or <code>-1</code> if the insert is
80 public long getEndTime() {
85 * Sets the end time of the insert.
88 * The end time of the insert
90 public void setEndTime(long endTime) {
91 this.endTime = endTime;