001: /**
002: /*
003: * Copyright 2005 JBoss Inc
004: *
005: * Licensed under the Apache License, Version 2.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.drools.brms.server.repository;
017:
018: import java.io.IOException;
019: import java.io.InputStream;
020: import java.io.OutputStream;
021: import java.security.AccessControlException;
022:
023: import javax.jcr.AccessDeniedException;
024: import javax.jcr.Credentials;
025: import javax.jcr.InvalidItemStateException;
026: import javax.jcr.InvalidSerializedDataException;
027: import javax.jcr.Item;
028: import javax.jcr.ItemExistsException;
029: import javax.jcr.ItemNotFoundException;
030: import javax.jcr.LoginException;
031: import javax.jcr.NamespaceException;
032: import javax.jcr.Node;
033: import javax.jcr.PathNotFoundException;
034: import javax.jcr.Repository;
035: import javax.jcr.RepositoryException;
036: import javax.jcr.Session;
037: import javax.jcr.UnsupportedRepositoryOperationException;
038: import javax.jcr.ValueFactory;
039: import javax.jcr.Workspace;
040: import javax.jcr.lock.LockException;
041: import javax.jcr.nodetype.ConstraintViolationException;
042: import javax.jcr.nodetype.NoSuchNodeTypeException;
043: import javax.jcr.version.VersionException;
044:
045: import org.xml.sax.ContentHandler;
046: import org.xml.sax.SAXException;
047:
048: class MockSession implements Session {
049:
050: public boolean loggedout;
051:
052: public void addLockToken(String arg0) {
053:
054: }
055:
056: public void checkPermission(String arg0, String arg1)
057: throws AccessControlException, RepositoryException {
058:
059: }
060:
061: public void exportDocumentView(String arg0, ContentHandler arg1,
062: boolean arg2, boolean arg3) throws PathNotFoundException,
063: SAXException, RepositoryException {
064:
065: }
066:
067: public void exportDocumentView(String arg0, OutputStream arg1,
068: boolean arg2, boolean arg3) throws IOException,
069: PathNotFoundException, RepositoryException {
070:
071: }
072:
073: public void exportSystemView(String arg0, ContentHandler arg1,
074: boolean arg2, boolean arg3) throws PathNotFoundException,
075: SAXException, RepositoryException {
076:
077: }
078:
079: public void exportSystemView(String arg0, OutputStream arg1,
080: boolean arg2, boolean arg3) throws IOException,
081: PathNotFoundException, RepositoryException {
082:
083: }
084:
085: public Object getAttribute(String arg0) {
086:
087: return null;
088: }
089:
090: public String[] getAttributeNames() {
091:
092: return null;
093: }
094:
095: public ContentHandler getImportContentHandler(String arg0, int arg1)
096: throws PathNotFoundException, ConstraintViolationException,
097: VersionException, LockException, RepositoryException {
098:
099: return null;
100: }
101:
102: public Item getItem(String arg0) throws PathNotFoundException,
103: RepositoryException {
104:
105: return null;
106: }
107:
108: public String[] getLockTokens() {
109:
110: return null;
111: }
112:
113: public String getNamespacePrefix(String arg0)
114: throws NamespaceException, RepositoryException {
115:
116: return null;
117: }
118:
119: public String[] getNamespacePrefixes() throws RepositoryException {
120:
121: return null;
122: }
123:
124: public String getNamespaceURI(String arg0)
125: throws NamespaceException, RepositoryException {
126:
127: return null;
128: }
129:
130: public Node getNodeByUUID(String arg0)
131: throws ItemNotFoundException, RepositoryException {
132:
133: return null;
134: }
135:
136: public Repository getRepository() {
137:
138: return null;
139: }
140:
141: public Node getRootNode() throws RepositoryException {
142:
143: return null;
144: }
145:
146: public String getUserID() {
147:
148: return null;
149: }
150:
151: public ValueFactory getValueFactory()
152: throws UnsupportedRepositoryOperationException,
153: RepositoryException {
154:
155: return null;
156: }
157:
158: public Workspace getWorkspace() {
159:
160: return null;
161: }
162:
163: public boolean hasPendingChanges() throws RepositoryException {
164:
165: return false;
166: }
167:
168: public Session impersonate(Credentials arg0) throws LoginException,
169: RepositoryException {
170:
171: return null;
172: }
173:
174: public void importXML(String arg0, InputStream arg1, int arg2)
175: throws IOException, PathNotFoundException,
176: ItemExistsException, ConstraintViolationException,
177: VersionException, InvalidSerializedDataException,
178: LockException, RepositoryException {
179:
180: }
181:
182: public boolean isLive() {
183:
184: return false;
185: }
186:
187: public boolean itemExists(String arg0) throws RepositoryException {
188:
189: return false;
190: }
191:
192: public void logout() {
193: this .loggedout = true;
194:
195: }
196:
197: public void move(String arg0, String arg1)
198: throws ItemExistsException, PathNotFoundException,
199: VersionException, ConstraintViolationException,
200: LockException, RepositoryException {
201:
202: }
203:
204: public void refresh(boolean arg0) throws RepositoryException {
205:
206: }
207:
208: public void removeLockToken(String arg0) {
209:
210: }
211:
212: public void save() throws AccessDeniedException,
213: ItemExistsException, ConstraintViolationException,
214: InvalidItemStateException, VersionException, LockException,
215: NoSuchNodeTypeException, RepositoryException {
216:
217: }
218:
219: public void setNamespacePrefix(String arg0, String arg1)
220: throws NamespaceException, RepositoryException {
221:
222: }
223:
224: }
|