directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r918614 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/ core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ core-api/src/main/java/org/apache/directory/server/core/schema/ co...
Date Wed, 03 Mar 2010 18:24:31 GMT
Author: elecharny
Date: Wed Mar  3 18:24:30 2010
New Revision: 918614

URL: http://svn.apache.org/viewvc?rev=918614&view=rev
Log:
o Renamed the getJndiName() method

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/UnbindOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
    directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/DefaultJournalStore.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java?rev=918614&r1=918613&r2=918614&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java
Wed Mar  3 18:24:30 2010
@@ -112,11 +112,11 @@
 
     /**
      * Gets a cloned copy of the normalized distinguished name of this
-     * principal as a JNDI {@link LdapDN}.
+     * principal as a {@link LdapDN}.
      *
      * @return the normalized distinguished name of the principal as a JNDI {@link LdapDN}
      */
-    public LdapDN getJndiName()
+    public LdapDN getClonedName()
     {
         return ( LdapDN ) name.clone();
     }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/UnbindOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/UnbindOperationContext.java?rev=918614&r1=918613&r2=918614&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/UnbindOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/UnbindOperationContext.java
Wed Mar  3 18:24:30 2010
@@ -39,13 +39,13 @@
      */
     public UnbindOperationContext( CoreSession session )
     {
-        super( session, session.getEffectivePrincipal().getJndiName() );
+        super( session, session.getEffectivePrincipal().getClonedName() );
     }
     
 
     public UnbindOperationContext( CoreSession session, InternalUnbindRequest unbindRequest
)
     {
-        super( session, session.getEffectivePrincipal().getJndiName() );
+        super( session, session.getEffectivePrincipal().getClonedName() );
         this.setRequestControls( unbindRequest.getControls() );
     }
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java?rev=918614&r1=918613&r2=918614&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
Wed Mar  3 18:24:30 2010
@@ -461,7 +461,7 @@
      */
     private void updateSchemaModificationAttributes( OperationContext opContext ) throws
