KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > repository > RepositoryListener


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
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.outerj.daisy.repository;
17
18
19 /**
20  * Listener interface for repository related events.
21  *
22  * <p>The events are fired synchronously after their corresponding
23  * operation has completed successfully. Therefore, it is very important
24  * that event listeners operate very quickly, since otherwise they can
25  * seriously impact basic document operations.
26  *
27  * <p>Event listeners are registered through {@link Repository#addListener(RepositoryListener)}.
28  *
29  */

30 public interface RepositoryListener {
31     /**
32      * @param id the id of the item to which the event applies
33      * @param updateCount the "update count" of the item (see the getUpdateCount method on various entities
34      * such as documents, users, field/part/document types, etc), if applicable, otherwise -1
35      */

36     void repositoryEvent(RepositoryEventType eventType, long id, long updateCount);
37
38     /**
39      * A specialiased repository event callback for events that apply to variants, since those
40      * needs a tripple of IDs to be identified.
41      */

42     void variantEvent(DocumentVariantEventType eventType, long documentId, long branchId, long languageId, long updateCount);
43 }
44
Popular Tags