directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r367205 - in /directory/trunks: apacheds/src/main/java/org/apache/ldap/server/jndi/ ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/
Date Mon, 09 Jan 2006 05:17:19 GMT
Author: akarasulu
Date: Sun Jan  8 21:17:11 2006
New Revision: 367205

URL: http://svn.apache.org/viewcvs?rev=367205&view=rev
Log:
formatting and import cleanup

Modified:
    directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerContext.java
    directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerDirContext.java
    directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerLdapContext.java
    directory/trunks/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/SearchResponseIterator.java

Modified: directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerContext.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerContext.java?rev=367205&r1=367204&r2=367205&view=diff
==============================================================================
--- directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerContext.java
(original)
+++ directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerContext.java
Sun Jan  8 21:17:11 2006
@@ -157,13 +157,9 @@
     protected ServerContext( LdapPrincipal principal, DirectoryPartitionNexus nexusProxy,
Hashtable env, Name dn )
     {
         this.dn = ( LdapName ) dn.clone();
-
         this.env = ( Hashtable ) env.clone();
-
         this.env.put( PROVIDER_URL, dn.toString() );
-
         this.nexusProxy = nexusProxy;
-
         this.principal = principal;
     }
 
@@ -293,19 +289,14 @@
     public Context createSubcontext( Name name ) throws NamingException
     {
         Attributes attributes = new LockableAttributesImpl();
-
         LdapName target = buildTarget( name );
 
         String rdn = name.get( name.size() - 1 );
-
         String rdnAttribute = NamespaceTools.getRdnAttribute( rdn );
-
         String rdnValue = NamespaceTools.getRdnValue( rdn );
 
         attributes.put( rdnAttribute, rdnValue );
-
         attributes.put( JavaLdapSupport.OBJECTCLASS_ATTR, JavaLdapSupport.JCONTAINER_ATTR
);
-
         attributes.put( JavaLdapSupport.OBJECTCLASS_ATTR, JavaLdapSupport.TOP_ATTR );
         
         /*
@@ -316,13 +307,9 @@
          * environment besides whats in the hashtable for env.
          */
         nexusProxy.add( target.toString(), target, attributes );
-        
         ServerLdapContext ctx = new ServerLdapContext( principal, nexusProxy, env, target
);
-
         Control [] controls = ( Control [] ) ( ( ServerLdapContext ) this ).getRequestControls().clone();
-
         ctx.setRequestControls( controls );
-
         return ctx;
     }
 