Exception
     {
-        String modifiersName = opContext.getSession().getEffectivePrincipal().getJndiName().getNormName();
+        String modifiersName = opContext.getSession().getEffectivePrincipal().getName();
         String modifyTimestamp = DateUtils.getGeneralizedTime();
 
         List<Modification> mods = new ArrayList<Modification>( 2 );

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java?rev=918614&r1=918613&r2=918614&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
(original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
Wed Mar  3 18:24:30 2010
@@ -252,9 +252,9 @@
      */
     public void ldapUnbind() throws NamingException
     {
-        LdapDN principalDn = getSession().getEffectivePrincipal().getJndiName();
         UnbindOperationContext opCtx = new UnbindOperationContext( getSession() );
         opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
+
         try
         {
             super.getDirectoryService().getOperationManager().unbind( opCtx );
@@ -263,6 +263,7 @@
         {
             JndiUtils.wrap( e );
         }
+        
         responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
         requestControls = EMPTY_CONTROLS;
     }

Modified: directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java?rev=918614&r1=918613&r2=918614&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
(original)
+++ directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
Wed Mar  3 18:24:30 2010
@@ -411,7 +411,7 @@
      */
     public boolean isAdministrator()
     {
-        String normName = getEffectivePrincipal().getJndiName().toNormName(); 
+        String normName = getEffectivePrincipal().getName(); 
         return normName.equals( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
     }
 
@@ -758,7 +758,7 @@
 
     public boolean isAnonymous()
     {
-        return getEffectivePrincipal().getJndiName().isEmpty();
+        return getEffectivePrincipal().getName().isEmpty();
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java?rev=918614&r1=918613&r2=918614&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
Wed Mar  3 18:24:30 2010
@@ -411,7 +411,7 @@
      */
     public boolean isAdministrator()
     {
-        String normName = getEffectivePrincipal().getJndiName().toNormName(); 
+        String normName = getEffectivePrincipal().getName(); 
         return normName.equals( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
     }
 
@@ -759,7 +759,7 @@
 
     public boolean isAnonymous()
     {
-        return getEffectivePrincipal().getJndiName().isEmpty();
+        return getEffectivePrincipal().getClonedName().isEmpty();
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=918614&r1=918613&r2=918614&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
Wed Mar  3 18:24:30 2010
@@ -230,7 +230,7 @@
 
     private void protectCriticalEntries( LdapDN dn ) throws Exception
     {
-        LdapDN principalDn = getPrincipal().getJndiName();
+        LdapDN principalDn = getPrincipal().getClonedName();
 
         if ( dn.isEmpty() )
         {
@@ -423,7 +423,7 @@
     {
         // Access the principal requesting the operation, and bypass checks if it is the
admin
         LdapPrincipal principal = addContext.getSession().getEffectivePrincipal();
-        LdapDN principalDn = principal.getJndiName();
+        LdapDN principalDn = principal.getClonedName();
         
         ServerEntry serverEntry = addContext.getEntry(); 
         //Attributes entry = ServerEntryUtils.toAttributesImpl( serverEntry );
@@ -500,7 +500,7 @@
         LdapDN name = deleteContext.getDn();
         
         LdapPrincipal principal = deleteContext.getSession().getEffectivePrincipal();
-        LdapDN principalDn = principal.getJndiName();
+        LdapDN principalDn = principal.getClonedName();
 
         // bypass authz code if we are disabled
         if ( ! deleteContext.getSession().getDirectoryService().isAccessControlEnabled()
)
@@ -545,7 +545,7 @@
         ClonedServerEntry entry = opContext.lookup( name, ByPassConstants.LOOKUP_BYPASS );
         
         LdapPrincipal principal = opContext.getSession().getEffectivePrincipal();
-        LdapDN principalDn = principal.getJndiName();
+        LdapDN principalDn = principal.getClonedName();
 
         // bypass authz code if we are disabled
         if ( !opContext.getSession().getDirectoryService().isAccessControlEnabled() )
@@ -680,7 +680,7 @@
         
         // TODO - eventually replace this with a check on session.isAnAdministrator()
         LdapPrincipal principal = entryContext.getSession().getEffectivePrincipal();
-        LdapDN principalDn = principal.getJndiName();
+        LdapDN principalDn = principal.getClonedName();
         if ( isPrincipalAnAdministrator( principalDn ) )
         {
             return answer;
@@ -726,7 +726,7 @@
         }
 
         LdapPrincipal principal = lookupContext.getSession().getEffectivePrincipal();
-        LdapDN userName = principal.getJndiName();
+        LdapDN userName = principal.getClonedName();
         Set<LdapDN> userGroups = groupCache.getGroups( userName.toNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( lookupContext, tuples, lookupContext.getDn(), entry );
@@ -765,7 +765,7 @@
     public ClonedServerEntry lookup( NextInterceptor next, LookupOperationContext lookupContext
) throws Exception
     {
         LdapPrincipal principal = lookupContext.getSession().getEffectivePrincipal();
-        LdapDN principalDn = principal.getJndiName();
+        LdapDN principalDn = principal.getClonedName();
         
         if ( !principalDn.isNormalized() )
         {
@@ -797,7 +797,7 @@
         }
         
         LdapPrincipal principal = renameContext.getSession().getEffectivePrincipal();
-        LdapDN principalDn = principal.getJndiName();
+        LdapDN principalDn = principal.getClonedName();
         LdapDN newName = renameContext.getNewDn();
 
         // bypass authz code if we are disabled
@@ -846,7 +846,7 @@
         ClonedServerEntry entry = moveAndRenameContext.lookup( oriChildName, ByPassConstants.LOOKUP_BYPASS
);
         
         LdapPrincipal principal = moveAndRenameContext.getSession().getEffectivePrincipal();
-        LdapDN principalDn = principal.getJndiName();
+        LdapDN principalDn = principal.getClonedName();
         LdapDN newName = ( LdapDN ) newParentName.clone();
         newName.add( moveAndRenameContext.getNewRdn().getUpName() );
 
@@ -927,7 +927,7 @@
         LdapDN newName = ( LdapDN ) newParentName.clone();
         newName.add( oriChildName.get( oriChildName.size() - 1 ) );
         LdapPrincipal principal = moveContext.getSession().getEffectivePrincipal();
-        LdapDN principalDn = principal.getJndiName();
+        LdapDN principalDn = principal.getClonedName();
 
         // bypass authz code if we are disabled
         if ( !moveContext.getSession().getDirectoryService().isAccessControlEnabled() )
@@ -999,7 +999,7 @@
         LdapPrincipal user = opContext.getSession().getEffectivePrincipal();
         EntryFilteringCursor cursor = next.list( opContext );
         
-        if ( isPrincipalAnAdministrator( user.getJndiName() ) || !opContext.getSession().getDirectoryService().isAccessControlEnabled()
)
+        if ( isPrincipalAnAdministrator( user.getClonedName() ) || !opContext.getSession().getDirectoryService().isAccessControlEnabled()
)
         {
             return cursor;
         }
@@ -1013,7 +1013,7 @@
     public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext opContext
) throws Exception
     {
         LdapPrincipal user = opContext.getSession().getEffectivePrincipal();
-        LdapDN principalDn = user.getJndiName();
+        LdapDN principalDn = user.getClonedName();
         EntryFilteringCursor cursor = next.search( opContext );
 
         boolean isSubschemaSubentryLookup = subschemaSubentryDn.equals( opContext.getDn().getNormName()
);
@@ -1045,7 +1045,7 @@
         ClonedServerEntry entry = opContext.lookup( name, ByPassConstants.LOOKUP_BYPASS );
 
         LdapPrincipal principal = opContext.getSession().getEffectivePrincipal();
-        LdapDN principalDn = principal.getJndiName();
+        LdapDN principalDn = principal.getClonedName();
 
         if ( isPrincipalAnAdministrator( principalDn ) || !opContext.getSession().getDirectoryService().isAccessControlEnabled()
)
         {
@@ -1073,7 +1073,7 @@
     {
         // Access the principal requesting the operation, and bypass checks if it is the
admin
         LdapPrincipal principal = opContext.getSession().getEffectivePrincipal();
-        LdapDN principalDn = principal.getJndiName();
+        LdapDN principalDn = principal.getClonedName();
         
         if ( isPrincipalAnAdministrator( principalDn ) || !opContext.getSession().getDirectoryService().isAccessControlEnabled()
)
         {
@@ -1127,7 +1127,7 @@
          */
         
         LdapPrincipal principal = opContext.getSession().getEffectivePrincipal();
-        LdapDN userDn = principal.getJndiName();
+        LdapDN userDn = principal.getClonedName();
         Set<LdapDN> userGroups = groupCache.getGroups( userDn.toNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( opContext, tuples, normName, clonedEntry.getOriginalEntry()
);

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=918614&r1=918613&r2=918614&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
Wed Mar  3 18:24:30 2010
@@ -173,7 +173,7 @@
             return;
         }
 
-        LdapDN principalDn = getPrincipal().getJndiName();
+        LdapDN principalDn = getPrincipal().getClonedName();
 
         if ( name.isEmpty() )
         {
@@ -268,7 +268,7 @@
 
     private void protectModifyAlterations( LdapDN dn ) throws Exception
     {
-        LdapDN principalDn = getPrincipal().getJndiName();
+        LdapDN principalDn = getPrincipal().getClonedName();
 
         if ( dn.isEmpty() )
         {
@@ -280,7 +280,7 @@
         if ( ! isAnAdministrator( principalDn ) )
         {
             // allow self modifications 
-            if ( dn.getNormName().equals( getPrincipal().getJndiName().getNormName() ) )
+            if ( dn.getNormName().equals( getPrincipal().getName() ) )
             {
                 return;
             }
@@ -357,7 +357,7 @@
 
     private void protectDnAlterations( LdapDN dn ) throws Exception
     {
-        LdapDN principalDn = getPrincipal().getJndiName();
+        LdapDN principalDn = getPrincipal().getClonedName();
 
         if ( dn.isEmpty() )
         {
@@ -405,7 +405,7 @@
             return serverEntry;
         }
 
-        protectLookUp( opContext.getSession().getEffectivePrincipal().getJndiName(), opContext.getDn()
);
+        protectLookUp( opContext.getSession().getEffectivePrincipal().getClonedName(), opContext.getDn()
);
         return serverEntry;
     }
 
@@ -500,7 +500,7 @@
 
     private boolean isSearchable( OperationContext opContext, ClonedServerEntry result )
throws Exception
     {
-        LdapDN principalDn = opContext.getSession().getEffectivePrincipal().getJndiName();
+        LdapDN principalDn = opContext.getSession().getEffectivePrincipal().getClonedName();
         LdapDN dn = result.getDn();
         
         if ( !dn.isNormalized() )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/DefaultJournalStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/DefaultJournalStore.java?rev=918614&r1=918613&r2=918614&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/DefaultJournalStore.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/DefaultJournalStore.java
Wed Mar  3 18:24:30 2010
@@ -107,7 +107,7 @@
             {
                 // Write the LdapPrincipal
                 writer.write( "# principal: " );
-                writer.write( principal.getJndiName().toString() );
+                writer.write( principal.getName() );
                 writer.write( '\n' );
                 
                 // Write the timestamp

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java?rev=918614&r1=918613&r2=918614&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
Wed Mar  3 18:24:30 2010
@@ -47,7 +47,7 @@
     
     public boolean hasPermission( OperationContext opContext ) throws NamingException
     {
-        LdapDN principalName = opContext.getSession().getEffectivePrincipal().getJndiName();
+        LdapDN principalName = opContext.getSession().getEffectivePrincipal().getClonedName();
         return principalName.equals( adminName );
     }
 }

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java?rev=918614&r1=918613&r2=918614&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
Wed Mar  3 18:24:30 2010
@@ -153,7 +153,7 @@
         
         assertEquals( principal.getAuthenticationLevel(), readPrincipal.getAuthenticationLevel()
);
         assertEquals( principal.getName(), readPrincipal.getName() );
-        assertEquals( principal.getJndiName(), readPrincipal.getJndiName() );
+        assertEquals( principal.getClonedName(), readPrincipal.getClonedName() );
         assertNull( readPrincipal.getUserPassword() );
         
         assertEquals( zuluTime, read.getZuluTime() );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java?rev=918614&r1=918613&r2=918614&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
Wed Mar  3 18:24:30 2010
@@ -303,7 +303,7 @@
                 {
                     DirectoryService ds = ldapSession.getLdapServer().getDirectoryService();
                     String saslMechanism = bindRequest.getSaslMechanism();
-                    CoreSession userSession = ds.getSession( ldapPrincipal.getJndiName(),
ldapPrincipal
+                    CoreSession userSession = ds.getSession( ldapPrincipal.getClonedName(),
ldapPrincipal
                         .getUserPassword(), saslMechanism, null );
 
                     // Set the user session into the ldap session 



Mime
View raw message