jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r169282 - in /incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/decorator: DecoratorFactory.java SessionDecorator.java
Date Mon, 09 May 2005 11:14:36 GMT
Author: jukka
Date: Mon May  9 04:14:33 2005
New Revision: 169282

URL: http://svn.apache.org/viewcvs?rev=169282&view=rev
Log:
JCR-EXT: 0.16.4.1 upgrades and documentation improvements
	* DecoratorFactory.java: Added more javadocs
	* SessionDecorator.java: Upgraded to 0.16.4.1

Modified:
    incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/decorator/DecoratorFactory.java
    incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/decorator/SessionDecorator.java

Modified: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/decorator/DecoratorFactory.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/decorator/DecoratorFactory.java?rev=169282&r1=169281&r2=169282&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/decorator/DecoratorFactory.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/decorator/DecoratorFactory.java
Mon May  9 04:14:33 2005
@@ -24,14 +24,14 @@
 import javax.jcr.Workspace;
 
 /**
- * Factory interface for creating decorator instances.
- * 
- * @author Jukka Zitting
+ * Factory interface for creating decorator instances. The decorator
+ * classes create new decorator instances using a factory to make it
+ * easier to customize the behaviour of a decorator layer. 
  */
 public interface DecoratorFactory {
 
     /**
-     * Creates a {@link Repository Repository} decorator.
+     * Creates a repository decorator.
      *  
      * @param repository the underlying repository instance
      * @return decorator for the given repository
@@ -39,20 +39,64 @@
     public Repository getRepositoryDecorator(Repository repository);
     
     /**
-     * Creates a {@link Session Session} decorator. 
-     *  
-     * @param repository the repository decorator 
-     * @param session the underlying session instance
+     * Creates a session decorator. The created session decorator will
+     * return the given repository (decorator) instance from the
+     * {@link Session#getRepository() getRepository()} method to avoid
+     * breaking the decorator layer.
+     * <p>
+     * The following example code illustrates how this method should be
+     * used to implement the repository login methods.
+     * <pre>
+     *     DecoratorFactory factory = ...; // The decorator factory
+     *     Session session = ...;          // The underlying session instance
+     *     return factory.getSessionDecorator(this, session);
+     * </pre>
+     *
+     * @param repository the repository (decorator) instance used to create
+     *                   the session decorator
+     * @param session    the underlying session instance
      * @return decorator for the given session
      */
     public Session getSessionDecorator(Repository repository, Session session);
-    
+
+    /**
+     * Creates a workspace decorator.
+     *
+     * @param session   the session (decorator) instance used to create the
+     *                  workspace decorator
+     * @param workspace the underlying workspace instance
+     * @return workspace decorator
+     */
     public Workspace getWorkspaceDecorator(Session session, Workspace workspace);
     
+    /**
+     * Creates a node decorator.
+     *
+     * @param session the session (decorator) instance used to create the
+     *                node decorator
+     * @param node    the underlying node instance
+     * @return node decorator
+     */
     public Node getNodeDecorator(Session session, Node node);
     
+    /**
+     * Creates a property decorator.
+     *
+     * @param session  the session (decorator) instance used to create the
+     *                 property decorator
+     * @param property the underlying property instance
+     * @return property decorator
+     */
     public Property getPropertyDecorator(Session session, Property property);
     
+    /**
+     * Creates an item decorator.
+     *
+     * @param session the session (decorator) instance used to create the
+     *                item decorator
+     * @param item    the underlying item instance
+     * @return item decorator
+     */
     public Item getItemDecorator(Session session, Item item);
     
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/decorator/SessionDecorator.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/decorator/SessionDecorator.java?rev=169282&r1=169281&r2=169282&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/decorator/SessionDecorator.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/decorator/SessionDecorator.java
Mon May  9 04:14:33 2005
@@ -6,7 +6,7 @@
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -36,6 +36,8 @@
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.ValueFactory;
 import javax.jcr.Workspace;
 import javax.jcr.lock.LockException;
 import javax.jcr.nodetype.ConstraintViolationException;
@@ -70,8 +72,8 @@
     /**
      * Forwards the method call to the underlying session.
      */
-    public String getUserId() {
-        return session.getUserId();
+    public String getUserID() {
+        return session.getUserID();
     }
 
     /**
@@ -157,7 +159,7 @@
     /**
      * Forwards the method call to the underlying session.
      */
-    public boolean itemExists(String path) {
+    public boolean itemExists(String path) throws RepositoryException {
         return session.itemExists(path);
     }
 
@@ -197,65 +199,71 @@
      * Forwards the method call to the underlying session.
      */
     public void checkPermission(String absPath, String actions)
-            throws AccessControlException {
+            throws AccessControlException, RepositoryException {
         session.checkPermission(absPath, actions);
     }
 
     /**
      * Forwards the method call to the underlying session.
      */
-    public ContentHandler getImportContentHandler(String parentAbsPath)
+    public ContentHandler getImportContentHandler(
+            String parentAbsPath, int uuidBehaviour)
             throws PathNotFoundException, ConstraintViolationException,
             VersionException, LockException, RepositoryException {
-        return session.getImportContentHandler(parentAbsPath);
+        return session.getImportContentHandler(parentAbsPath, uuidBehaviour);
     }
 
     /**
      * Forwards the method call to the underlying session.
      */
-    public void importXML(String parentAbsPath, InputStream in) throws
-            IOException, PathNotFoundException, ItemExistsException,
+    public void importXML(
+            String parentAbsPath, InputStream in, int uuidBehaviour)
+            throws IOException, PathNotFoundException, ItemExistsException,
             ConstraintViolationException, VersionException,
             InvalidSerializedDataException, LockException, RepositoryException {
-        session.importXML(parentAbsPath, in);
+        session.importXML(parentAbsPath, in, uuidBehaviour);
     }
 
     /**
      * Forwards the method call to the underlying session.
      */
-    public void exportSysView(String absPath, ContentHandler contentHandler,
-            boolean binaryAsLink, boolean noRecurse) throws
-            PathNotFoundException, SAXException, RepositoryException {
-        session.exportSysView(absPath, contentHandler, binaryAsLink, noRecurse);
+    public void exportSystemView(
+            String absPath, ContentHandler contentHandler,
+            boolean binaryAsLink, boolean noRecurse)
+            throws PathNotFoundException, SAXException, RepositoryException {
+        session.exportSystemView(
+                absPath, contentHandler, binaryAsLink, noRecurse);
     }
 
     /**
      * Forwards the method call to the underlying session.
      */
-    public void exportSysView(String absPath, OutputStream out,
-            boolean binaryAsLink, boolean noRecurse) throws IOException,
-            PathNotFoundException, RepositoryException {
-        session.exportDocView(absPath, out, binaryAsLink, noRecurse);
+    public void exportSystemView(
+            String absPath, OutputStream out,
+            boolean binaryAsLink, boolean noRecurse)
+            throws IOException, PathNotFoundException, RepositoryException {
+        session.exportSystemView(absPath, out, binaryAsLink, noRecurse);
     }
 
     /**
      * Forwards the method call to the underlying session.
      */
-    public void exportDocView(String absPath, ContentHandler contentHandler,
-            boolean binaryAsLink, boolean noRecurse) throws 
-            InvalidSerializedDataException, PathNotFoundException,
-            SAXException, RepositoryException {
-        session.exportDocView(absPath, contentHandler, binaryAsLink, noRecurse);
+    public void exportDocumentView(
+            String absPath, ContentHandler contentHandler,
+            boolean binaryAsLink, boolean noRecurse)
+            throws PathNotFoundException, SAXException, RepositoryException {
+        session.exportDocumentView(
+                absPath, contentHandler, binaryAsLink, noRecurse);
     }
 
     /**
      * Forwards the method call to the underlying session.
      */
-    public void exportDocView(String absPath, OutputStream out,
-            boolean binaryAsLink, boolean noRecurse) throws 
-            InvalidSerializedDataException, IOException, PathNotFoundException,
-            RepositoryException {
-        session.exportDocView(absPath, out, binaryAsLink, noRecurse);
+    public void exportDocumentView(
+            String absPath, OutputStream out,
+            boolean binaryAsLink, boolean noRecurse) 
+            throws IOException, PathNotFoundException, RepositoryException {
+        session.exportDocumentView(absPath, out, binaryAsLink, noRecurse);
     }
 
     /**
@@ -317,4 +325,12 @@
         session.removeLockToken(lt);
     }
 
+    public ValueFactory getValueFactory()
+            throws UnsupportedRepositoryOperationException, RepositoryException {
+        return session.getValueFactory();
+    }
+
+    public boolean isLive() {
+        return session.isLive();
+    }
 }



Mime
View raw message