1 /**
2 * Copyright 2005-2007 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.Gateway;
18 import org.figure8.join.businessobjects.environment.PhysicalEnvironment;
19
20 import java.util.Date;
21 import java.io.Serializable;
22 /**
23 * This is a simple JavaBean for representing changes details of a
24 * {@link org.figure8.join.businessobjects.environment.ResourceMapping} for a
25 * {@link org.figure8.join.businessobjects.environment.VersionedResource}.<br/>
26 * This is also can be used for representing changes details of a
27 * {@link org.figure8.join.businessobjects.environment.EISMapping} for a
28 * {@link org.figure8.join.businessobjects.environment.EIS}.<br/>
29 * VersionedResource may have version updates during this mapping period and changes
30 * can thus be represented using transient instance of this bean.
31 * @author <a href="mailto:laurent.broudoux@free.fr">Laurent Broudoux</a>
32 * @version $Revision: 1.2 $
33 */
34 public class VersionedResourceMapping implements Serializable{
35
36
37
38 /** The date this mapping has started being active */
39 private Date startDate;
40 /** The date this mapping has stopped being active */
41 private Date endDate;
42
43 /** The gateway this mapping is for */
44 private Gateway gateway;
45 /** The physical environment this mapping is for */
46 private PhysicalEnvironment physicalEnvironment;
47 /** The tracking view for resource during this mapping period */
48 private VersionedResourceTrackingView resourceView;
49
50
51
52
53 /**
54 * Creates a new instance of VersionedResourceMapping.
55 * @param gateway The gateway this mapping is for
56 * @param resourceView The tracking view for resource during this mapping period
57 * @param startDate The start date of the mapping period
58 * @param endDate The end date of the mapping period
59 */
60 public VersionedResourceMapping(Gateway gateway, VersionedResourceTrackingView resourceView,
61 Date startDate, Date endDate){
62 this.gateway = gateway;
63 this.resourceView = resourceView;
64 this.startDate = startDate;
65 this.endDate = endDate;
66 }
67
68 /**
69 * Creates a new instance of VersionedResourceMapping.
70 * @param environment The physical environment this mapping is for
71 * @param resourceView The tracking view for resource during this mapping period
72 * @param startDate The start date of the mapping period
73 * @param endDate The end date of the mapping period
74 */
75 public VersionedResourceMapping(PhysicalEnvironment environment, VersionedResourceTrackingView resourceView,
76 Date startDate, Date endDate){
77 this.physicalEnvironment = environment;
78 this.resourceView = resourceView;
79 this.startDate = startDate;
80 this.endDate = endDate;
81 }
82
83
84
85
86 /** @return The date this mapping has started being active */
87 public Date getStartDate(){
88 return startDate;
89 }
90 /** @return The date this mapping has stopped being active */
91 public Date getEndDate(){
92 return endDate;
93 }
94 /** @return The encapsulated gateway this mapping is for */
95 public Gateway getGateway(){
96 return gateway;
97 }
98 /** @return The encapsulated environment this mapping is for */
99 public PhysicalEnvironment getEnvironment(){
100 return physicalEnvironment;
101 }
102 /** @return The tracking view for resource during this mapping period */
103 public VersionedResourceTrackingView getResourceView(){
104 return resourceView;
105 }
106 }