jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1394282 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security: authentication/token/ principal/ user/
Date Thu, 04 Oct 2012 21:40:25 GMT
Author: mduerig
Date: Thu Oct  4 21:40:24 2012
New Revision: 1394282

URL: http://svn.apache.org/viewvc?rev=1394282&view=rev
Log:
OAK-350: Unify PropertyState and CoreValue
- Replace CoreValue.getString with PropertyState.getValue(Type)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/AuthorizableBaseProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImpl.java?rev=1394282&r1=1394281&r2=1394282&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImpl.java
Thu Oct  4 21:40:24 2012
@@ -54,6 +54,8 @@ import org.apache.jackrabbit.util.Text;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.jackrabbit.oak.api.Type.*;
+
 /**
  * Default implementation of the {@code TokenProvider} interface with the
  * following characteristics.
@@ -306,7 +308,7 @@ public class TokenProviderImpl implement
             publicAttributes = new HashMap<String, String>();
             for (PropertyState propertyState : tokenNode.getTree().getProperties()) {
                 String name = propertyState.getName();
-                String value = propertyState.getValue().getString();
+                String value = propertyState.getValue(STRING);
                 if (isMandatoryAttribute(name)) {
                     mandatoryAttributes.put(name, value);
                 } else if (isInfoAttribute(name)) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImpl.java?rev=1394282&r1=1394281&r2=1394282&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImpl.java
Thu Oct  4 21:40:24 2012
@@ -44,6 +44,7 @@ import org.slf4j.LoggerFactory;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Preconditions.checkState;
+import static org.apache.jackrabbit.oak.api.Type.*;
 
 /**
  * The {@code PrincipalProviderImpl} is a principal provider implementation
@@ -144,7 +145,7 @@ public class PrincipalProviderImpl imple
         checkNotNull(authorizableTree);
         checkState(authorizableTree.hasProperty(JcrConstants.JCR_PRIMARYTYPE));
 
-        String ntName = authorizableTree.getProperty(JcrConstants.JCR_PRIMARYTYPE).getValue().getString();
+        String ntName = authorizableTree.getProperty(JcrConstants.JCR_PRIMARYTYPE).getValue(STRING);
         return UserConstants.NT_REP_GROUP.equals(ntName);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/AuthorizableBaseProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/AuthorizableBaseProvider.java?rev=1394282&r1=1394281&r2=1394282&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/AuthorizableBaseProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/AuthorizableBaseProvider.java
Thu Oct  4 21:40:24 2012
@@ -28,6 +28,8 @@ import org.apache.jackrabbit.oak.spi.sec
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.jackrabbit.oak.api.Type.STRING;
+
 /**
  * AuthorizableBaseProvider... TODO
  */
@@ -77,7 +79,7 @@ abstract class AuthorizableBaseProvider 
     boolean isAuthorizableTree(Tree tree, Type authorizableType) {
         // FIXME: check for node type according to the specified type constraint
         if (tree != null && tree.hasProperty(JcrConstants.JCR_PRIMARYTYPE)) {
-            String ntName = tree.getProperty(JcrConstants.JCR_PRIMARYTYPE).getValue().getString();
+            String ntName = tree.getProperty(JcrConstants.JCR_PRIMARYTYPE).getValue(STRING);
             switch (authorizableType) {
                 case GROUP:
                     return NT_REP_GROUP.equals(ntName);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImpl.java?rev=1394282&r1=1394281&r2=1394282&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImpl.java
Thu Oct  4 21:40:24 2012
@@ -32,6 +32,8 @@ import org.apache.jackrabbit.oak.spi.sec
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.jackrabbit.oak.api.Type.STRING;
+
 /**
  * UserImpl...
  */
@@ -117,7 +119,7 @@ class UserImpl extends AuthorizableImpl 
         String pwHash = null;
         PropertyState pwProp = getTree().getProperty(REP_PASSWORD);
         if (pwProp != null) {
-            pwHash = pwProp.getValue().getString();
+            pwHash = pwProp.getValue(STRING);
         }
         if (!PasswordUtility.isSame(pwHash, oldPassword)) {
             throw new RepositoryException("Failed to change password: Old password does not
match.");
@@ -159,7 +161,7 @@ class UserImpl extends AuthorizableImpl 
     public String getDisabledReason() throws RepositoryException {
         PropertyState disabled = getTree().getProperty(REP_DISABLED);
         if (disabled != null) {
-            return disabled.getValue().getString();
+            return disabled.getValue(STRING);
         } else
             return null;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java?rev=1394282&r1=1394281&r2=1394282&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java
Thu Oct  4 21:40:24 2012
@@ -46,6 +46,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static com.google.common.base.Preconditions.checkNotNull;
+import static org.apache.jackrabbit.oak.api.Type.STRING;
 
 /**
  * User provider implementation and manager for group memberships with the
@@ -230,7 +231,7 @@ class UserProviderImpl extends Authoriza
         if (isAuthorizableTree(authorizableTree, Type.AUTHORIZABLE)) {
             PropertyState idProp = authorizableTree.getProperty(UserConstants.REP_AUTHORIZABLE_ID);
             if (idProp != null) {
-                return idProp.getValue().getString();
+                return idProp.getValue(STRING);
             } else {
                 return Text.unescapeIllegalJcrChars(authorizableTree.getName());
             }



Mime
View raw message