View Javadoc
1   /*
2    * Copyright (C) 2007-2012 Argeo GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *         http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.argeo.connect.versioning;
17  
18  import java.util.Calendar;
19  import java.util.Map;
20  
21  /**
22   * Generic Object that enables the creation of history reports based on a JCR
23   * versionable node. userId and creation date are added to the map of
24   * PropertyDiff, together with the reference version ID
25   * 
26   * These two fields might be null
27   * 
28   */
29  public class VersionDiff {
30  
31  	private String refVersionId;
32  	private String userId;
33  	private Map<String, ItemDiff> diffs;
34  	private Calendar updateTime;
35  
36  	/**
37  	 * 
38  	 * @param referenceVersionId
39  	 * @param userId
40  	 * @param updateTime
41  	 * @param diffs
42  	 */
43  	public VersionDiff(String referenceVersionId, String userId,
44  			Calendar updateTime, Map<String, ItemDiff> diffs) {
45  		this.refVersionId = referenceVersionId;
46  		this.userId = userId;
47  		this.updateTime = updateTime;
48  		this.diffs = diffs;
49  	}
50  
51  	public String getReferenceVersionId() {
52  		return refVersionId;
53  	}
54  
55  	public String getUserId() {
56  		return userId;
57  	}
58  
59  	public Map<String, ItemDiff> getDiffs() {
60  		return diffs;
61  	}
62  
63  	public Calendar getUpdateTime() {
64  		return updateTime;
65  	}
66  }