1 /**
2 * Copyright 2005-2006 the original author or authors.
3 *
4 * Licensed under the Gnu General Pubic License, Version 2.0 (the
5 * "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/gpl-license.php
9 *
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.
13 * See the Gnu General Public License for more details.
14 */
15 package org.figure8.join.view;
16
17 import org.figure8.join.businessobjects.environment.VersionedResource;
18 import org.figure8.join.businessobjects.environment.VersionedResourceUpdate;
19
20 import java.util.List;
21 import java.util.Date;
22 import java.util.ArrayList;
23 import java.io.Serializable;
24 /**
25 * This a JavaBean encasulating a VersionedResource domain model object
26 * and its information on resource updates done during a tracking period.
27 * Instance of <code>VersionedResourceTrackingView</code> class are intended
28 * to be stored within an Http layer context.
29 * @author <a href="mailto:laurent.broudoux@free.fr">Laurent Broudoux</a>
30 * @version $Revision: 1.1 $
31 */
32 public class VersionedResourceTrackingView implements Serializable{
33
34
35
36 /** The start date of the tracking period for VersionedResource changes */
37 protected Date startDate;
38 /** The end date of the tracking period for VersionedResource changes */
39 protected Date endDate;
40 /** The encapsulated versioned resource domain object */
41 protected VersionedResource resource = null;
42
43 /** The list of version updates done during tracking period */
44 private List versionUpdates = new ArrayList();
45
46
47
48
49 /**
50 * Creates a new instance of VersionedResourceTrackingView
51 * @param resource The encapsulated versioned resource domain object
52 * @param startDate The start date of the tracking period
53 * @param endDate The end date of the tracking period
54 */
55 public VersionedResourceTrackingView(VersionedResource resource, Date startDate, Date endDate){
56 this.resource = resource;
57 this.startDate = startDate;
58 this.endDate = endDate;
59 }
60
61
62
63
64 /** @return The start date of the tracking period for VersionedResource changes */
65 public Date getStartDate(){
66 return startDate;
67 }
68 /** @return The end date of the tracking period for VersionedResource changes */
69 public Date getEndDate(){
70 return endDate;
71 }
72 /** @return The encapsulated versioned resource domain object */
73 public VersionedResource getResource(){
74 return resource;
75 }
76
77 /**
78 * Add a VersionedResourceUpdate that was done during the tracking period
79 * @param update The versioned resource update to add
80 */
81 public void addVersionUpdate(VersionedResourceUpdate update){
82 versionUpdates.add(update);
83 }
84
85 /** @return A list of {@code org.figure8.join.businessobjects.environment.VersionedResourceUpdate}s */
86 public List getVersionUpdates(){
87 return versionUpdates;
88 }
89 }