KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > importer > Importer


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.importer;
18
19 import java.util.Map JavaDoc;
20
21 import org.alfresco.service.cmr.repository.NodeRef;
22 import org.alfresco.service.namespace.QName;
23
24 /**
25  * The Importer interface encapusulates the strategy for importing
26  * a node into the Repository.
27  *
28  * @author David Caruana
29  */

30 public interface Importer
31 {
32     /**
33      * @return the root node to import into
34      */

35     public NodeRef getRootRef();
36     
37     /**
38      * @return the root child association type to import under
39      */

40     public QName getRootAssocType();
41
42     /**
43      * Signal start of import
44      */

45     public void start();
46
47     /**
48      * Signal end of import
49      */

50     public void end();
51
52     /**
53      * Signal import error
54      */

55     public void error(Throwable JavaDoc e);
56     
57     /**
58      * Import meta-data
59      */

60     public void importMetaData(Map JavaDoc<QName, String JavaDoc> properties);
61     
62     /**
63      * Import a node
64      *
65      * @param node the node description
66      * @return the node ref of the imported node
67      */

68     public NodeRef importNode(ImportNode node);
69
70     /**
71      * Resolve path within context of root reference
72      *
73      * @param path the path to resolve
74      * @return node reference
75      */

76     public NodeRef resolvePath(String JavaDoc path);
77     
78     /**
79      * Signal completion of node import
80      *
81      * @param nodeRef the node ref of the imported node
82      */

83     public void childrenImported(NodeRef nodeRef);
84 }
85
Popular Tags