KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > repository > Provider


1 /**
2  *
3  * Magnolia and its source-code is licensed under the LGPL.
4  * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5  * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6  * you are required to provide proper attribution to obinary.
7  * If you reproduce or distribute the document without making any substantive modifications to its content,
8  * please use the following attribution line:
9  *
10  * Copyright 1993-2006 obinary Ltd. (http://www.obinary.com) All rights reserved.
11  *
12  */

13 package info.magnolia.repository;
14
15 import java.io.InputStream JavaDoc;
16
17 import javax.jcr.Repository;
18 import javax.jcr.RepositoryException;
19 import javax.jcr.Workspace;
20
21
22 /**
23  * @author Sameer Charles
24  * @author Fabrizio Giustina
25  * @version $Id: Provider.java 6341 2006-09-12 09:18:27Z philipp $
26  */

27 public interface Provider {
28
29     /**
30      * Initializes repository, this depends on the underlying repository implementation. Use any available method to get
31      * the instance of Repository.
32      * @param repositoryMapping key value pars as define in repository.xml
33      * @throws RepositoryNotInitializedException
34      */

35     void init(RepositoryMapping repositoryMapping) throws RepositoryNotInitializedException;
36
37     /**
38      * Gets the repository instance initialized on init() call.
39      * @throws RepositoryNotInitializedException if init failed to get repository
40      */

41     Repository getUnderlineRepository() throws RepositoryNotInitializedException;
42
43     /**
44      * Register namespace with the repository. Refer JCR-170 specifications.
45      * @param prefix namespace prefix
46      * @param uri namespace URI
47      * @param workspace session workspace instance
48      * @throws RepositoryException
49      */

50     void registerNamespace(String JavaDoc prefix, String JavaDoc uri, Workspace workspace) throws RepositoryException;
51
52     /**
53      * Unregister namespace with the repository.
54      * @param prefix as registered previously
55      * @param workspace session workspace instance
56      * @throws RepositoryException
57      */

58     void unregisterNamespace(String JavaDoc prefix, Workspace workspace) throws RepositoryException;
59
60     /**
61      * Node type registration is entirely dependent on the implementation. Refer JSR-170 specifications.
62      * @throws RepositoryException
63      */

64     void registerNodeTypes() throws RepositoryException;
65
66     /**
67      * Node type registration is entirely dependent on the implementation. Refer JSR-170 specifications.
68      * @throws RepositoryException
69      */

70     void registerNodeTypes(String JavaDoc configuration) throws RepositoryException;
71
72     /**
73      * Node type registration is entirely dependent on the implementation. Refer JSR-170 specifications.
74      * @param stream , stream type depends on the implementation of this method
75      * @throws RepositoryException
76      */

77     void registerNodeTypes(InputStream JavaDoc stream) throws RepositoryException;
78
79     /**
80      * Register a new workspace in the current repository
81      * @param workspaceName workspace name
82      * @return <code>true</code> true if the workspace is registered now of <code>false</code> if it was already
83      * registered
84      * @throws RepositoryException if any exception occours during registration
85      */

86     boolean registerWorkspace(String JavaDoc workspaceName) throws RepositoryException;
87 }
88
Popular Tags