@@ -342,7 +329,6 @@
     public void destroySubcontext( Name name ) throws NamingException
     {
         Name target = buildTarget( name );
-
         if ( target.size() == 0 )
         {
             throw new LdapNoPermissionException( "can't delete the rootDSE" );
@@ -368,15 +354,12 @@
     {
         // First, use state factories to do a transformation
         DirStateFactory.Result res = DirectoryManager.getStateToBind( obj, name, this, env,
null );
-
         Attributes outAttrs = res.getAttributes();
 
         if ( outAttrs != null )
         {
             Name target = buildTarget( name );
-
             nexusProxy.add( target.toString(), target, outAttrs );
-
             return;
         }
 
@@ -390,19 +373,15 @@
         if ( obj instanceof Reference )
         {
             // Store as ref and add outAttrs
-
             throw new NamingException( "Do not know how to store References yet!" );
         }
         else if ( obj instanceof Serializable )
         {
             // Serialize and add outAttrs
-
             Attributes attributes = new LockableAttributesImpl();
-
             if ( outAttrs != null && outAttrs.size() > 0 )
             {
                 NamingEnumeration list = outAttrs.getAll();
-
                 while ( list.hasMore() )
                 {
                     attributes.put( ( Attribute ) list.next() );
@@ -412,21 +391,16 @@
             Name target = buildTarget( name );
 
             // Serialize object into entry attributes and add it.
-
             JavaLdapSupport.serialize( attributes, obj );
-
             nexusProxy.add( target.toString(), target, attributes );
         }
         else if ( obj instanceof DirContext )
         {
             // Grab attributes and merge with outAttrs
-
             Attributes attributes = ( ( DirContext ) obj ).getAttributes( "" );
-
             if ( outAttrs != null && outAttrs.size() > 0 )
             {
                 NamingEnumeration list = outAttrs.getAll();
-
                 while ( list.hasMore() )
                 {
                     attributes.put( ( Attribute ) list.next() );
@@ -434,7 +408,6 @@
             }
 
             Name target = buildTarget( name );
-
             nexusProxy.add( target.toString(), target, attributes );
         }
         else
@@ -459,22 +432,16 @@
     public void rename( Name oldName, Name newName ) throws NamingException
     {
         Name oldDn = buildTarget( oldName );
-
         Name newDn = buildTarget( newName );
-
         if ( oldDn.size() == 0 )
         {
             throw new LdapNoPermissionException( "can't rename the rootDSE" );
         }
 
         Name oldBase = oldName.getPrefix( 1 );
-
         Name newBase = newName.getPrefix( 1 );
-
         String newRdn = newName.get( newName.size() - 1 );
-
         String oldRdn = oldName.get( oldName.size() - 1 );
-                
         boolean delOldRdn = true;
             
         /*
@@ -484,11 +451,8 @@
         if ( null != env.get( DELETE_OLD_RDN_PROP ) )
         {
             String delOldRdnStr = ( String ) env.get( DELETE_OLD_RDN_PROP );
-
             delOldRdn = ! delOldRdnStr.equals( "false" );
-
             delOldRdn = delOldRdn || delOldRdnStr.equals( "no" );
-
             delOldRdn = delOldRdn || delOldRdnStr.equals( "0" );
         }
 
@@ -507,7 +471,6 @@
         else
         {
             Name parent = newDn.getPrefix( 1 );
-            
             if ( newRdn.equalsIgnoreCase( oldRdn ) )
             {
                 nexusProxy.move( oldDn, parent );
@@ -535,12 +498,10 @@
     public void rebind( Name name, Object obj ) throws NamingException
     {
         Name target = buildTarget( name );
-
         if ( nexusProxy.hasEntry( target ) )
         {
             nexusProxy.delete( target );
         }
-
         bind( name, obj );
     }
 
@@ -708,13 +669,9 @@
     {
         // Conduct a special one level search at base for all objects
         Name base = buildTarget( name );
-
         PresenceNode filter = new PresenceNode( "objectClass" );
-
         SearchControls ctls = new SearchControls();
-
         ctls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-
         return nexusProxy.search( base , getEnvironment(), filter, ctls );
     }
 
@@ -757,7 +714,6 @@
          
         // 1). Find the Dn for name and walk it from the head to tail
         Name fqn = buildTarget( name );
-
         String head = prefix.get( 0 );
         
         // 2). Walk the fqn trying to match for the head of the prefix
@@ -775,9 +731,7 @@
         }
 
         String msg = "The prefix '" + prefix + "' is not an ancestor of this ";
-
         msg += "entry '" + dn + "'";
-
         throw new NamingException( msg );
     }
 
@@ -849,7 +803,6 @@
         
         // Add to left hand side of cloned DN the relative name arg
         target.addAll( target.size(), relativeName );
-
         return target;
     }
 }

Modified: directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerDirContext.java?rev=367205&r1=367204&r2=367205&view=diff
==============================================================================
--- directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerDirContext.java
(original)
+++ directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerDirContext.java
Sun Jan  8 21:17:11 2006
@@ -44,8 +44,6 @@
 import org.apache.ldap.common.filter.FilterParserImpl;
 import org.apache.ldap.common.filter.PresenceNode;
 import org.apache.ldap.common.filter.SimpleNode;
-import org.apache.ldap.common.name.DnOidContainer;
-import org.apache.ldap.common.name.LdapDN;
 import org.apache.ldap.common.name.LdapName;
 import org.apache.ldap.common.util.NamespaceTools;
 import org.apache.ldap.server.DirectoryService;
@@ -205,7 +203,6 @@
         if ( null == attrs )
         {
             super.bind( name, obj );
-
             return;
         }
 
@@ -213,37 +210,28 @@
         if ( null == obj )
         {
             Attributes clone = ( Attributes ) attrs.clone();
-
             Name target = buildTarget( name );
-
             getNexusProxy().add( target.toString(), target, clone );
-
             return;
         }
 
         // First, use state factories to do a transformation
         DirStateFactory.Result res = DirectoryManager.getStateToBind( obj, name, this, getEnvironment(),
attrs );
-
         Attributes outAttrs = res.getAttributes();
 
         if ( outAttrs != attrs )
         {
             Name target = buildTarget( name );
-
             Attributes attributes = ( Attributes ) attrs.clone();
-
             if ( outAttrs != null && outAttrs.size() > 0 )
             {
                 NamingEnumeration list = outAttrs.getAll();
-
                 while ( list.hasMore() )
                 {
                     attributes.put( ( Attribute ) list.next() );
                 }
             }
-
             getNexusProxy().add( target.toString(), target, attributes );
-
             return;
         }
 
@@ -251,7 +239,6 @@
         if ( obj instanceof Referenceable )
         {
             obj = ( ( Referenceable ) obj ).getReference();
-
             throw new NamingException( "Do not know how to store Referenceables yet!" );
         }
 
@@ -259,51 +246,39 @@
         if ( obj instanceof Reference )
         {
             // Store as ref and add outAttrs
-
             throw new NamingException( "Do not know how to store References yet!" );
         }
         else if ( obj instanceof Serializable )
         {
             // Serialize and add outAttrs
-
             Attributes attributes = ( Attributes ) attrs.clone();
-
             if ( outAttrs != null && outAttrs.size() > 0 )
             {
                 NamingEnumeration list = outAttrs.getAll();
-
                 while ( list.hasMore() )
                 {
                     attributes.put( ( Attribute ) list.next() );
                 }
             }
-
             Name target = buildTarget( name );
 
             // Serialize object into entry attributes and add it.
-
             JavaLdapSupport.serialize( attributes, obj );
-
             getNexusProxy().add( target.toString(), target, attributes );
         }
         else if ( obj instanceof DirContext )
         {
             // Grab attributes and merge with outAttrs
-
             Attributes attributes = ( ( DirContext ) obj ).getAttributes( "" );
-
             if ( outAttrs != null && outAttrs.size() > 0 )
             {
                 NamingEnumeration list = outAttrs.getAll();
-
                 while ( list.hasMore() )
                 {
                     attributes.put( ( Attribute ) list.next() );
                 }
             }
-
             Name target = buildTarget( name );
-
             getNexusProxy().add( target.toString(), target, attributes );
         }
         else
@@ -330,12 +305,10 @@
     public void rebind( Name name, Object obj, Attributes attrs ) throws NamingException
     {
         Name target = buildTarget( name );
-
         if ( getNexusProxy().hasEntry( target ) )
         {
             getNexusProxy().delete( target );
         }
-
         bind( name, obj, attrs );
     }
 
@@ -362,20 +335,14 @@
         }
 
         Name target = buildTarget( name );
-
         String rdn = name.get( name.size() - 1 );
-
         String rdnAttribute = NamespaceTools.getRdnAttribute( rdn );
-
         String rdnValue = NamespaceTools.getRdnValue( rdn );
 
         // Clone the attributes and add the Rdn attributes
         Attributes attributes = ( Attributes ) attrs.clone();
-
         boolean doRdnPut = attributes.get( rdnAttribute ) == null;
-
         doRdnPut = doRdnPut || attributes.get( rdnAttribute ).size() == 0;
-
         doRdnPut = doRdnPut || ! attributes.get( rdnAttribute ).contains( rdnValue );
 
         if ( doRdnPut )
@@ -388,7 +355,6 @@
 
         // Initialize the new context
         ServerLdapContext ctx = new ServerLdapContext( getPrincipal(), getNexusProxy(), getEnvironment(),
target );
-
         Control [] controls = ( ( ServerLdapContext ) this ).getRequestControls();
 
         if ( controls != null )
@@ -401,7 +367,6 @@
         }
 
         ctx.setRequestControls( controls );
-
         return ctx;
     }
 
@@ -486,7 +451,6 @@
     public NamingEnumeration search( Name name, Attributes matchingAttributes, String[] attributesToReturn
) throws NamingException
     {
         SearchControls ctls = new SearchControls();
-
         Name target = buildTarget( name );
 
         // If we need to return specific attributes add em to the SearchControls
@@ -499,7 +463,6 @@
         if ( null == matchingAttributes || matchingAttributes.size() <= 0 )
         {
             PresenceNode filter = new PresenceNode( "objectClass" );
-
             return getNexusProxy().search( target , getEnvironment(), filter, ctls );
         }
 
@@ -575,10 +538,8 @@
     {
     	/*Name newName = new LdapDN( name.toString() );
     	newName = LdapDN.oidToName( newName, DnOidContainer.getOids() );
-    	
-    	
         Name target = buildTarget( ((LdapDN)newName).toLdapName() );*/
-        
+
         Name target = buildTarget( name );
         return getNexusProxy().search( target, getEnvironment(), filter, cons );
     }
@@ -592,7 +553,6 @@
             throws NamingException
     {
         ExprNode filterNode;
-
         Name target = buildTarget( name );
 
         try
@@ -605,9 +565,7 @@
                 new InvalidSearchFilterException (
                 "Encountered parse exception while parsing the filter: '"
                 + filter + "'" );
-
             isfe.setRootCause( pe );
-
             throw isfe;
         }
         catch ( IOException ioe )
@@ -728,7 +686,6 @@
                                    NamingListener namingListener ) throws NamingException
     {
         int start;
-
         StringBuffer buf = new StringBuffer( filterExpr );
 
         // Scan until we hit the end of the string buffer

Modified: directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerLdapContext.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerLdapContext.java?rev=367205&r1=367204&r2=367205&view=diff
==============================================================================
--- directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerLdapContext.java
(original)
+++ directory/trunks/apacheds/src/main/java/org/apache/ldap/server/jndi/ServerLdapContext.java
Sun Jan  8 21:17:11 2006
@@ -120,8 +120,7 @@
      * @see javax.naming.ldap.LdapContext#setRequestControls(
      * javax.naming.ldap.Control[])
      */
-    public void setRequestControls( Control[] requestControls )
-        throws NamingException
+    public void setRequestControls( Control[] requestControls ) throws NamingException
     {
         this.requestControls = requestControls;
     }

Modified: directory/trunks/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/SearchResponseIterator.java
URL: http://svn.apache.org/viewcvs/directory/trunks/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/SearchResponseIterator.java?rev=367205&r1=367204&r2=367205&view=diff
==============================================================================
--- directory/trunks/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/SearchResponseIterator.java
(original)
+++ directory/trunks/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/SearchResponseIterator.java
Sun Jan  8 21:17:11 2006
@@ -55,13 +55,13 @@
     private boolean done = false;
     private Object prefetched;
 
+
     /**
      * Creates a search response iterator for the resulting enumeration
      * over a search request.
      *
      * @param req the search request to generate responses to
      * @param underlying the underlying JNDI enumeration containing SearchResults
-     * @param handler TODO
      */
     public SearchResponseIterator( SearchRequest req, NamingEnumeration underlying )
     {
@@ -136,11 +136,13 @@
         }
     }
 
+    
     public boolean hasNext()
     {
         return !done;
     }
 
+    
     public Object next()
     {
         Object next = prefetched;



Mime
View raw message