001/* 002 * #%L 003 * Netarchivesuite - harvester 004 * %% 005 * Copyright (C) 2005 - 2018 The Royal Danish Library, 006 * the National Library of France and the Austrian National Library. 007 * %% 008 * This program is free software: you can redistribute it and/or modify 009 * it under the terms of the GNU Lesser General Public License as 010 * published by the Free Software Foundation, either version 2.1 of the 011 * License, or (at your option) any later version. 012 * 013 * This program is distributed in the hope that it will be useful, 014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 016 * GNU General Lesser Public License for more details. 017 * 018 * You should have received a copy of the GNU General Lesser Public 019 * License along with this program. If not, see 020 * <http://www.gnu.org/licenses/lgpl-2.1.html>. 021 * #L% 022 */ 023 024package dk.netarkivet.harvester.datamodel; 025 026import java.util.Date; 027 028/** 029 * A simple tuple to deliver information on the status of jobs. 030 */ 031public class JobStatusInfo { 032 033 /** The ID of the job. */ 034 private final long jobID; 035 /** The current status of the Job. */ 036 private final JobStatus status; 037 /** The Id of the harvestdefinition behind this job. */ 038 private final long harvestDefinitionID; 039 /** The name of the harvestdefinition behind this job. */ 040 private final String harvestDefinition; 041 /** The number of times a harvestdefinition has been performed. */ 042 private final int harvestNum; 043 /** Any errors encountered during the actual harvest. */ 044 private final String harvestErrors; 045 /** Any errors encountered during the upload of the result files. */ 046 private final String uploadErrors; 047 /** The name of the Heritrix Template used by this job. */ 048 private final String orderXMLname; 049 /** The number of domain-configurations used for this job. */ 050 private final int configCount; 051 /** The time when this job was submitted. */ 052 private final Date submittedDate; 053 /** The time when this job was submitted. */ 054 private final Date creationDate; 055 /** The time when this job started. */ 056 private final Date startDate; 057 /** The time when this job finished. */ 058 private final Date endDate; 059 060 /** The ID of the job this job was resubmitted as. */ 061 private final Long resubmittedAsJobWithID; 062 063 /** 064 * Constructor for the JobStatusInfo class. 065 * 066 * @param jobID The ID of the job 067 * @param status The current status of the Job 068 * @param harvestDefinitionID The Id of the harvestdefinition behind this job 069 * @param harvestDefinition The name of the harvestdefinition behind this job 070 * @param harvestNum The number of times a harvestdefinition has been performed 071 * @param harvestErrors Any errors encountered during the actual harvest 072 * @param uploadErrors Any errors encountered during the upload of the result files 073 * @param orderXMLname The name of the Heritrix Template used by this job 074 * @param domainCount The number of domain-configurations used for this job 075 * @param submittedDate The time when this job was submitted 076 * @param startDate The time when this job started 077 * @param endDate The time when this job finished 078 * @param resubmittedAsJobWithID The id of the job this job was resubmitted as (possibly null) 079 */ 080 JobStatusInfo(long jobID, JobStatus status, long harvestDefinitionID, String harvestDefinition, int harvestNum, 081 String harvestErrors, String uploadErrors, String orderXMLname, int domainCount, Date submittedDate, 082 Date creationDate, Date startDate, Date endDate, Long resubmittedAsJobWithID) { 083 this.jobID = jobID; 084 this.status = status; 085 this.harvestDefinitionID = harvestDefinitionID; 086 this.harvestDefinition = harvestDefinition; 087 this.harvestNum = harvestNum; 088 this.harvestErrors = harvestErrors; 089 this.uploadErrors = uploadErrors; 090 this.orderXMLname = orderXMLname; 091 this.configCount = domainCount; 092 this.submittedDate = submittedDate; 093 this.creationDate = creationDate; 094 this.startDate = startDate; 095 this.endDate = endDate; 096 this.resubmittedAsJobWithID = resubmittedAsJobWithID; 097 } 098 099 /** 100 * @return the ID of the job. 101 */ 102 public long getJobID() { 103 return jobID; 104 } 105 106 /** 107 * @return the current status of the Job 108 */ 109 public JobStatus getStatus() { 110 return status; 111 } 112 113 /** 114 * @return The Id of the harvestdefinition behind the job 115 */ 116 public long getHarvestDefinitionID() { 117 return harvestDefinitionID; 118 } 119 120 /** 121 * @return The name of the harvestdefinition behind the job. 122 */ 123 public String getHarvestDefinition() { 124 return harvestDefinition; 125 } 126 127 /** 128 * @return the harvest number 129 */ 130 public int getHarvestNum() { 131 return harvestNum; 132 } 133 134 /** 135 * @return Any errors encountered during the actual harvest 136 */ 137 public String getHarvestErrors() { 138 return harvestErrors; 139 } 140 141 /** 142 * @return Any errors encountered during the upload of the result files. 143 */ 144 public String getUploadErrors() { 145 return uploadErrors; 146 } 147 148 /** 149 * @return The name of the Heritrix Template used by the job. 150 */ 151 public String getOrderXMLname() { 152 return orderXMLname; 153 } 154 155 /** 156 * @return The number of domain-configurations used for the job. 157 */ 158 public int getConfigCount() { 159 return configCount; 160 } 161 162 /** 163 * @return The time when the job was submitted 164 */ 165 public Date getSubmittedDate() { 166 return submittedDate; 167 } 168 169 /** 170 * @return The time when the job was created 171 */ 172 public Date getCreationDate() { 173 return creationDate; 174 } 175 176 /** 177 * @return The time when the job started 178 */ 179 public Date getStartDate() { 180 return startDate; 181 } 182 183 /** 184 * @return The time when the job finished 185 */ 186 public Date getEndDate() { 187 return endDate; 188 } 189 190 /** 191 * @return the ID of the job this job was resubmitted as. If null this job has not been resubmitted. 192 */ 193 public Long getResubmittedAsJob() { 194 return this.resubmittedAsJobWithID; 195 } 196 197}