View Javadoc
1   package fr.ifremer.quadrige3.synchro.vo;
2   
3   /*-
4    * #%L
5    * Quadrige3 Core :: Quadrige3 Synchro Core
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2017 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
24   */
25  
26  import java.beans.PropertyChangeListener;
27  
28  /**
29   * <p>
30   * SynchroProgressionErrorVO class.
31   * </p>
32   * 
33   * @author Ludovic Pecquot <ludovic.pecquot@e-is.pro>
34   * @since 3.7.0
35   */
36  public class SynchroProgressionErrorVO extends SynchroProgressionVO {
37  
38  	private static final long serialVersionUID = 1L;
39  
40  	/**
41  	 * <p>
42  	 * Constructor for SynchroProgressionErrorVO.
43  	 * </p>
44  	 * 
45  	 * @param errorMessage
46  	 *            a {@link java.lang.String} object.
47  	 */
48  	public SynchroProgressionErrorVO(final String errorMessage) {
49  		this("", errorMessage);
50  	}
51  
52  	/**
53  	 * <p>
54  	 * Constructor for SynchroProgressionErrorVO.
55  	 * </p>
56  	 * 
57  	 * @param jobId
58  	 *            a {@link java.lang.String} object.
59  	 * @param errorMessage
60  	 *            a {@link java.lang.String} object.
61  	 */
62  	public SynchroProgressionErrorVO(String jobId, final String errorMessage) {
63  		super(jobId, "", new SynchroProgressionModel() {
64  			private static final long serialVersionUID = 1L;
65  
66  			@Override
67  			public String getMessage() {
68  				return errorMessage;
69  			}
70  
71  			@Override
72  			public void setTask(String task) {
73  			}
74  
75  			@Override
76  			public String getTask() {
77  				return "";
78  			}
79  
80  			@Override
81  			public void setMessage(String message) {
82  			}
83  
84  			@Override
85  			public int getCurrent() {
86  				return 0;
87  			}
88  
89  			@Override
90  			public void setCurrent(int progression) {
91  			}
92  
93  			@Override
94  			public void increments(int increment) {
95  			}
96  
97  			@Override
98  			public void increments(String message) {
99  			}
100 
101 			@Override
102 			public SynchroProgressionStatus getStatus() {
103 				return SynchroProgressionStatus.FAILED;
104 			}
105 
106 			@Override
107 			public void setStatus(SynchroProgressionStatus progressionStatus) {
108 			}
109 
110 			@Override
111 			public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
112 			}
113 
114 			@Override
115 			public void addPropertyChangeListener(PropertyChangeListener listener) {
116 			}
117 
118 			@Override
119 			public void removePropertyChangeListener(PropertyChangeListener listener) {
120 			}
121 		});
122 	}
123 }