2 * jSite2 - Insert.java -
3 * Copyright © 2008 David Roden
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 package net.pterodactylus.jsite.core;
23 * Represents a currently running or past insert.
25 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
29 /** The project that was inserted. */
30 private final Project project;
32 /** The node the project was inserted to. */
33 private final Node node;
35 /** The start time of the insert. */
36 private final long startTime;
38 /** The end time of the insert. */
41 /** Whether the insert was successful. */
42 private boolean success;
45 * Creates a new insert.
48 * The project that is inserted
50 * The node the project is inserted to
52 * The time the insert was started
54 public Insert(Project project, Node node, long startTime) {
55 this.project = project;
57 this.startTime = startTime;
61 * Returns the project that is inserted.
63 * @return The inserted project
65 public Project getProject() {
70 * Returns the node the project is inserted to.
72 * @return The node the project is inserted to
74 public Node getNode() {
79 * Returns the start time of the insert.
81 * @return The start time of the insert
83 public long getStartTime() {
88 * Returns the end time of the insert. If the insert has not yet finished,
89 * <code>-1</code> is returned.
91 * @return The end time of the insert, or <code>-1</code> if the insert is
94 public long getEndTime() {
99 * Sets the end time of the insert.
102 * The end time of the insert
104 public void setEndTime(long endTime) {
105 this.endTime = endTime;
109 * Returns whether the insert was successful. When the project has not yet
110 * finished, i.e. {@link #getEndTime()} returns <code>-1</code>, the
111 * return value of this method is undefined.
113 * @return <code>true</code> if the insert finished successfully,
114 * <code>false</code> otherwise
116 public boolean isSuccess() {
121 * Sets whether the insert finished successfully.
124 * <code>true</code> if the insert finished successfully,
125 * <code>false</code> otherwise
127 public void setSuccess(boolean success) {
128 this.success = success;