KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > copy > CopyServicePolicies


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.copy;
18
19 import java.util.Map JavaDoc;
20
21 import org.alfresco.repo.policy.ClassPolicy;
22 import org.alfresco.repo.policy.PolicyScope;
23 import org.alfresco.service.cmr.repository.NodeRef;
24 import org.alfresco.service.cmr.repository.StoreRef;
25 import org.alfresco.service.namespace.QName;
26
27 /**
28  * @author Roy Wetherall
29  */

30 public interface CopyServicePolicies
31 {
32     /**
33      * Policy invoked when a <b>node</b> is copied
34      */

35     public interface OnCopyNodePolicy extends ClassPolicy
36     {
37         /**
38          * @param classRef the type of node being copied
39          * @param sourceNodeRef node being copied
40          * @param destinationStoreRef the destination store reference
41          * @param copyToNewNode indicates whether we are copying to a new node or not
42          * @param copyDetails modifiable <b>node</b> details
43          */

44         public void onCopyNode(
45                 QName classRef,
46                 NodeRef sourceNodeRef,
47                 StoreRef destinationStoreRef,
48                 boolean copyToNewNode,
49                 PolicyScope copyDetails);
50     }
51     
52     /**
53      * Policy invoked when the copy operation invoked on a <b>node</b> is complete.
54      * <p>
55      * The copy map contains all the nodes created during the copy, this helps to re-map
56      * any potentially relative associations.
57      */

58     public interface OnCopyCompletePolicy extends ClassPolicy
59     {
60         /**
61          * @param classRef the type of the node that was copied
62          * @param sourceNodeRef the origional node
63          * @param destinationRef the destination node
64          * @param copyMap a map containing all the nodes that have been created during the copy
65          */

66         public void onCopyComplete(
67                 QName classRef,
68                 NodeRef sourceNodeRef,
69                 NodeRef destinationRef,
70                 boolean copyToNewNode,
71                 Map JavaDoc<NodeRef, NodeRef> copyMap);
72     }
73 }
74
Popular Tags