001: /*
002: * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Scott Ferguson
028: */
029:
030: package com.caucho.jcr.base;
031:
032: import org.xml.sax.ContentHandler;
033:
034: import javax.jcr.*;
035: import javax.jcr.lock.LockException;
036: import javax.jcr.nodetype.ConstraintViolationException;
037: import javax.jcr.nodetype.NodeTypeManager;
038: import javax.jcr.observation.ObservationManager;
039: import javax.jcr.query.QueryManager;
040: import javax.jcr.version.Version;
041: import javax.jcr.version.VersionException;
042: import java.io.IOException;
043: import java.io.InputStream;
044:
045: /**
046: * Represents a open workspace to a repository.
047: */
048: public class BaseWorkspace implements Workspace {
049: private String _name;
050: private Session _session;
051:
052: public BaseWorkspace(String name, Session session) {
053: _name = name;
054: _session = session;
055: }
056:
057: /**
058: * Returns the owning session.
059: */
060: public Session getSession() {
061: return _session;
062: }
063:
064: /**
065: * Returns the workspace name.
066: */
067: public String getName() {
068: return _name;
069: }
070:
071: /**
072: * Copy from one node to another.
073: */
074: public void copy(String srcAbsPath, String destAbsPath)
075: throws ConstraintViolationException, VersionException,
076: AccessDeniedException, PathNotFoundException,
077: ItemExistsException, LockException, RepositoryException {
078: throw new UnsupportedOperationException(getClass().getName());
079: }
080:
081: /**
082: * Copy from one node to another, starting in another workspace
083: */
084: public void copy(String srcWorkspace, String srcAbsPath,
085: String destAbsPath) throws NoSuchWorkspaceException,
086: ConstraintViolationException, VersionException,
087: AccessDeniedException, PathNotFoundException,
088: ItemExistsException, LockException, RepositoryException {
089: throw new UnsupportedOperationException(getClass().getName());
090: }
091:
092: /**
093: * Clones a node from another workspace.
094: */
095: public void clone(String srcWorkspace, String srcAbsPath,
096: String destAbsPath, boolean removeExisting)
097: throws NoSuchWorkspaceException,
098: ConstraintViolationException, VersionException,
099: AccessDeniedException, PathNotFoundException,
100: ItemExistsException, LockException, RepositoryException {
101: throw new UnsupportedOperationException(getClass().getName());
102: }
103:
104: /**
105: * Move a node from another workspace.
106: */
107: public void move(String srcAbsPath, String destAbsPath)
108: throws ConstraintViolationException, VersionException,
109: AccessDeniedException, PathNotFoundException,
110: ItemExistsException, LockException, RepositoryException {
111: throw new UnsupportedOperationException(getClass().getName());
112: }
113:
114: /**
115: * Restores from given versions.
116: */
117: public void restore(Version[] versions, boolean removeExisting)
118: throws ItemExistsException,
119: UnsupportedRepositoryOperationException, VersionException,
120: LockException, InvalidItemStateException,
121: RepositoryException {
122: throw new UnsupportedOperationException(getClass().getName());
123: }
124:
125: /**
126: * Returns the query manager.
127: */
128: public QueryManager getQueryManager() throws RepositoryException {
129: throw new UnsupportedOperationException(getClass().getName());
130: }
131:
132: /**
133: * Returns the namespace registry.
134: */
135: public NamespaceRegistry getNamespaceRegistry()
136: throws RepositoryException {
137: throw new UnsupportedOperationException(getClass().getName());
138: }
139:
140: /**
141: * Returns the node type manager.
142: */
143: public NodeTypeManager getNodeTypeManager()
144: throws RepositoryException {
145: throw new UnsupportedOperationException(getClass().getName());
146: }
147:
148: /**
149: * Returns the observation manager.
150: */
151: public ObservationManager getObservationManager()
152: throws UnsupportedRepositoryOperationException,
153: RepositoryException {
154: throw new UnsupportedOperationException(getClass().getName());
155: }
156:
157: /**
158: * Returns the workspace names.
159: */
160: public String[] getAccessibleWorkspaceNames()
161: throws RepositoryException {
162: throw new UnsupportedOperationException(getClass().getName());
163: }
164:
165: /**
166: * Returns a handler for importing data.
167: */
168: public ContentHandler getImportContentHandler(String parentAbsPath,
169: int uuidBehavior) throws PathNotFoundException,
170: ConstraintViolationException, VersionException,
171: LockException, AccessDeniedException, RepositoryException {
172: throw new UnsupportedOperationException(getClass().getName());
173: }
174:
175: /**
176: * Import based on XML.
177: */
178: public void importXML(String parentAbsPath, InputStream in,
179: int uuidBehavior) throws IOException,
180: PathNotFoundException, ItemExistsException,
181: ConstraintViolationException,
182: InvalidSerializedDataException, LockException,
183: AccessDeniedException, RepositoryException {
184: throw new UnsupportedOperationException(getClass().getName());
185: }
186: }
|