View Javadoc
1   /******************************************************************************
2    * RestRefreshStatus.java - Admin Refresh Status
3    * $Id: RestRefreshStatus.java,v 1.3 2015/05/04 23:38:38 dick Exp $
4    * 
5    * BuckoVidLib - The BuckoSoft Video Library
6    * Copyright(c) 2015 - Dick Balaska
7    * 
8    * $Log: RestRefreshStatus.java,v $
9    * Revision 1.3  2015/05/04 23:38:38  dick
10   * Javadoc.
11   *
12   * Revision 1.2  2015/05/01 12:47:52  dick
13   * addMessage() helper method.
14   *
15   * Revision 1.1  2015/04/30 14:45:02  dick
16   * Admin Refresh Status.
17   *
18   */
19  package com.buckosoft.BuckoVidLib.domain.rest.admin;
20  
21  import java.util.ArrayList;
22  import java.util.List;
23  
24  import javax.xml.bind.annotation.XmlElement;
25  import javax.xml.bind.annotation.XmlRootElement;
26  
27  /** Admin Refresh Status - Return a status request object from the Refresh system.
28   * @author dick
29   * @since 2015-04-30
30   */
31  @XmlRootElement(name="RefreshStatus")
32  public class RestRefreshStatus {
33  	private	int						percentComplete;
34  	private	List<RestStatusString>	messages;
35  	/**
36  	 * @return the percentComplete
37  	 */
38  	public int getPercentComplete() {
39  		return percentComplete;
40  	}
41  	/**
42  	 * @param percentComplete the percentComplete to set
43  	 */
44  	public void setPercentComplete(int percentComplete) {
45  		this.percentComplete = percentComplete;
46  	}
47  	/**
48  	 * @return the messages
49  	 */
50  	@XmlElement(name="StatusString")
51  	public List<RestStatusString> getMessages() {
52  		return messages;
53  	}
54  	/**
55  	 * @param messages the messages to set
56  	 */
57  	public void setMessages(List<RestStatusString> messages) {
58  		this.messages = messages;
59  	}
60  	
61  	public void addMessage(String type, String message) {
62  		if (messages == null)
63  			messages = new ArrayList<RestStatusString>();
64  		this.messages.add(0, new RestStatusString(type, message));
65  	}
66  }