jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1331382 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: ./ query/ security/privileges/ security/user/ value/
Date Fri, 27 Apr 2012 12:24:44 GMT
Author: mduerig
Date: Fri Apr 27 12:24:43 2012
New Revision: 1331382

URL: http://svn.apache.org/viewvc?rev=1331382&view=rev
Log:
OAK-29: Simplify SessionContext
remove type parameter from SessionContext

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyDelegate.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/privileges/PrivilegeManagerImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/AuthorizableNodeCreator.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueConverter.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java?rev=1331382&r1=1331381&r2=1331382&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
Fri Apr 27 12:24:43 2012
@@ -32,7 +32,7 @@ import javax.jcr.ValueFactory;
  */
 abstract class ItemImpl implements Item {
 
-    protected final SessionContext<SessionImpl> sessionContext;
+    protected final SessionContext sessionContext;
     protected final ItemDelegate dlg;
 
     /**
@@ -40,7 +40,7 @@ abstract class ItemImpl implements Item 
      */
     private static final Logger log = LoggerFactory.getLogger(ItemImpl.class);
 
-    protected ItemImpl(SessionContext<SessionImpl> sessionContext, ItemDelegate itemDelegate)
{
+    protected ItemImpl(SessionContext sessionContext, ItemDelegate itemDelegate) {
         this.sessionContext = sessionContext;
         this.dlg = itemDelegate;
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java?rev=1331382&r1=1331381&r2=1331382&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java
Fri Apr 27 12:24:43 2012
@@ -33,10 +33,10 @@ import java.util.List;
 
 public class NodeDelegate extends ItemDelegate {
 
-    private final SessionContext<SessionImpl> sessionContext;
+    private final SessionContext sessionContext;
     private Tree tree;
 
-    NodeDelegate(SessionContext<SessionImpl> sessionContext, Tree tree) {
+    NodeDelegate(SessionContext sessionContext, Tree tree) {
         this.sessionContext = sessionContext;
         this.tree = tree;
     }
@@ -131,7 +131,7 @@ public class NodeDelegate extends ItemDe
                 sessionContext, parent, propertyState);
     }
 
-    SessionContext<SessionImpl> getSessionContext() {
+    SessionContext getSessionContext() {
         return sessionContext;
     }
 

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyDelegate.java?rev=1331382&r1=1331381&r2=1331382&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyDelegate.java
Fri Apr 27 12:24:43 2012
@@ -30,11 +30,11 @@ import java.util.List;
 
 public class PropertyDelegate extends ItemDelegate {
 
-    private final SessionContext<SessionImpl> sessionContext;
+    private final SessionContext sessionContext;
     private Tree parent;
     private PropertyState propertyState;
 
-    PropertyDelegate(SessionContext<SessionImpl> sessionContext, Tree parent,
+    PropertyDelegate(SessionContext sessionContext, Tree parent,
             PropertyState propertyState) {
         this.sessionContext = sessionContext;
         this.parent = parent;
@@ -160,7 +160,7 @@ public class PropertyDelegate extends It
         return '/' + getParentContentTree().getPath() + '/' + getName();
     }
 
-    SessionContext<SessionImpl> getSessionContext() {
+    SessionContext getSessionContext() {
         return sessionContext;
     }
 

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java?rev=1331382&r1=1331381&r2=1331382&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
Fri Apr 27 12:24:43 2012
@@ -25,12 +25,11 @@ import org.apache.jackrabbit.oak.jcr.val
 import org.apache.jackrabbit.oak.namepath.NameMapper;
 
 import javax.jcr.RepositoryException;
-import javax.jcr.Session;
 import javax.jcr.lock.LockManager;
 import javax.jcr.version.VersionManager;
 
-public interface SessionContext<T extends Session> {
-    T getSession();
+public interface SessionContext {
+    SessionImpl getSession();
     GlobalContext getGlobalContext();
     String getWorkspaceName();
     ContentSession getContentSession();

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java?rev=1331382&r1=1331381&r2=1331382&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
Fri Apr 27 12:24:43 2012
@@ -65,7 +65,7 @@ public class SessionImpl extends Abstrac
     private final ValueFactoryImpl valueFactory;
     private final Workspace workspace;
     private final NamespaceRegistry nsreg;
-    private final SessionContext<SessionImpl> sessionContext = new Context();
+    private final SessionContext sessionContext = new Context();
     private final NameMapper nameMapper = new SessionNameMapper();
 
     private boolean isAlive = true;
@@ -484,7 +484,7 @@ public class SessionImpl extends Abstrac
 
     //--------------------------------------------------------------------------
 
-    private class Context implements SessionContext<SessionImpl> {
+    private class Context implements SessionContext {
 
         @Override
         public SessionImpl getSession() {

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java?rev=1331382&r1=1331381&r2=1331382&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
Fri Apr 27 12:24:43 2012
@@ -54,7 +54,7 @@ public class WorkspaceImpl implements Ja
      */
     private static final Logger log = LoggerFactory.getLogger(WorkspaceImpl.class);
 
-    private final SessionContext<SessionImpl> sessionContext;
+    private final SessionContext sessionContext;
 
     private QueryManagerImpl queryManager;
 
@@ -62,9 +62,9 @@ public class WorkspaceImpl implements Ja
 
     private final NodeTypeManager nodeTypeManager;
 
-    public WorkspaceImpl(
-            SessionContext<SessionImpl> sessionContext,
-            NamespaceRegistry nsRegistry) throws RepositoryException {
+    public WorkspaceImpl(SessionContext sessionContext, NamespaceRegistry nsRegistry)
+            throws RepositoryException {
+
         this.sessionContext = sessionContext;
         this.nsRegistry = nsRegistry;
         this.nodeTypeManager =

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java?rev=1331382&r1=1331381&r2=1331382&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
Fri Apr 27 12:24:43 2012
@@ -22,7 +22,6 @@ import org.apache.jackrabbit.oak.api.Cor
 import org.apache.jackrabbit.oak.api.QueryEngine;
 import org.apache.jackrabbit.oak.api.Result;
 import org.apache.jackrabbit.oak.jcr.SessionContext;
-import org.apache.jackrabbit.oak.jcr.SessionImpl;
 import org.apache.jackrabbit.oak.jcr.WorkspaceImpl;
 import org.apache.jackrabbit.oak.jcr.query.qom.QueryObjectModelFactoryImpl;
 
@@ -46,9 +45,9 @@ public class QueryManagerImpl implements
 
     private final QueryObjectModelFactoryImpl qomFactory = new QueryObjectModelFactoryImpl();
     private final QueryEngine queryEngine;
-    private final SessionContext<SessionImpl> sessionContext;
+    private final SessionContext sessionContext;
 
-    public QueryManagerImpl(WorkspaceImpl workspace, SessionContext<SessionImpl> sessionContext)
{
+    public QueryManagerImpl(WorkspaceImpl workspace, SessionContext sessionContext) {
         queryEngine = sessionContext.getContentSession().getQueryEngine();
         this.sessionContext = sessionContext;
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/privileges/PrivilegeManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/privileges/PrivilegeManagerImpl.java?rev=1331382&r1=1331381&r2=1331382&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/privileges/PrivilegeManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/privileges/PrivilegeManagerImpl.java
Fri Apr 27 12:24:43 2012
@@ -19,7 +19,6 @@ package org.apache.jackrabbit.oak.jcr.se
 import org.apache.jackrabbit.api.security.authorization.PrivilegeManager;
 import org.apache.jackrabbit.oak.jcr.NodeImpl;
 import org.apache.jackrabbit.oak.jcr.SessionContext;
-import org.apache.jackrabbit.oak.jcr.SessionImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -55,9 +54,9 @@ public class PrivilegeManagerImpl implem
     private static final String REP_IS_ABSTRACT = "rep:isAbstract";
     private static final String REP_CONTAINS = "rep:contains";
 
-    private final SessionContext<SessionImpl> sessionContext;
+    private final SessionContext sessionContext;
 
-    public PrivilegeManagerImpl(SessionContext<SessionImpl> sessionContext) {
+    public PrivilegeManagerImpl(SessionContext sessionContext) {
         this.sessionContext = sessionContext;
         // TODO: add additional validation ??
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/AuthorizableNodeCreator.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/AuthorizableNodeCreator.java?rev=1331382&r1=1331381&r2=1331382&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/AuthorizableNodeCreator.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/AuthorizableNodeCreator.java
Fri Apr 27 12:24:43 2012
@@ -18,7 +18,6 @@ package org.apache.jackrabbit.oak.jcr.se
 
 import org.apache.jackrabbit.oak.jcr.NodeImpl;
 import org.apache.jackrabbit.oak.jcr.SessionContext;
-import org.apache.jackrabbit.oak.jcr.SessionImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -32,7 +31,7 @@ class AuthorizableNodeCreator {
      */
     private static final Logger log = LoggerFactory.getLogger(AuthorizableNodeCreator.class);
 
-    AuthorizableNodeCreator(SessionContext<SessionImpl> sessionContext) {
+    AuthorizableNodeCreator(SessionContext sessionContext) {
         // TODO
     }
 

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java?rev=1331382&r1=1331381&r2=1331382&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java
Fri Apr 27 12:24:43 2012
@@ -25,7 +25,6 @@ import org.apache.jackrabbit.api.securit
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.jcr.NodeImpl;
 import org.apache.jackrabbit.oak.jcr.SessionContext;
-import org.apache.jackrabbit.oak.jcr.SessionImpl;
 import org.apache.jackrabbit.oak.jcr.security.user.action.AuthorizableAction;
 import org.apache.jackrabbit.oak.jcr.value.ValueConverter;
 import org.slf4j.Logger;
@@ -52,11 +51,11 @@ public class UserManagerImpl implements 
      */
     private static final Logger log = LoggerFactory.getLogger(UserManagerImpl.class);
 
-    private final SessionContext<SessionImpl> sessionContext;
+    private final SessionContext sessionContext;
     private final UserManagerConfig config;
     private final AuthorizableNodeCreator nodeCreator;
 
-    public UserManagerImpl(SessionContext<SessionImpl> sessionContext, UserManagerConfig
config) {
+    public UserManagerImpl(SessionContext sessionContext, UserManagerConfig config) {
         this.sessionContext = sessionContext;
         this.config = config;
         nodeCreator = new AuthorizableNodeCreator(sessionContext);

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueConverter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueConverter.java?rev=1331382&r1=1331381&r2=1331382&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueConverter.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueConverter.java
Fri Apr 27 12:24:43 2012
@@ -21,8 +21,6 @@ package org.apache.jackrabbit.oak.jcr.va
 
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.jcr.SessionContext;
-import org.apache.jackrabbit.oak.jcr.SessionImpl;
-import org.apache.jackrabbit.oak.jcr.value.ValueFactoryImpl;
 
 import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
@@ -37,16 +35,16 @@ import java.util.List;
 public final class ValueConverter {
     private ValueConverter() {}
 
-    public static CoreValue toCoreValue(String value, int propertyType, SessionContext<SessionImpl>
sessionContext) throws ValueFormatException {
+    public static CoreValue toCoreValue(String value, int propertyType, SessionContext sessionContext)
throws ValueFormatException {
         return toCoreValue(sessionContext.getValueFactory().createValue(value, propertyType),
sessionContext);
     }
 
-    public static CoreValue toCoreValue(Value value, SessionContext<SessionImpl> sessionContext)
{
+    public static CoreValue toCoreValue(Value value, SessionContext sessionContext) {
         ValueFactoryImpl vf = sessionContext.getValueFactory();
         return vf.getCoreValue(value);
     }
 
-    public static List<CoreValue> toCoreValues(String[] values, int propertyType, SessionContext<SessionImpl>
sessionContext) throws ValueFormatException {
+    public static List<CoreValue> toCoreValues(String[] values, int propertyType, SessionContext
sessionContext) throws ValueFormatException {
         Value[] vs = new Value[values.length];
         for (int i = 0; i < values.length; i++) {
             vs[i] = sessionContext.getValueFactory().createValue(values[i], propertyType);
@@ -54,7 +52,7 @@ public final class ValueConverter {
         return toCoreValues(vs, sessionContext);
     }
 
-    public static List<CoreValue> toCoreValues(Value[] values, SessionContext<SessionImpl>
sessionContext) {
+    public static List<CoreValue> toCoreValues(Value[] values, SessionContext sessionContext)
{
         List<CoreValue> cvs = new ArrayList<CoreValue>(values.length);
         for (Value jcrValue : values) {
             if (jcrValue != null) {
@@ -64,11 +62,11 @@ public final class ValueConverter {
         return cvs;
     }
 
-    public static Value toValue(CoreValue coreValue, SessionContext<SessionImpl> sessionContext)
{
+    public static Value toValue(CoreValue coreValue, SessionContext sessionContext) {
         return sessionContext.getValueFactory().createValue(coreValue);
     }
 
-    public static Value[] toValues(Iterable<CoreValue> coreValues, SessionContext<SessionImpl>
sessionContext) {
+    public static Value[] toValues(Iterable<CoreValue> coreValues, SessionContext sessionContext)
{
         List<Value> values = new ArrayList<Value>();
         for (CoreValue cv : coreValues) {
             values.add(toValue(cv, sessionContext));



Mime
View raw message