View Javadoc

1   /*
2    * Copyright 2004 Carlos Sanchez.
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 net.sf.oness.common.model.auditing;
17  
18  import net.sf.oness.common.model.temporal.DateRange;
19  
20  /***
21   * Interface to be implemented by business objects that allow data auditing
22   * 
23   * @author Carlos Sanchez
24   * @version $Revision: 1.3 $
25   */
26  public interface Auditable {
27  
28      /***
29       * The identifier of each version of each object
30       * 
31       * @return
32       */
33      public Long getId();
34  
35      /***
36       * 
37       * @param id
38       */
39      public void setId(Long id);
40  
41      /***
42       * @param code
43       *            The code to set.
44       */
45      public void setCode(Long code);
46  
47      /***
48       * The code that identifies all versions of the same object
49       * 
50       * @return Returns the code.
51       */
52      public Long getCode();
53  
54      /***
55       * 
56       * @param transactionTime
57       */
58      public void setTransactionTime(DateRange transactionTime);
59  
60      /***
61       * Range of time when the data is entered into the system
62       * 
63       * @return
64       */
65      public DateRange getTransactionTime();
66  
67      /***
68       * Set the user that created this object
69       * 
70       * @param userName
71       */
72      public void setCreatedBy(String userName);
73  
74      /***
75       * Get the user that created this object
76       * 
77       * @return Returns the userName.
78       */
79      public String getCreatedBy();
80  
81      /***
82       * Set the user that deleted this object
83       * 
84       * @param userName
85       */
86      public void setDeletedBy(String userName);
87  
88      /***
89       * Get the user that deleted this object
90       * 
91       * @return Returns the userName.
92       */
93      public String getDeletedBy();
94  
95      /***
96       * Cloned objects can't share collection references.
97       * 
98       * @see java.lang.Object#clone()
99       */
100     public Object clone();
101 
102 }