KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > common > NamespaceAccessToken


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessToken.java,v 1.22 2004/08/05 15:42:32 unico Exp $
3  * $Revision: 1.22 $
4  * $Date: 2004/08/05 15:42:32 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999-2002 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23
24 package org.apache.slide.common;
25
26 import java.io.IOException JavaDoc;
27 import java.io.Reader JavaDoc;
28 import java.io.Writer JavaDoc;
29
30 import javax.transaction.TransactionManager JavaDoc;
31 import javax.transaction.UserTransaction JavaDoc;
32
33 import org.apache.slide.content.Content;
34 import org.apache.slide.lock.Lock;
35 import org.apache.slide.macro.Macro;
36 import org.apache.slide.search.Search;
37 import org.apache.slide.security.Security;
38 import org.apache.slide.structure.Structure;
39 import org.apache.slide.util.conf.Configuration;
40 import org.apache.slide.util.conf.ConfigurationException;
41 import org.apache.slide.util.logger.Logger;
42 import org.xml.sax.SAXException JavaDoc;
43
44 /**
45  * The <code>NamespaceAccessToken</code> is an interface used to completely
46  * hide the real {@link Namespace Namespace} object reference from the client
47  * application. It is used by Slide to authenticate and control any operations
48  * on the namespace.
49  *
50  * <p>
51  * Using the NamespaceAccessToken, the application can obtain access to the
52  * helper interfaces (<code>Content</code>, <code>Lock</code>,
53  * <code>Macro</code>, <code>Security</code> and <code>Structure</code>).
54  * </p>
55  * <p>
56  * The NamespaceAccessToken object implements the <tt>UserTransaction</tt>
57  * interface (see the Java Transaction API documentation for more details)
58  * to allow the client to control transaction demarcation.
59  * </p>
60  *
61  * @version $Revision: 1.22 $
62  */

63 public interface NamespaceAccessToken extends UserTransaction JavaDoc {
64     
65     
66     // ------------------------------------------------------ Interface Methods
67

68     
69     /**
70      * Retrive the namespace configuration.
71      *
72      * @return NamespaceConfig Namespace configuration
73      */

74     NamespaceConfig getNamespaceConfig();
75     
76     
77     /**
78      * Import data from configuration object.
79      *
80      * @param token SlideToken, used for access to the namespace
81      * @param objectNodeConfiguration Configuration object
82      * @exception ConfigurationException Something went wrong during the
83      * reading of the XML
84      * @exception UnknownObjectClassException Object class not found
85      * @exception ServiceAccessException Error accessing service
86      */

87     void importData(SlideToken token,
88                     Configuration objectNodeConfiguration)
89         throws ConfigurationException, UnknownObjectClassException,
90         ServiceAccessException;
91     
92     
93     /**
94      * Import data from reader.
95      *
96      * @param token SlideToken, used for access to the namespace
97      * @param reader Reader
98      * @exception ConfigurationException Something went wrong during the
99      * reading of the XML
100      * @exception UnknownObjectClassException Object class not found
101      * @exception ServiceAccessException Error accessing service
102      */

103     void importData(SlideToken token, Reader JavaDoc reader)
104         throws ConfigurationException, UnknownObjectClassException,
105         ServiceAccessException, SAXException JavaDoc, IOException JavaDoc;
106     
107     
108     /**
109      * Saves Slide Data to XML.
110      *
111      * @param writer Writer
112      * @exception SlideException
113      */

114     void exportData(SlideToken token, Writer JavaDoc writer)
115         throws SlideException;
116     
117     
118     /**
119      * Saves Slide Data to XML.
120      *
121      * @param writer Writer
122      * @param startNode Start generating XML from this node of the Slide tree
123      * @exception SlideException
124      */

125     void exportData(SlideToken token, Writer JavaDoc writer, String JavaDoc startNode)
126         throws SlideException;
127     
128     
129     /**
130      * Get the data helper.
131      *
132      * @return Data Data helper
133      */

134     Structure getStructureHelper();
135     
136     
137     /**
138      * Get the version helper.
139      *
140      * @return Version Version helper
141      */

142     Content getContentHelper();
143     
144     
145     /**
146      * Get the lock helper.
147      *
148      * @return Lock Lock helper
149      */

150     Lock getLockHelper();
151     
152     
153     /**
154      * Get the lock helper.
155      *
156      * @return Lock Lock helper
157      */

158     Search getSearchHelper();
159     
160     
161     /**
162      * Get the security helper.
163      *
164      * @return Security Security helper
165      */

166     Security getSecurityHelper();
167     
168     
169     /**
170      * Get the macro helper.
171      *
172      * @return Macro Macro helper
173      */

174     Macro getMacroHelper();
175     
176     
177     /**
178      * Disconnect.
179      */

180     void disconnect();
181     
182     
183     /**
184      * Get namespace name.
185      *
186      * @return String namespace name.
187      */

188     String JavaDoc getName();
189     
190     /**
191      * Builds a new uri object to access this namespace.
192      *
193      * @param token SlideToken
194      * @param uri Requested Uri
195      * @return Uri
196      */

197     public Uri getUri(SlideToken token, String JavaDoc uri);
198     
199
200     /**
201      * Get namespace logger.
202      *
203      * @return The logger associated with the namespace.
204      */

205     Logger getLogger();
206
207     public TransactionManager JavaDoc getTransactionManager();
208
209 }
210
Popular Tags