KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > jcr > observation > ChangeEvent


1 /*
2  * $Id: ChangeEvent.java,v 1.2 2004/07/24 00:16:23 benjmestrallet Exp $
3  *
4  * Copyright 2002-2004 Day Management AG, Switzerland.
5  *
6  * Licensed under the Day RI License, Version 2.0 (the "License"),
7  * as a reference implementation of the following specification:
8  *
9  * Content Repository API for Java Technology, revision 0.12
10  * <http://www.jcp.org/en/jsr/detail?id=170>
11  *
12  * You may not use this file except in compliance with the License.
13  * You may obtain a copy of the License files at
14  *
15  * http://www.day.com/content/en/licenses/day-ri-license-2.0
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */

24 package javax.jcr.observation;
25
26 import javax.jcr.Item;
27
28 /**
29  * A subclass of <code>Event</code> representing a "change" event.
30  * <p/>
31  * <b>Level 2 only</b>
32  * <p/>
33  * Will always be one of the following types:
34  * <ul>
35  * <li><code>EventType.ITEM_ADDED</code>
36  * <li><code>EventType.ITEM_CHANGED</code>
37  * <li><code>EventType.ITEM_REMOVED</code>
38  * </ul>
39  * For details see the <i>ObservationManager</i> section of the JCR standard document.
40  *
41  * @author Tim Anderson
42  * @author Peeter Piegaze
43  */

44 public interface ChangeEvent extends Event {
45
46   /**
47    * If this event is of <code>EventType.ITEM_ADDED</code> then
48    * this method returns <code>null</code>.
49    * <p/>
50    * If this event is of <code>EventType.ITEM_CHANGED</code> then this
51    * method returns a copy of the item in question as it was <i>before</i>
52    * the change.
53    * <p/>
54    * If this event is of <code>EventType.ITEM_REMOVED</code> then this
55    * method will return the removed item (as will the method
56    * <code>Event.getItem()</code>, that is, they both return the same
57    * item).
58    *
59    * @return a copy of the item as it was before the change or the removed
60    * item if this is an <code>EventType.ITEM_REMOVED</code>.
61    */

62   public Item getOldItem();
63 }
64
Popular Tags