001/** 002 * Copyright 2014 Tampere University of Technology, Pori Department 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package service.tut.pori.contentanalysis; 017 018import javax.xml.bind.annotation.XmlAccessType; 019import javax.xml.bind.annotation.XmlAccessorType; 020import javax.xml.bind.annotation.XmlElement; 021import javax.xml.bind.annotation.XmlRootElement; 022 023import service.tut.pori.contentanalysis.AsyncTask.TaskStatus; 024import service.tut.pori.contentanalysis.AsyncTask.TaskType; 025import core.tut.pori.http.ResponseData; 026 027/** 028 * Class for representing a response received from a back-end to a previously submitted analysis task. 029 * 030 * <h2>Optional Elements</h2> 031 * <ul> 032 * <li>{@value service.tut.pori.contentanalysis.Definitions#ELEMENT_MESSAGE}</li> 033 * </ul> 034 * 035 */ 036@XmlRootElement 037@XmlAccessorType(XmlAccessType.NONE) 038public abstract class TaskResponse extends ResponseData{ 039 @XmlElement(name=Definitions.ELEMENT_BACKEND_ID) 040 private Integer _backendId = null; 041 @XmlElement(name=Definitions.ELEMENT_MESSAGE) 042 private String _message = null; 043 @XmlElement(name=Definitions.ELEMENT_STATUS) 044 private TaskStatus _status = null; 045 @XmlElement(name=Definitions.ELEMENT_TASK_ID) 046 private Long _taskId = null; 047 @XmlElement(name=Definitions.ELEMENT_TASK_TYPE) 048 private TaskType _taskType = null; 049 050 /** 051 * @return the taskId 052 * @see #setTaskId(Long) 053 */ 054 public Long getTaskId() { 055 return _taskId; 056 } 057 058 /** 059 * @param taskId the taskId to set 060 * @see #getTaskId() 061 */ 062 public void setTaskId(Long taskId) { 063 _taskId = taskId; 064 } 065 066 /** 067 * @return the backendId 068 * @see #setBackendId(Integer) 069 */ 070 public Integer getBackendId() { 071 return _backendId; 072 } 073 074 /** 075 * @param backendId the backendId to set 076 * @see #getBackendId() 077 */ 078 public void setBackendId(Integer backendId) { 079 _backendId = backendId; 080 } 081 082 /** 083 * @return the status 084 * @see #setStatus(service.tut.pori.contentanalysis.AsyncTask.TaskStatus) 085 */ 086 public TaskStatus getStatus() { 087 return _status; 088 } 089 090 /** 091 * @param status the status to set 092 * @see #getStatus() 093 */ 094 public void setStatus(TaskStatus status) { 095 _status = status; 096 } 097 098 /** 099 * @return the status message or null if not available 100 * @see #setMessage(String) 101 */ 102 public String getMessage() { 103 return _message; 104 } 105 106 /** 107 * @param message the message to set 108 * @see #getMessage() 109 */ 110 public void setMessage(String message) { 111 _message = message; 112 } 113 114 /** 115 * @return the taskType 116 * @see #setTaskType(service.tut.pori.contentanalysis.AsyncTask.TaskType) 117 */ 118 public TaskType getTaskType() { 119 return _taskType; 120 } 121 122 /** 123 * @param taskType the taskType to set 124 * @see #getTaskType() 125 */ 126 public void setTaskType(TaskType taskType) { 127 _taskType = taskType; 128 } 129}