KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > localhistory > store > LocalHistoryStore


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.localhistory.store;
20
21 import java.beans.PropertyChangeListener JavaDoc;
22 import java.io.File JavaDoc;
23
24 /**
25  *
26  * @author Tomas Stupka
27  */

28 // XXX what about multifile dataobjects ?
29
public interface LocalHistoryStore {
30     
31     
32     /**
33      *
34      */

35     public String JavaDoc PROPERTY_CHANGED = "LocalHistoryStore.changed"; // NOI18N
36

37     
38     // events
39

40     /**
41      *
42      * @param file
43      * @param ts
44      */

45     public void fileCreate(File JavaDoc file, long ts);
46     
47     /**
48      *
49      * @param file
50      * @param ts
51      */

52     public void fileDelete(File JavaDoc file, long ts);
53     
54     // XXX merge fileCreateFromMove and fileDeleteFromMove into one call
55
/**
56      *
57      * @param from
58      * @param to
59      * @param ts
60      */

61     public void fileCreateFromMove(File JavaDoc from, File JavaDoc to, long ts);
62     
63     /**
64      *
65      * @param from
66      * @param to
67      * @param ts
68      */

69     public void fileDeleteFromMove(File JavaDoc from, File JavaDoc to, long ts);
70  
71     /**
72      *
73      * @param file
74      * @param ts
75      */

76     public void fileChange(File JavaDoc file, long ts);
77     
78     
79     // edit
80

81     /**
82      *
83      *
84      * @param file
85      * @param ts
86      * @param label
87      */

88     public void setLabel(File JavaDoc file, long ts, String JavaDoc label);
89     
90     // listeners
91

92     /**
93      *
94      * Adds a property change listener
95      *
96      * @param l the property change listener
97      */

98     public void addPropertyChangeListener(PropertyChangeListener JavaDoc l);
99     
100     /**
101      *
102      * Removes a property change listener
103      *
104      * @param l the property change listener
105      */

106     public void removePropertyChangeListener(PropertyChangeListener JavaDoc l);
107     
108     
109     // data
110

111     /**
112      * Returns all entries for a file
113      *
114      * @param file the file for which the entries are to be retrieved
115      * @return StoreEntry[] all entries present in the storage
116      */

117     public StoreEntry[] getStoreEntries(File JavaDoc file);
118     
119     /**
120      * Returns an entry representig the given files state in time ts
121      *
122      * @param file the file for which the entries are to be retrieved
123      * @param ts the time for which the StoreEntry has to retrieved
124      * @return StoreEntry a StoreEntry representing the given file in time ts.
125      * <tt>null</tt> if file is a directory or there is no entry with a timestamp &lt; <tt>ts</tt>
126      */

127     public StoreEntry getStoreEntry(File JavaDoc file, long ts);
128     
129     /**
130      *
131      *
132      * @param root
133      * @param files
134      * @param ts
135      * @return
136      */

137     public StoreEntry[] getFolderState(File JavaDoc root, File JavaDoc[] files, long ts);
138     
139     /**
140      *
141      *
142      * @param root
143      * @return
144      */

145     public StoreEntry[] getDeletedFiles(File JavaDoc root);
146     
147     /**
148      *
149      * Deletes a StoreEntry from the storage represented by the given file and timestamp
150      *
151      * @param file the file for which a StoreEntry has to be deleted
152      * @param ts the timestamp for which a StoreEntry has to be deleted
153      *
154      */

155     public void deleteEntry(File JavaDoc file, long ts);
156         
157     /**
158      *
159      * Removes all entries, their labels and all tags from the storage
160      * which are related to a time &lt; System.currentTimeMillis() - ttl;
161      *
162      * @param ttl
163      */

164     public void cleanUp(long ttl);
165 }
166
Popular Tags