KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > jcr > base > BaseWorkspace


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Scott Ferguson
28  */

29
30 package com.caucho.jcr.base;
31
32 import org.xml.sax.ContentHandler JavaDoc;
33
34 import javax.jcr.*;
35 import javax.jcr.lock.LockException;
36 import javax.jcr.nodetype.ConstraintViolationException;
37 import javax.jcr.nodetype.NodeTypeManager;
38 import javax.jcr.observation.ObservationManager;
39 import javax.jcr.query.QueryManager;
40 import javax.jcr.version.Version;
41 import javax.jcr.version.VersionException;
42 import java.io.IOException JavaDoc;
43 import java.io.InputStream JavaDoc;
44
45 /**
46  * Represents a open workspace to a repository.
47  */

48 public class BaseWorkspace implements Workspace {
49   private String JavaDoc _name;
50   private Session _session;
51
52   public BaseWorkspace(String JavaDoc name, Session session)
53   {
54     _name = name;
55     _session = session;
56   }
57   
58   /**
59    * Returns the owning session.
60    */

61   public Session getSession()
62   {
63     return _session;
64   }
65   
66   /**
67    * Returns the workspace name.
68    */

69   public String JavaDoc getName()
70   {
71     return _name;
72   }
73
74   /**
75    * Copy from one node to another.
76    */

77   public void copy(String JavaDoc srcAbsPath, String JavaDoc destAbsPath)
78     throws ConstraintViolationException,
79        VersionException,
80        AccessDeniedException,
81        PathNotFoundException,
82        ItemExistsException,
83        LockException,
84        RepositoryException
85   {
86     throw new UnsupportedOperationException JavaDoc(getClass().getName());
87   }
88   
89   /**
90    * Copy from one node to another, starting in another workspace
91    */

92   public void copy(String JavaDoc srcWorkspace,
93            String JavaDoc srcAbsPath,
94            String JavaDoc destAbsPath)
95     throws NoSuchWorkspaceException,
96        ConstraintViolationException,
97        VersionException,
98        AccessDeniedException,
99        PathNotFoundException,
100        ItemExistsException,
101        LockException,
102        RepositoryException
103   {
104     throw new UnsupportedOperationException JavaDoc(getClass().getName());
105   }
106   
107   /**
108    * Clones a node from another workspace.
109    */

110   public void clone(String JavaDoc srcWorkspace,
111             String JavaDoc srcAbsPath,
112             String JavaDoc destAbsPath,
113             boolean removeExisting)
114     throws NoSuchWorkspaceException,
115        ConstraintViolationException,
116        VersionException,
117        AccessDeniedException,
118        PathNotFoundException,
119        ItemExistsException,
120        LockException,
121        RepositoryException
122   {
123     throw new UnsupportedOperationException JavaDoc(getClass().getName());
124   }
125
126   /**
127    * Move a node from another workspace.
128    */

129   public void move(String JavaDoc srcAbsPath, String JavaDoc destAbsPath)
130     throws ConstraintViolationException,
131        VersionException,
132        AccessDeniedException,
133        PathNotFoundException,
134        ItemExistsException,
135        LockException,
136        RepositoryException
137   {
138     throw new UnsupportedOperationException JavaDoc(getClass().getName());
139   }
140   
141   /**
142    * Restores from given versions.
143    */

144   public void restore(Version[] versions, boolean removeExisting)
145     throws ItemExistsException,
146        UnsupportedRepositoryOperationException,
147        VersionException,
148        LockException,
149        InvalidItemStateException,
150        RepositoryException
151   {
152     throw new UnsupportedOperationException JavaDoc(getClass().getName());
153   }
154   
155   /**
156    * Returns the query manager.
157    */

158   public QueryManager getQueryManager()
159     throws RepositoryException
160   {
161     throw new UnsupportedOperationException JavaDoc(getClass().getName());
162   }
163   
164   /**
165    * Returns the namespace registry.
166    */

167   public NamespaceRegistry getNamespaceRegistry()
168     throws RepositoryException
169   {
170     throw new UnsupportedOperationException JavaDoc(getClass().getName());
171   }
172   
173   /**
174    * Returns the node type manager.
175    */

176   public NodeTypeManager getNodeTypeManager()
177     throws RepositoryException
178   {
179     throw new UnsupportedOperationException JavaDoc(getClass().getName());
180   }
181   
182   /**
183    * Returns the observation manager.
184    */

185   public ObservationManager getObservationManager()
186     throws UnsupportedRepositoryOperationException,
187        RepositoryException
188   {
189     throw new UnsupportedOperationException JavaDoc(getClass().getName());
190   }
191   
192   /**
193    * Returns the workspace names.
194    */

195   public String JavaDoc[] getAccessibleWorkspaceNames()
196     throws RepositoryException
197   {
198     throw new UnsupportedOperationException JavaDoc(getClass().getName());
199   }
200   
201   /**
202    * Returns a handler for importing data.
203    */

204   public ContentHandler JavaDoc getImportContentHandler(String JavaDoc parentAbsPath,
205                         int uuidBehavior)
206     throws PathNotFoundException,
207        ConstraintViolationException,
208        VersionException,
209        LockException,
210        AccessDeniedException,
211        RepositoryException
212   {
213     throw new UnsupportedOperationException JavaDoc(getClass().getName());
214   }
215   
216   /**
217    * Import based on XML.
218    */

219   public void importXML(String JavaDoc parentAbsPath,
220             InputStream JavaDoc in,
221             int uuidBehavior)
222     throws IOException JavaDoc,
223        PathNotFoundException,
224        ItemExistsException,
225        ConstraintViolationException,
226        InvalidSerializedDataException,
227        LockException,
228        AccessDeniedException,
229        RepositoryException
230   {
231     throw new UnsupportedOperationException JavaDoc(getClass().getName());
232   }
233 }
234
Popular Tags