KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > jcr > Repository


1 /*
2  * $Id: Repository.java,v 1.2 2004/07/24 00:16:21 benjmestrallet Exp $
3  *
4  * Copyright 2002-2004 Day Management AG, Switzerland.
5  *
6  * Licensed under the Day RI License, Version 2.0 (the "License"),
7  * as a reference implementation of the following specification:
8  *
9  * Content Repository API for Java Technology, revision 0.12
10  * <http://www.jcp.org/en/jsr/detail?id=170>
11  *
12  * You may not use this file except in compliance with the License.
13  * You may obtain a copy of the License files at
14  *
15  * http://www.day.com/content/en/licenses/day-ri-license-2.0
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */

24 package javax.jcr;
25
26 /**
27  * The entry point into the content repository.
28  * Represents the entry point into the content repository. Typically the object
29  * implementing this interface will be acquired from a JNDI-compatible
30  * naming and directory service.
31  *
32  * @author Peeter Piegaze
33  * @author Stefan Guggisberg
34  */

35 public interface Repository {
36
37   /**
38    * Login, creating a new ticket for the given credentials and specified
39    * workspace. If login fails, a <code>LoginException</code> is thrown and
40    * no valid ticket is generated. How the repository treats an attempt to
41    * connect with <code>null</code> <code>credentials</code> and or a
42    * <code>null</code> <code>workspaceName</code> is a matter of
43    * implementation. Possibilities include allowing an anonymous connection in
44    * cases of <code>null credentials</code> and connecting to a default
45    * workspace in cases of a <code>null workspaceName</code>.
46    * <p/>
47    * <b>Level 2:</b>
48    * <p/>
49    * Returns a <code>{@link javax.jcr.xa.XATicket}</code> object in order to
50    * support transactions.
51    * <p/>
52    *
53    * @param credentials The credentials of the user
54    * @param workspaceName the name of a workspace.
55    * @return a valid ticket for the user to access the repository.
56    * @throws LoginException If the login authentication fails.
57    * @throws NoSuchWorkspaceException If the specified <code>workspaceName</code>
58    * is not recognized.
59    */

60   public Ticket login(Credentials credentials, String JavaDoc workspaceName)
61       throws LoginException, NoSuchWorkspaceException;
62 }
63
Popular Tags