directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r376623 [34/38] - in /directory/sandbox/akarasulu/rc1/apacheds: core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/ core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/ core-shared/src/main/java/org/...
Date Fri, 10 Feb 2006 10:49:57 GMT
Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java Fri Feb 10 02:48:07 2006
@@ -72,7 +72,7 @@
             Object[] mods = req.getModificationItems().toArray( EMPTY );
             ctx.modifyAttributes( req.getName(), ( ModificationItem[] ) mods );
         }
-        catch( ReferralException e )
+        catch ( ReferralException e )
         {
             ReferralImpl refs = new ReferralImpl();
             result.setReferral( refs );
@@ -84,7 +84,7 @@
             {
                 refs.addLdapUrl( ( String ) e.getReferralInfo() );
             }
-            while( e.skipReferral() );
+            while ( e.skipReferral() );
             session.write( req.getResultResponse() );
             return;
         }
@@ -99,7 +99,7 @@
             ResultCodeEnum code;
             if ( e instanceof LdapException )
             {
-                code = ( ( LdapException ) e ).getResultCode() ;
+                code = ( ( LdapException ) e ).getResultCode();
             }
             else
             {
@@ -108,11 +108,9 @@
 
             result.setResultCode( code );
             result.setErrorMessage( msg );
-            if ( ( e.getResolvedName() != null ) &&
-                    ( ( code == ResultCodeEnum.NOSUCHOBJECT ) ||
-                      ( code == ResultCodeEnum.ALIASPROBLEM ) ||
-                      ( code == ResultCodeEnum.INVALIDDNSYNTAX ) ||
-                      ( code == ResultCodeEnum.ALIASDEREFERENCINGPROBLEM ) ) )
+            if ( ( e.getResolvedName() != null )
+                && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )
+                    || ( code == ResultCodeEnum.INVALIDDNSYNTAX ) || ( code == ResultCodeEnum.ALIASDEREFERENCINGPROBLEM ) ) )
             {
                 result.setMatchedDn( e.getResolvedName().toString() );
             }

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/PersistentSearchListener.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/PersistentSearchListener.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/PersistentSearchListener.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/PersistentSearchListener.java Fri Feb 10 02:48:07 2006
@@ -64,9 +64,9 @@
     final IoSession session;
     final SearchRequest req;
     final PersistentSearchControl control;
-    
-    
-    PersistentSearchListener( ServerLdapContext ctx, IoSession session, SearchRequest req ) 
+
+
+    PersistentSearchListener(ServerLdapContext ctx, IoSession session, SearchRequest req)
     {
         this.session = session;
         this.req = req;
@@ -74,8 +74,8 @@
         this.ctx = ctx;
         this.control = ( PersistentSearchControl ) req.getControls().get( PersistentSearchControl.CONTROL_OID );
     }
-    
-    
+
+
     public void abandon() throws NamingException
     {
         // must abandon the operation 
@@ -94,9 +94,9 @@
          * SO DON'T SEND BACK ANYTHING!!!!!
          */
     }
-    
-    
-    public void namingExceptionThrown( NamingExceptionEvent evt ) 
+
+
+    public void namingExceptionThrown( NamingExceptionEvent evt )
     {
         // must abandon the operation and send response done with an
         // error message if this occurs because something is wrong
@@ -109,7 +109,7 @@
         {
             log.error( "Attempt to remove listener from context failed", e );
         }
-        
+
         /*
          * From RFC 2251 Section 4.11:
          * 
@@ -136,7 +136,7 @@
         }
 
         ResultCodeEnum code = null;
-        if( evt.getException() instanceof LdapException )
+        if ( evt.getException() instanceof LdapException )
         {
             code = ( ( LdapException ) evt.getException() ).getResultCode();
         }
@@ -148,43 +148,45 @@
         LdapResult result = req.getResultResponse().getLdapResult();
         result.setResultCode( code );
         result.setErrorMessage( msg );
-        if ( ( evt.getException().getResolvedName() != null ) &&
-                ( ( code == ResultCodeEnum.NOSUCHOBJECT ) ||
-                  ( code == ResultCodeEnum.ALIASPROBLEM ) ||
-                  ( code == ResultCodeEnum.INVALIDDNSYNTAX ) ||
-                  ( code == ResultCodeEnum.ALIASDEREFERENCINGPROBLEM ) ) )
+        if ( ( evt.getException().getResolvedName() != null )
+            && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )
+                || ( code == ResultCodeEnum.INVALIDDNSYNTAX ) || ( code == ResultCodeEnum.ALIASDEREFERENCINGPROBLEM ) ) )
         {
             result.setMatchedDn( evt.getException().getResolvedName().toString() );
         }
         session.write( req.getResultResponse() );
     }
 
-    
+
     public void objectChanged( NamingEvent evt )
     {
         // send the entry back
         sendEntry( evt );
     }
 
+
     public void objectAdded( NamingEvent evt )
     {
         // send the entry back
         sendEntry( evt );
     }
 
+
     public void objectRemoved( NamingEvent evt )
     {
         // send the entry back
         sendEntry( evt );
     }
 
+
     public void objectRenamed( NamingEvent evt )
     {
         // send the entry back
         sendEntry( evt );
     }
 
-    private void sendEntry( NamingEvent evt ) 
+
+    private void sendEntry( NamingEvent evt )
     {
         /*
          * @todo eventually you'll want to add the changeNumber once we move 
@@ -198,11 +200,12 @@
             ecControl = new EntryChangeControl();
             respEntry.add( ecControl );
         }
-        
+
         switch ( evt.getType() )
         {
-            case( NamingEvent.OBJECT_ADDED ):
-                if ( ! control.isNotificationEnabled( ChangeType.ADD ) ) return;
+            case ( NamingEvent.OBJECT_ADDED  ):
+                if ( !control.isNotificationEnabled( ChangeType.ADD ) )
+                    return;
                 respEntry.setObjectName( evt.getNewBinding().getName() );
                 respEntry.setAttributes( ( Attributes ) evt.getChangeInfo() );
                 if ( ecControl != null )
@@ -210,8 +213,9 @@
                     ecControl.setChangeType( ChangeType.ADD );
                 }
                 break;
-            case( NamingEvent.OBJECT_CHANGED ):
-                if ( ! control.isNotificationEnabled( ChangeType.MODIFY ) ) return;
+            case ( NamingEvent.OBJECT_CHANGED  ):
+                if ( !control.isNotificationEnabled( ChangeType.MODIFY ) )
+                    return;
                 respEntry.setObjectName( evt.getOldBinding().getName() );
                 respEntry.setAttributes( ( Attributes ) evt.getOldBinding().getObject() );
                 if ( ecControl != null )
@@ -219,8 +223,9 @@
                     ecControl.setChangeType( ChangeType.MODIFY );
                 }
                 break;
-            case( NamingEvent.OBJECT_REMOVED ):
-                if ( ! control.isNotificationEnabled( ChangeType.DELETE ) ) return;
+            case ( NamingEvent.OBJECT_REMOVED  ):
+                if ( !control.isNotificationEnabled( ChangeType.DELETE ) )
+                    return;
                 respEntry.setObjectName( evt.getOldBinding().getName() );
                 respEntry.setAttributes( ( Attributes ) evt.getOldBinding().getObject() );
                 if ( ecControl != null )
@@ -228,8 +233,9 @@
                     ecControl.setChangeType( ChangeType.DELETE );
                 }
                 break;
-            case( NamingEvent.OBJECT_RENAMED ):
-                if ( ! control.isNotificationEnabled( ChangeType.MODDN ) ) return;
+            case ( NamingEvent.OBJECT_RENAMED  ):
+                if ( !control.isNotificationEnabled( ChangeType.MODDN ) )
+                    return;
                 respEntry.setObjectName( evt.getNewBinding().getName() );
                 respEntry.setAttributes( ( Attributes ) evt.getNewBinding().getObject() );
                 if ( ecControl != null )
@@ -241,7 +247,7 @@
             default:
                 return;
         }
-        
+
         session.write( respEntry );
     }
 

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java Fri Feb 10 02:48:07 2006
@@ -66,7 +66,7 @@
     private static final Logger log = LoggerFactory.getLogger( SearchHandler.class );
     private static final String DEREFALIASES_KEY = "java.naming.ldap.derefAliases";
 
-    
+
     /**
      * Builds the JNDI search controls for a SearchRequest.
      *  
@@ -87,7 +87,7 @@
         return controls;
     }
 
-    
+
     /**
      * Determines if a search request is on the RootDSE of the server.
      * 
@@ -105,7 +105,7 @@
         }
         return isBaseIsRoot && isBaseScope && isRootDSEFilter;
     }
-    
+
 
     /**
      * Main message handing method for search requests.
@@ -118,17 +118,17 @@
         String[] ids = null;
         Collection retAttrs = new HashSet();
         retAttrs.addAll( req.getAttributes() );
-        
+
         // add the search request to the registry of outstanding requests for this session
         SessionRegistry.getSingleton().addOutstandingRequest( session, req );
 
         // check the attributes to see if a referral's ref attribute is included
-        if( retAttrs.size() > 0 && !retAttrs.contains( "ref" ) )
+        if ( retAttrs.size() > 0 && !retAttrs.contains( "ref" ) )
         {
             retAttrs.add( "ref" );
             ids = ( String[] ) retAttrs.toArray( ArrayUtils.EMPTY_STRING_ARRAY );
         }
-        else if( retAttrs.size() > 0 )
+        else if ( retAttrs.size() > 0 )
         {
             ids = ( String[] ) retAttrs.toArray( ArrayUtils.EMPTY_STRING_ARRAY );
         }
@@ -145,7 +145,7 @@
             if ( isRootDSESearch )
             {
                 LdapContext unknown = SessionRegistry.getSingleton().getLdapContextOnRootDSEAccess( session, null );
-                if ( ! ( unknown instanceof ServerLdapContext ) )
+                if ( !( unknown instanceof ServerLdapContext ) )
                 {
                     ctx = ( ServerLdapContext ) unknown.lookup( "" );
                 }
@@ -158,7 +158,7 @@
             else
             {
                 LdapContext unknown = SessionRegistry.getSingleton().getLdapContext( session, null, true );
-                if ( ! ( unknown instanceof ServerLdapContext ) )
+                if ( !( unknown instanceof ServerLdapContext ) )
                 {
                     ctx = ( ServerLdapContext ) unknown.lookup( "" );
                 }
@@ -185,7 +185,7 @@
             boolean allowAnonymousBinds = cfg.isAllowAnonymousAccess();
             boolean isAnonymousUser = ( ( ServerLdapContext ) ctx ).getPrincipal().getName().trim().equals( "" );
 
-            if ( isAnonymousUser && ! allowAnonymousBinds && ! isRootDSESearch )
+            if ( isAnonymousUser && !allowAnonymousBinds && !isRootDSESearch )
             {
                 LdapResult result = req.getResultResponse().getLdapResult();
                 result.setResultCode( ResultCodeEnum.INSUFFICIENTACCESSRIGHTS );
@@ -199,25 +199,26 @@
             // Handle psearch differently
             // ===============================================================
 
-            PersistentSearchControl psearchControl = ( PersistentSearchControl ) 
-                req.getControls().get( PersistentSearchControl.CONTROL_OID );
+            PersistentSearchControl psearchControl = ( PersistentSearchControl ) req.getControls().get(
+                PersistentSearchControl.CONTROL_OID );
             if ( psearchControl != null )
             {
                 // there are no limits for psearch processing
                 controls.setCountLimit( 0 );
                 controls.setTimeLimit( 0 );
-                
-                if ( ! psearchControl.isChangesOnly() )
+
+                if ( !psearchControl.isChangesOnly() )
                 {
-                    list = ( ( ServerLdapContext ) ctx ).search( new LdapName( req.getBase() ), req.getFilter(), controls );
+                    list = ( ( ServerLdapContext ) ctx ).search( new LdapName( req.getBase() ), req.getFilter(),
+                        controls );
                     if ( list instanceof AbandonListener )
                     {
                         req.addAbandonListener( ( AbandonListener ) list );
                     }
-                    if( list.hasMore() )
+                    if ( list.hasMore() )
                     {
                         Iterator it = new SearchResponseIterator( req, ctx, list, controls.getSearchScope() );
-                        while( it.hasNext() )
+                        while ( it.hasNext() )
                         {
                             Response resp = ( Response ) it.next();
                             if ( resp instanceof SearchResponseDone )
@@ -233,7 +234,8 @@
                                 // instead of returning the DONE response we break from the
                                 // loop and user the notification listener to send back 
                                 // notificationss to the client in never ending search
-                                else break;
+                                else
+                                    break;
                             }
                             else
                             {
@@ -242,7 +244,7 @@
                         }
                     }
                 }
-                
+
                 // now we process entries for ever as they change 
                 PersistentSearchListener handler = new PersistentSearchListener( ctx, session, req );
                 StringBuffer buf = new StringBuffer();
@@ -251,7 +253,7 @@
                 SessionRegistry.getSingleton().addOutstandingRequest( session, req );
                 return;
             }
-            
+
             // ===============================================================
             // Handle regular search requests from here down
             // ===============================================================
@@ -265,11 +267,11 @@
             {
                 req.addAbandonListener( ( AbandonListener ) list );
             }
-            
-            if( list.hasMore() )
+
+            if ( list.hasMore() )
             {
                 Iterator it = new SearchResponseIterator( req, ctx, list, controls.getSearchScope() );
-                while( it.hasNext() )
+                while ( it.hasNext() )
                 {
                     session.write( it.next() );
                 }
@@ -281,14 +283,14 @@
                 list.close();
                 req.getResultResponse().getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
                 Iterator it = Collections.singleton( req.getResultResponse() ).iterator();
-                while( it.hasNext() )
+                while ( it.hasNext() )
                 {
                     session.write( it.next() );
                 }
                 return;
             }
         }
-        catch( ReferralException e )
+        catch ( ReferralException e )
         {
             LdapResult result = req.getResultResponse().getLdapResult();
             ReferralImpl refs = new ReferralImpl();
@@ -301,12 +303,12 @@
             {
                 refs.addLdapUrl( ( String ) e.getReferralInfo() );
             }
-            while( e.skipReferral() );
+            while ( e.skipReferral() );
             session.write( req.getResultResponse() );
             SessionRegistry.getSingleton().removeOutstandingRequest( session, req.getMessageId() );
             return;
         }
-        catch( NamingException e )
+        catch ( NamingException e )
         {
             /*
              * From RFC 2251 Section 4.11:
@@ -324,7 +326,7 @@
             {
                 return;
             }
-            
+
             String msg = "failed on search operation";
             if ( log.isDebugEnabled() )
             {
@@ -332,7 +334,7 @@
             }
 
             ResultCodeEnum code = null;
-            if( e instanceof LdapException )
+            if ( e instanceof LdapException )
             {
                 code = ( ( LdapException ) e ).getResultCode();
             }
@@ -345,17 +347,15 @@
             result.setResultCode( code );
             result.setErrorMessage( msg );
 
-            if ( ( e.getResolvedName() != null ) &&
-                    ( ( code == ResultCodeEnum.NOSUCHOBJECT ) ||
-                      ( code == ResultCodeEnum.ALIASPROBLEM ) ||
-                      ( code == ResultCodeEnum.INVALIDDNSYNTAX ) ||
-                      ( code == ResultCodeEnum.ALIASDEREFERENCINGPROBLEM ) ) )
+            if ( ( e.getResolvedName() != null )
+                && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )
+                    || ( code == ResultCodeEnum.INVALIDDNSYNTAX ) || ( code == ResultCodeEnum.ALIASDEREFERENCINGPROBLEM ) ) )
             {
                 result.setMatchedDn( e.getResolvedName().toString() );
             }
 
             Iterator it = Collections.singleton( req.getResultResponse() ).iterator();
-            while( it.hasNext() )
+            while ( it.hasNext() )
             {
                 session.write( it.next() );
             }
@@ -365,7 +365,14 @@
         {
             if ( list != null )
             {
-                try { list.close(); } catch( NamingException e ){ log.error("failed on list.close()", e ); } 
+                try
+                {
+                    list.close();
+                }
+                catch ( NamingException e )
+                {
+                    log.error( "failed on list.close()", e );
+                }
             }
         }
     }

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java Fri Feb 10 02:48:07 2006
@@ -70,7 +70,7 @@
      * @param req the search request to generate responses to
      * @param underlying the underlying JNDI enumeration containing SearchResults
      */
-    public SearchResponseIterator( SearchRequest req, ServerLdapContext ctx, NamingEnumeration underlying, int scope )
+    public SearchResponseIterator(SearchRequest req, ServerLdapContext ctx, NamingEnumeration underlying, int scope)
     {
         this.req = req;
         this.ctx = ctx;
@@ -79,7 +79,7 @@
 
         try
         {
-            if( underlying.hasMore() )
+            if ( underlying.hasMore() )
             {
                 SearchResult result = ( SearchResult ) underlying.next();
 
@@ -88,7 +88,8 @@
                  * local variable for the following call to next()
                  */
                 Attribute ref = result.getAttributes().get( "ref" );
-                if( ! ctx.isReferral( result.getName() ) || req.getControls().containsKey( ManageDsaITControl.CONTROL_OID ) )
+                if ( !ctx.isReferral( result.getName() )
+                    || req.getControls().containsKey( ManageDsaITControl.CONTROL_OID ) )
                 {
                     SearchResponseEntry respEntry;
                     respEntry = new SearchResponseEntryImpl( req.getMessageId() );
@@ -102,7 +103,7 @@
                     respRef = new SearchResponseReferenceImpl( req.getMessageId() );
                     respRef.setReferral( new ReferralImpl() );
 
-                    for( int ii = 0; ii < ref.size(); ii ++ )
+                    for ( int ii = 0; ii < ref.size(); ii++ )
                     {
                         String url;
 
@@ -111,13 +112,13 @@
                             url = ( String ) ref.get( ii );
                             respRef.getReferral().addLdapUrl( url );
                         }
-                        catch( NamingException e )
+                        catch ( NamingException e )
                         {
                             try
                             {
                                 underlying.close();
                             }
-                            catch( Throwable t )
+                            catch ( Throwable t )
                             {
                             }
 
@@ -130,13 +131,13 @@
                 }
             }
         }
-        catch( NamingException e )
+        catch ( NamingException e )
         {
             try
             {
                 this.underlying.close();
             }
-            catch( Exception e2 )
+            catch ( Exception e2 )
             {
             }
 
@@ -144,26 +145,26 @@
         }
     }
 
-    
+
     public boolean hasNext()
     {
         return !done;
     }
 
-    
+
     public Object next()
     {
         Object next = prefetched;
         SearchResult result = null;
 
         // if we're done we got nothing to give back
-        if( done )
+        if ( done )
         {
             throw new NoSuchElementException();
         }
 
         // if respDone has been assembled this is our last object to return
-        if( respDone != null )
+        if ( respDone != null )
         {
             done = true;
             return respDone;
@@ -179,7 +180,7 @@
              * If we have more results from the underlying cursorr then
              * we just set the result and build the response object below.
              */
-            if( underlying.hasMore() )
+            if ( underlying.hasMore() )
             {
                 result = ( SearchResult ) underlying.next();
             }
@@ -189,7 +190,7 @@
                 {
                     underlying.close();
                 }
-                catch( Throwable t )
+                catch ( Throwable t )
                 {
                 }
 
@@ -199,13 +200,13 @@
                 return next;
             }
         }
-        catch( NamingException e )
+        catch ( NamingException e )
         {
             try
             {
                 underlying.close();
             }
-            catch( Throwable t )
+            catch ( Throwable t )
             {
             }
 
@@ -225,19 +226,19 @@
         {
             isReferral = ctx.isReferral( result.getName() );
         }
-        catch( NamingException e )
+        catch ( NamingException e )
         {
             log.error( "failed to determine if " + result.getName() + " is a referral", e );
             throw new RuntimeException( e );
         }
-        
-        
+
         // we may need to lookup the object again if the ref attribute was filtered out
         if ( isReferral && ref == null )
         {
             try
             {
-                ref = ctx.getAttributes( result.getName(), new String[]{ "ref" } ).get( "ref" );
+                ref = ctx.getAttributes( result.getName(), new String[]
+                    { "ref" } ).get( "ref" );
             }
             catch ( NamingException e )
             {
@@ -245,8 +246,9 @@
                 throw new RuntimeException( e );
             }
         }
-        
-        if( ! isReferral || req.getControls().containsKey( ManageDsaITControl.CONTROL_OID ) )        {
+
+        if ( !isReferral || req.getControls().containsKey( ManageDsaITControl.CONTROL_OID ) )
+        {
             SearchResponseEntry respEntry = new SearchResponseEntryImpl( req.getMessageId() );
             respEntry.setAttributes( result.getAttributes() );
             respEntry.setObjectName( result.getName() );
@@ -257,7 +259,6 @@
             SearchResponseReference respRef = new SearchResponseReferenceImpl( req.getMessageId() );
             respRef.setReferral( new ReferralImpl() );
 
-            
             for ( int ii = 0; ii < ref.size(); ii++ )
             {
                 String val;
@@ -267,12 +268,12 @@
                 }
                 catch ( NamingException e1 )
                 {
-                    log.error( "failed to access referral url." ); 
+                    log.error( "failed to access referral url." );
                     try
                     {
                         underlying.close();
                     }
-                    catch( Throwable t )
+                    catch ( Throwable t )
                     {
                     }
 
@@ -280,14 +281,14 @@
                     respDone = getResponse( req, e1 );
                     return next;
                 }
-                
+
                 // need to add non-ldap URLs as-is
-                if ( ! val.startsWith( "ldap" ) )
+                if ( !val.startsWith( "ldap" ) )
                 {
                     respRef.getReferral().addLdapUrl( val );
                     continue;
                 }
-                
+
                 // parse the ref value and normalize the DN according to schema 
                 LdapURL ldapUrl = new LdapURL();
                 try
@@ -296,12 +297,14 @@
                 }
                 catch ( LdapURLEncodingException e )
                 {
-                    log.error( "Bad URL ("+ val +") for ref in " + result.getName() + ".  Reference will be ignored." ); 
+                    log
+                        .error( "Bad URL (" + val + ") for ref in " + result.getName()
+                            + ".  Reference will be ignored." );
                     try
                     {
                         underlying.close();
                     }
-                    catch( Throwable t )
+                    catch ( Throwable t )
                     {
                     }
 
@@ -309,7 +312,7 @@
                     respDone = getResponse( req, e );
                     return next;
                 }
-                
+
                 StringBuffer buf = new StringBuffer();
                 buf.append( ldapUrl.getScheme() );
                 buf.append( ldapUrl.getHost() );
@@ -321,25 +324,25 @@
                 buf.append( "/" );
                 buf.append( ldapUrl.getDn() );
                 buf.append( "??" );
-                
+
                 switch ( scope )
                 {
-                    case( SearchControls.SUBTREE_SCOPE ):
+                    case ( SearchControls.SUBTREE_SCOPE  ):
                         buf.append( "sub" );
                         break;
-                        
+
                     // if we search for one level and encounter a referral then search
                     // must be continued at that node using base level search scope
-                    case( SearchControls.ONELEVEL_SCOPE ):
+                    case ( SearchControls.ONELEVEL_SCOPE  ):
                         buf.append( "base" );
                         break;
-                    case( SearchControls.OBJECT_SCOPE ):
+                    case ( SearchControls.OBJECT_SCOPE  ):
                         buf.append( "base" );
                         break;
                     default:
                         throw new IllegalStateException( "Unknown recognized search scope: " + scope );
                 }
-                
+
                 respRef.getReferral().addLdapUrl( buf.toString() );
             }
 
@@ -349,7 +352,7 @@
         return next;
     }
 
-    
+
     /**
      * Unsupported so it throws an exception.
      *
@@ -371,7 +374,7 @@
 
         SearchResponseDone resp = ( SearchResponseDone ) req.getResultResponse();
         ResultCodeEnum code = null;
-        if( e instanceof LdapException )
+        if ( e instanceof LdapException )
         {
             code = ( ( LdapException ) e ).getResultCode();
         }
@@ -382,15 +385,13 @@
 
         resp.getLdapResult().setResultCode( code );
         resp.getLdapResult().setErrorMessage( msg );
-        
+
         if ( e instanceof NamingException )
         {
-            NamingException ne = ( NamingException ) e; 
-            if ( ( ne.getResolvedName() != null ) &&
-                    ( ( code == ResultCodeEnum.NOSUCHOBJECT ) ||
-                      ( code == ResultCodeEnum.ALIASPROBLEM ) ||
-                      ( code == ResultCodeEnum.INVALIDDNSYNTAX ) ||
-                      ( code == ResultCodeEnum.ALIASDEREFERENCINGPROBLEM ) ) )
+            NamingException ne = ( NamingException ) e;
+            if ( ( ne.getResolvedName() != null )
+                && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )
+                    || ( code == ResultCodeEnum.INVALIDDNSYNTAX ) || ( code == ResultCodeEnum.ALIASDEREFERENCINGPROBLEM ) ) )
             {
                 resp.getLdapResult().setMatchedDn( ne.getResolvedName().toString() );
             }

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/UnbindHandler.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/UnbindHandler.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/UnbindHandler.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/UnbindHandler.java Fri Feb 10 02:48:07 2006
@@ -40,7 +40,7 @@
 {
     private static final Logger log = LoggerFactory.getLogger( UnbindHandler.class );
 
-    
+
     public void messageReceived( IoSession session, Object request )
     {
         SessionRegistry registry = SessionRegistry.getSingleton();
@@ -48,7 +48,7 @@
         try
         {
             LdapContext ctx = ( LdapContext ) SessionRegistry.getSingleton().getLdapContext( session, null, false );
-            
+
             if ( ctx != null )
             {
                 if ( ctx instanceof ServerLdapContext && ( ( ServerLdapContext ) ctx ).getService().isStarted() )

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/GracefulShutdownHandler.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/GracefulShutdownHandler.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/GracefulShutdownHandler.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/GracefulShutdownHandler.java Fri Feb 10 02:48:07 2006
@@ -41,7 +41,6 @@
 import org.apache.directory.shared.ldap.message.extended.GracefulShutdownResponse;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
 
-
 import org.apache.mina.common.IoAcceptor;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.WriteFuture;
@@ -56,7 +55,7 @@
 {
     private static final Logger log = LoggerFactory.getLogger( GracefulShutdownHandler.class );
     public static final Set EXTENSION_OIDS;
-    
+
     static
     {
         Set set = new HashSet( 3 );
@@ -65,19 +64,19 @@
         set.add( GracefulDisconnect.EXTENSION_OID );
         EXTENSION_OIDS = Collections.unmodifiableSet( set );
     }
-    
+
     private ServiceRegistry serviceRegistry;
     private Service ldapService;
-    
+
 
     public String getOid()
     {
         return GracefulShutdownRequest.EXTENSION_OID;
     }
 
-    
-    public void handleExtendedOperation( IoSession requestor, SessionRegistry registry, ExtendedRequest req ) 
-        throws NamingException 
+
+    public void handleExtendedOperation( IoSession requestor, SessionRegistry registry, ExtendedRequest req )
+        throws NamingException
     {
         DirectoryService service = null;
         ServerLdapContext slc = null;
@@ -94,7 +93,7 @@
         else
         {
             log.error( "Encountered session context which was not a ServerLdapContext" );
-            GracefulShutdownResponse msg = new GracefulShutdownResponse( req.getMessageId(), 
+            GracefulShutdownResponse msg = new GracefulShutdownResponse( req.getMessageId(),
                 ResultCodeEnum.OPERATIONSERROR );
             msg.getLdapResult().setErrorMessage( "The session context was not a ServerLdapContext" );
             requestor.write( msg );
@@ -103,23 +102,23 @@
 
         // make sue only the administrator can issue this shutdown request if 
         // not we respond to the requestor with with insufficientAccessRights(50)
-        if ( ! slc.getPrincipal().getName().equalsIgnoreCase( DirectoryPartitionNexus.ADMIN_PRINCIPAL ) )
+        if ( !slc.getPrincipal().getName().equalsIgnoreCase( DirectoryPartitionNexus.ADMIN_PRINCIPAL ) )
         {
             if ( log.isInfoEnabled() )
             {
-                log.info( "Rejected with insufficientAccessRights to attempt for server shutdown by " 
+                log.info( "Rejected with insufficientAccessRights to attempt for server shutdown by "
                     + slc.getPrincipal().getName() );
             }
-            
-            requestor.write( new GracefulShutdownResponse( req.getMessageId(), 
-                ResultCodeEnum.INSUFFICIENTACCESSRIGHTS ) );
+
+            requestor
+                .write( new GracefulShutdownResponse( req.getMessageId(), ResultCodeEnum.INSUFFICIENTACCESSRIGHTS ) );
             return;
         }
-        
+
         // -------------------------------------------------------------------
         // handle the body of this operation below here
         // -------------------------------------------------------------------
-        
+
         IoAcceptor acceptor = serviceRegistry.getAcceptor( ldapService.getTransportType() );
         List sessions = new ArrayList( acceptor.getManagedSessions( ldapService.getAddress() ) );
         StartupConfiguration cfg = service.getConfiguration().getStartupConfiguration();
@@ -134,7 +133,7 @@
 
         // wait for the specified delay before we unbind the service 
         waitForDelay( gsreq.getDelay() );
-        
+
         // -------------------------------------------------------------------
         // unbind the server socket for the LDAP service here so no new 
         // connections are accepted while we process this shutdown request
@@ -145,7 +144,7 @@
         //                       .setDisconnectClientsOnUnbind( false );
         // -------------------------------------------------------------------
         serviceRegistry.unbind( ldapService );
-        
+
         // -------------------------------------------------------------------
         // synchronously send a NoD to clients that are not aware of this resp
         // after sending the NoD the client is disconnected if still connected
@@ -165,11 +164,11 @@
         {
             System.exit( 0 );
         }
-        
+
         return;
     }
-    
-    
+
+
     /**
      * Sends a successful response.
      * 
@@ -194,8 +193,8 @@
         }
         requestor.close();
     }
-    
-    
+
+
     /**
      * Blocks to synchronously send the same GracefulDisconnect message to all 
      * managed sessions except for the requestor of the GracefulShutdown.
@@ -206,29 +205,29 @@
     public static void sendGracefulDisconnect( List sessions, GracefulDisconnect msg, IoSession requestor )
     {
         List writeFutures = new ArrayList();
-        
+
         // asynchronously send GracefulDisconnection messages to all connected
         // clients giving time for the message to arrive before we block 
         // waiting for message delivery to the client in the loop below
-        
-        if( sessions != null )
+
+        if ( sessions != null )
         {
-            for( Iterator i = sessions.iterator(); i.hasNext(); )
+            for ( Iterator i = sessions.iterator(); i.hasNext(); )
             {
                 IoSession session = session = ( IoSession ) i.next();
-                
+
                 // make sure we do not send the disconnect mesasge to the 
                 // client which sent the initiating GracefulShutdown request
                 if ( session.equals( requestor ) )
                 {
                     continue;
                 }
-                
+
                 try
                 {
                     writeFutures.add( session.write( msg ) );
                 }
-                catch( Exception e )
+                catch ( Exception e )
                 {
                     log.warn( "Failed to write GracefulDisconnect to client session: " + session, e );
                 }
@@ -236,14 +235,14 @@
         }
 
         // wait for GracefulDisconnect messages to be sent before returning
-        for( Iterator i = writeFutures.iterator(); i.hasNext(); )
+        for ( Iterator i = writeFutures.iterator(); i.hasNext(); )
         {
             WriteFuture future = ( WriteFuture ) i.next();
             try
             {
                 future.join( 1000 );
             }
-            catch( Exception e )
+            catch ( Exception e )
             {
                 log.warn( "Failed to sent GracefulDisconnect", e );
             }
@@ -261,14 +260,14 @@
     public static void sendNoticeOfDisconnect( List sessions, IoSession requestor )
     {
         List writeFutures = new ArrayList();
-        
+
         // Send Notification of Disconnection messages to all connected clients.
-        if( sessions != null )
+        if ( sessions != null )
         {
-            for( Iterator i = sessions.iterator(); i.hasNext(); )
+            for ( Iterator i = sessions.iterator(); i.hasNext(); )
             {
                 IoSession session = session = ( IoSession ) i.next();
-                
+
                 // make sure we do not send the disconnect mesasge to the 
                 // client which sent the initiating GracefulShutdown request
                 if ( session.equals( requestor ) )
@@ -280,7 +279,7 @@
                 {
                     writeFutures.add( session.write( NoticeOfDisconnect.UNAVAILABLE ) );
                 }
-                catch( Exception e )
+                catch ( Exception e )
                 {
                     log.warn( "Failed to sent NoD for client: " + session, e );
                 }
@@ -289,7 +288,7 @@
 
         // And close the connections when the NoDs are sent.
         Iterator sessionIt = sessions.iterator();
-        for( Iterator i = writeFutures.iterator(); i.hasNext(); )
+        for ( Iterator i = writeFutures.iterator(); i.hasNext(); )
         {
             WriteFuture future = ( WriteFuture ) i.next();
             try
@@ -297,7 +296,7 @@
                 future.join( 1000 );
                 ( ( IoSession ) sessionIt.next() ).close();
             }
-            catch( Exception e )
+            catch ( Exception e )
             {
                 log.warn( "Failed to sent NoD.", e );
             }
@@ -310,12 +309,12 @@
         // build the graceful disconnect message with replicationContexts
         GracefulDisconnect notice = new GracefulDisconnect( timeOffline, delay );
         // @todo add the referral objects for replication contexts using setup code below
-//        Iterator list = nexus.listSuffixes( true );
-//        while ( list.hasNext() )
-//        {
-//            LdapName dn = new LdapName( ( String ) list.next() );
-//            DirectoryPartition partition = nexus.getPartition( dn );
-//        }
+        //        Iterator list = nexus.listSuffixes( true );
+        //        while ( list.hasNext() )
+        //        {
+        //            LdapName dn = new LdapName( ( String ) list.next() );
+        //            DirectoryPartition partition = nexus.getPartition( dn );
+        //        }
         return notice;
     }
 
@@ -327,7 +326,7 @@
             // delay is in seconds
             long delayMillis = delay * 1000;
             long startTime = System.currentTimeMillis();
-            
+
             while ( ( System.currentTimeMillis() - startTime ) < delayMillis )
             {
                 try

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LaunchDiagnosticUiHandler.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LaunchDiagnosticUiHandler.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LaunchDiagnosticUiHandler.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LaunchDiagnosticUiHandler.java Fri Feb 10 02:48:07 2006
@@ -52,7 +52,7 @@
 public class LaunchDiagnosticUiHandler implements ExtendedOperationHandler
 {
     public static final Set EXTENSION_OIDS;
-    
+
     static
     {
         Set set = new HashSet( 3 );
@@ -60,31 +60,33 @@
         set.add( LaunchDiagnosticUiResponse.EXTENSION_OID );
         EXTENSION_OIDS = Collections.unmodifiableSet( set );
     }
-    
+
     private Service ldapService;
     private ServiceRegistry minaRegistry;
     private LdapProtocolProvider ldapProvider;
-    
-    
+
+
     public String getOid()
     {
         return LaunchDiagnosticUiRequest.EXTENSION_OID;
     }
 
-    
-    public void handleExtendedOperation( IoSession requestor, SessionRegistry registry, ExtendedRequest req ) throws NamingException 
+
+    public void handleExtendedOperation( IoSession requestor, SessionRegistry registry, ExtendedRequest req )
+        throws NamingException
     {
         LdapContext ctx = registry.getLdapContext( requestor, null, false );
         ctx = ( LdapContext ) ctx.lookup( "" );
-        
+
         if ( ctx instanceof ServerLdapContext )
         {
             ServerLdapContext slc = ( ServerLdapContext ) ctx;
             DirectoryService service = slc.getService();
-            
-            if ( ! slc.getPrincipal().getName().equalsIgnoreCase( DirectoryPartitionNexus.ADMIN_PRINCIPAL ) )
+
+            if ( !slc.getPrincipal().getName().equalsIgnoreCase( DirectoryPartitionNexus.ADMIN_PRINCIPAL ) )
             {
-                requestor.write( new LaunchDiagnosticUiResponse( req.getMessageId(), ResultCodeEnum.INSUFFICIENTACCESSRIGHTS ) );
+                requestor.write( new LaunchDiagnosticUiResponse( req.getMessageId(),
+                    ResultCodeEnum.INSUFFICIENTACCESSRIGHTS ) );
                 return;
             }
 
@@ -102,24 +104,24 @@
                     BTreeDirectoryPartition btPartition = ( BTreeDirectoryPartition ) partition;
                     PartitionFrame frame = new PartitionFrame( btPartition, btPartition.getSearchEngine() );
                     Point pos = getCenteredPosition( frame );
-                    pos.y = launchedWindowCount*20 + pos.y;
+                    pos.y = launchedWindowCount * 20 + pos.y;
                     double multiplier = getAspectRatio() * 20.0;
-                    pos.x =  ( int ) ( launchedWindowCount * multiplier ) + pos.x;
+                    pos.x = ( int ) ( launchedWindowCount * multiplier ) + pos.x;
                     frame.setLocation( pos );
                     frame.setVisible( true );
                     launchedWindowCount++;
                 }
             }
-            
+
             SessionsFrame sessions = new SessionsFrame();
             sessions.setMinaRegistry( minaRegistry );
             sessions.setLdapService( ldapService );
             sessions.setRequestor( requestor );
             sessions.setLdapProvider( ldapProvider.getHandler() );
             Point pos = getCenteredPosition( sessions );
-            pos.y = launchedWindowCount*20 + pos.y;
+            pos.y = launchedWindowCount * 20 + pos.y;
             double multiplier = getAspectRatio() * 20.0;
-            pos.x =  ( int ) ( launchedWindowCount * multiplier ) + pos.x;
+            pos.x = ( int ) ( launchedWindowCount * multiplier ) + pos.x;
             sessions.setLocation( pos );
             sessions.setVisible( true );
             return;
@@ -127,16 +129,16 @@
 
         requestor.write( new LaunchDiagnosticUiResponse( req.getMessageId(), ResultCodeEnum.OPERATIONSERROR ) );
     }
-    
-    
+
+
     public double getAspectRatio()
     {
         Toolkit tk = Toolkit.getDefaultToolkit();
         Dimension screenSize = tk.getScreenSize();
         return ( double ) screenSize.getWidth() / ( double ) screenSize.getHeight();
     }
-    
-    
+
+
     public Point getCenteredPosition( JFrame frame )
     {
         Point pt = new Point();

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapProtocolProviderTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapProtocolProviderTest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapProtocolProviderTest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapProtocolProviderTest.java Fri Feb 10 02:48:07 2006
@@ -72,6 +72,7 @@
         assertTrue( provider.getName() == LdapProtocolProvider.SERVICE_NAME );
     }
 
+
     /**
      * Tests to make sure handlers for alternative configurations are kicking
      * in properly with the right request type.
@@ -118,7 +119,6 @@
         assertTrue( provider.getName() == LdapProtocolProvider.SERVICE_NAME );
     }
 
-
     public static class BogusAbandonHandler implements MessageHandler
     {
         public void messageReceived( IoSession session, Object request )
@@ -167,7 +167,6 @@
         }
     }
 
-
     public static class BogusModifyDnHandler implements MessageHandler
     {
         public void messageReceived( IoSession session, Object request )
@@ -176,7 +175,6 @@
         }
     }
 
-
     public static class BogusModifyHandler implements MessageHandler
     {
         public void messageReceived( IoSession session, Object request )
@@ -184,7 +182,6 @@
             throw new NotImplementedException( "handler not implemented!" );
         }
     }
-
 
     public static class BogusSearchHandler implements MessageHandler
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpConfiguration.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.directory.server.ntp;
 
+
 import java.util.Dictionary;
 import java.util.HashMap;
 import java.util.Map;
@@ -26,6 +27,7 @@
 import org.apache.directory.server.protocol.shared.LoadStrategy;
 import org.apache.directory.server.protocol.shared.ServiceConfiguration;
 
+
 public class NtpConfiguration extends ServiceConfiguration
 {
     private static final long serialVersionUID = 2961795205765175775L;
@@ -42,6 +44,7 @@
     /** the default prefix */
     private static final String DEFAULT_PREFIX = "ntp.";
 
+
     /**
      * Creates a new instance with default settings.
      */
@@ -50,22 +53,25 @@
         this( getDefaultConfig(), LoadStrategy.LDAP );
     }
 
+
     /**
      * Creates a new instance with default settings that operates on the
      * {@link DirectoryService} with the specified ID.
      */
-    public NtpConfiguration( String instanceId )
+    public NtpConfiguration(String instanceId)
     {
         this( getDefaultConfig(), LoadStrategy.LDAP );
         setInstanceId( instanceId );
     }
 
-    public NtpConfiguration( Map properties )
+
+    public NtpConfiguration(Map properties)
     {
         this( properties, LoadStrategy.LDAP );
     }
 
-    public NtpConfiguration( Map properties, int strategy )
+
+    public NtpConfiguration(Map properties, int strategy)
     {
         if ( properties == null )
         {
@@ -84,6 +90,7 @@
         }
     }
 
+
     public static Map getDefaultConfig()
     {
         Map defaults = new HashMap();
@@ -94,11 +101,12 @@
         return defaults;
     }
 
+
     public boolean isDifferent( Dictionary config )
     {
         int port = getPort();
 
-        if ( port == Integer.parseInt( (String) config.get( IP_PORT_KEY ) ) )
+        if ( port == Integer.parseInt( ( String ) config.get( IP_PORT_KEY ) ) )
         {
             return false;
         }
@@ -106,10 +114,12 @@
         return true;
     }
 
+
     public String getName()
     {
         return DEFAULT_NAME;
     }
+
 
     public int getPort()
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpException.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpException.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpException.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpException.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.directory.server.ntp;
 
+
 /**
  * The root of the NTP exception hierarchy.
  *
@@ -27,6 +28,7 @@
 {
     private static final long serialVersionUID = -225862469671550203L;
 
+
     /**
      * Creates an NtpException.
      */
@@ -35,31 +37,34 @@
         super();
     }
 
+
     /**
      * Creates an NtpException with a message and cause.
      * 
      * @param message the message
      * @param cause the cause
      */
-    public NtpException( String message, Throwable cause )
+    public NtpException(String message, Throwable cause)
     {
         super( message, cause );
     }
 
+
     /**
      * Creates an NtpException with a message.
      * 
      * @param message the message
      */
-    public NtpException( String message )
+    public NtpException(String message)
     {
         super( message );
     }
 
+
     /**
      * @param cause the cause
      */
-    public NtpException( Throwable cause )
+    public NtpException(Throwable cause)
     {
         super( cause );
     }

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.directory.server.ntp;
 
+
 import java.io.IOException;
 import java.util.Dictionary;
 
@@ -28,6 +29,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 public class NtpServer
 {
     /** the log for this class */
@@ -40,7 +42,8 @@
     private Service tcpService;
     private Service udpService;
 
-    public NtpServer( NtpConfiguration config, ServiceRegistry registry )
+
+    public NtpServer(NtpConfiguration config, ServiceRegistry registry)
     {
         this.config = config;
         this.registry = registry;
@@ -66,10 +69,12 @@
         }
     }
 
+
     public boolean isDifferent( Dictionary newConfig )
     {
         return config.isDifferent( newConfig );
     }
+
 
     public void destroy()
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpService.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpService.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpService.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpService.java Fri Feb 10 02:48:07 2006
@@ -17,7 +17,9 @@
 
 package org.apache.directory.server.ntp;
 
+
 import org.apache.directory.server.ntp.messages.NtpMessage;
+
 
 /**
  * NTP Protocol (RFC 2030)

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/io/NtpMessageDecoder.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/io/NtpMessageDecoder.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/io/NtpMessageDecoder.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/io/NtpMessageDecoder.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.directory.server.ntp.io;
 
+
 import java.nio.ByteBuffer;
 
 import org.apache.directory.server.ntp.messages.LeapIndicatorType;
@@ -27,6 +28,7 @@
 import org.apache.directory.server.ntp.messages.ReferenceIdentifier;
 import org.apache.directory.server.ntp.messages.StratumType;
 
+
 public class NtpMessageDecoder
 {
     public NtpMessage decode( ByteBuffer request )
@@ -46,7 +48,7 @@
         modifier.setReferenceTimestamp( new NtpTimeStamp( request ) );
         modifier.setOriginateTimestamp( new NtpTimeStamp( request ) );
 
-        byte[] unneededBytes = new byte[ 8 ];
+        byte[] unneededBytes = new byte[8];
         request.get( unneededBytes );
 
         modifier.setReceiveTimestamp( new NtpTimeStamp() );
@@ -55,48 +57,57 @@
         return modifier.getNtpMessage();
     }
 
+
     private LeapIndicatorType parseLeapIndicator( byte header )
     {
         return LeapIndicatorType.getTypeByOrdinal( ( header & 0xc0 ) >>> 6 );
     }
 
+
     private int parseVersionNumber( byte header )
     {
         return ( header & 0x38 ) >>> 3;
     }
 
+
     private ModeType parseMode( byte header )
     {
         return ModeType.getTypeByOrdinal( header & 0x07 );
     }
 
+
     private StratumType parseStratum( ByteBuffer request )
     {
         return StratumType.getTypeByOrdinal( request.get() );
     }
 
+
     private byte parsePollInterval( ByteBuffer bytes )
     {
-        return (byte) Math.round( Math.pow( 2, bytes.get() ) );
+        return ( byte ) Math.round( Math.pow( 2, bytes.get() ) );
     }
 
+
     private byte parsePrecision( ByteBuffer bytes )
     {
-        return (byte) ( 1000 * Math.pow( 2, bytes.get() ) );
+        return ( byte ) ( 1000 * Math.pow( 2, bytes.get() ) );
     }
 
+
     private ReferenceIdentifier parseReferenceIdentifier( ByteBuffer request )
     {
-        byte[] nextFourBytes = new byte[ 4 ];
+        byte[] nextFourBytes = new byte[4];
         request.get( nextFourBytes );
         return ReferenceIdentifier.getTypeByName( new String( nextFourBytes ) );
     }
 
+
     private int parseRootDelay( ByteBuffer bytes )
     {
         int temp = 256 * ( 256 * ( 256 * bytes.get() + bytes.get() ) + bytes.get() ) + bytes.get();
         return 1000 * ( temp / 0x10000 );
     }
+
 
     private int parseRootDispersion( ByteBuffer bytes )
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/io/NtpMessageEncoder.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/io/NtpMessageEncoder.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/io/NtpMessageEncoder.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/io/NtpMessageEncoder.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.directory.server.ntp.io;
 
+
 import java.nio.ByteBuffer;
 
 import org.apache.directory.server.ntp.messages.LeapIndicatorType;
@@ -24,6 +25,7 @@
 import org.apache.directory.server.ntp.messages.NtpMessage;
 import org.apache.directory.server.ntp.messages.ReferenceIdentifier;
 
+
 public class NtpMessageEncoder
 {
     public void encode( ByteBuffer byteBuffer, NtpMessage message )
@@ -34,9 +36,9 @@
         header = encodeMode( message.getMode(), header );
         byteBuffer.put( header );
 
-        byteBuffer.put( (byte) ( message.getStratum().getOrdinal() & 0xFF ) );
-        byteBuffer.put( (byte) ( message.getPollInterval() & 0xFF ) );
-        byteBuffer.put( (byte) ( message.getPrecision() & 0xFF ) );
+        byteBuffer.put( ( byte ) ( message.getStratum().getOrdinal() & 0xFF ) );
+        byteBuffer.put( ( byte ) ( message.getPollInterval() & 0xFF ) );
+        byteBuffer.put( ( byte ) ( message.getPrecision() & 0xFF ) );
 
         byteBuffer.putInt( message.getRootDelay() );
         byteBuffer.putInt( message.getRootDispersion() );
@@ -49,31 +51,35 @@
         message.getTransmitTimestamp().writeTo( byteBuffer );
     }
 
+
     private byte encodeLeapIndicator( LeapIndicatorType leapIndicator, byte header )
     {
-        byte twoBits = (byte) ( leapIndicator.getOrdinal() & 0x03 );
-        return (byte) ( ( twoBits << 6 ) | header );
+        byte twoBits = ( byte ) ( leapIndicator.getOrdinal() & 0x03 );
+        return ( byte ) ( ( twoBits << 6 ) | header );
     }
 
+
     private byte encodeVersionNumber( int versionNumber, byte header )
     {
-        byte threeBits = (byte) ( versionNumber & 0x07 );
-        return (byte) ( ( threeBits << 3 ) | header );
+        byte threeBits = ( byte ) ( versionNumber & 0x07 );
+        return ( byte ) ( ( threeBits << 3 ) | header );
     }
 
+
     private byte encodeMode( ModeType mode, byte header )
     {
-        byte threeBits = (byte) ( mode.getOrdinal() & 0x07 );
-        return (byte) ( threeBits | header );
+        byte threeBits = ( byte ) ( mode.getOrdinal() & 0x07 );
+        return ( byte ) ( threeBits | header );
     }
 
+
     private void encodeReferenceIdentifier( ReferenceIdentifier identifier, ByteBuffer byteBuffer )
     {
         char[] characters = identifier.getCode().toCharArray();
 
         for ( int ii = 0; ii < characters.length; ii++ )
         {
-            byteBuffer.put( (byte) characters[ ii ] );
+            byteBuffer.put( ( byte ) characters[ii] );
         }
     }
 }

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/LeapIndicatorType.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/LeapIndicatorType.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/LeapIndicatorType.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/LeapIndicatorType.java Fri Feb 10 02:48:07 2006
@@ -17,10 +17,12 @@
 
 package org.apache.directory.server.ntp.messages;
 
+
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
+
 /**
  * Leap Indicator (LI): This is a two-bit code warning of an impending
  * leap second to be inserted/deleted in the last minute of the current
@@ -35,57 +37,65 @@
  */
 public final class LeapIndicatorType implements Comparable
 {
-	/**
-	 * Enumeration elements are constructed once upon class loading.
-	 * Order of appearance here determines the order of compareTo.
-	 */
-	public static final LeapIndicatorType NO_WARNING           = new LeapIndicatorType(0, "No leap second warning.");
-	public static final LeapIndicatorType POSITIVE_LEAP_SECOND = new LeapIndicatorType(1, "Last minute has 61 seconds.");
-	public static final LeapIndicatorType NEGATIVE_LEAP_SECOND = new LeapIndicatorType(2, "Last minute has 59 seconds.");
-	public static final LeapIndicatorType ALARM_CONDITION      = new LeapIndicatorType(3, "Alarm condition (clock not synchronized).");
+    /**
+     * Enumeration elements are constructed once upon class loading.
+     * Order of appearance here determines the order of compareTo.
+     */
+    public static final LeapIndicatorType NO_WARNING = new LeapIndicatorType( 0, "No leap second warning." );
+    public static final LeapIndicatorType POSITIVE_LEAP_SECOND = new LeapIndicatorType( 1,
+        "Last minute has 61 seconds." );
+    public static final LeapIndicatorType NEGATIVE_LEAP_SECOND = new LeapIndicatorType( 2,
+        "Last minute has 59 seconds." );
+    public static final LeapIndicatorType ALARM_CONDITION = new LeapIndicatorType( 3,
+        "Alarm condition (clock not synchronized)." );
 
     /**
      * These two lines are all that's necessary to export a List of VALUES.
      */
-    private static final LeapIndicatorType[] values = { NO_WARNING, POSITIVE_LEAP_SECOND, NEGATIVE_LEAP_SECOND,
-            ALARM_CONDITION };
+    private static final LeapIndicatorType[] values =
+        { NO_WARNING, POSITIVE_LEAP_SECOND, NEGATIVE_LEAP_SECOND, ALARM_CONDITION };
     // VALUES needs to be located here, otherwise illegal forward reference
     public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
 
     private final String name;
     private final int ordinal;
 
+
     /**
      * Private constructor prevents construction outside of this class.
      */
-    private LeapIndicatorType( int ordinal, String name )
+    private LeapIndicatorType(int ordinal, String name)
     {
         this.ordinal = ordinal;
         this.name = name;
     }
 
+
     public static LeapIndicatorType getTypeByOrdinal( int type )
     {
         for ( int ii = 0; ii < values.length; ii++ )
         {
-            if ( values[ ii ].ordinal == type )
+            if ( values[ii].ordinal == type )
             {
-                return values[ ii ];
+                return values[ii];
             }
         }
 
         return NO_WARNING;
     }
 
+
     public int getOrdinal()
     {
         return ordinal;
     }
 
+
     public int compareTo( Object that )
     {
-        return ordinal - ( (LeapIndicatorType) that ).ordinal;
+        return ordinal - ( ( LeapIndicatorType ) that ).ordinal;
     }
+
 
     public String toString()
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ModeType.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ModeType.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ModeType.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ModeType.java Fri Feb 10 02:48:07 2006
@@ -17,10 +17,12 @@
 
 package org.apache.directory.server.ntp.messages;
 
+
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
+
 /**
  * Mode: This is a three-bit integer indicating the mode, with values
  * defined as follows:
@@ -38,60 +40,66 @@
  */
 public final class ModeType implements Comparable
 {
-	/**
-	 * Enumeration elements are constructed once upon class loading.
-	 * Order of appearance here determines the order of compareTo.
-	 */
-	public static final ModeType RESERVED                 = new ModeType(0, "Reserved mode.");
-	public static final ModeType SYMMETRIC_ACTIVE         = new ModeType(1, "Symmetric active mode.");
-	public static final ModeType RESERVED_PASSIVE         = new ModeType(2, "Symmetric passive mode.");
-	public static final ModeType CLIENT                   = new ModeType(3, "Client mode.");
-	public static final ModeType SERVER                   = new ModeType(4, "Server mode.");
-	public static final ModeType BROADCAST                = new ModeType(5, "Broadcast mode.");
-	public static final ModeType RESERVED_FOR_NTP_CONTROL = new ModeType(6, "Reserved for NTP control message.");
-	public static final ModeType RESERVED_FOR_PRIVATE_USE = new ModeType(7, "Reserved for private use.");
+    /**
+     * Enumeration elements are constructed once upon class loading.
+     * Order of appearance here determines the order of compareTo.
+     */
+    public static final ModeType RESERVED = new ModeType( 0, "Reserved mode." );
+    public static final ModeType SYMMETRIC_ACTIVE = new ModeType( 1, "Symmetric active mode." );
+    public static final ModeType RESERVED_PASSIVE = new ModeType( 2, "Symmetric passive mode." );
+    public static final ModeType CLIENT = new ModeType( 3, "Client mode." );
+    public static final ModeType SERVER = new ModeType( 4, "Server mode." );
+    public static final ModeType BROADCAST = new ModeType( 5, "Broadcast mode." );
+    public static final ModeType RESERVED_FOR_NTP_CONTROL = new ModeType( 6, "Reserved for NTP control message." );
+    public static final ModeType RESERVED_FOR_PRIVATE_USE = new ModeType( 7, "Reserved for private use." );
 
     /**
      * These two lines are all that's necessary to export a List of VALUES.
      */
-    private static final ModeType[] values = { RESERVED, SYMMETRIC_ACTIVE, RESERVED_PASSIVE, CLIENT, SERVER, BROADCAST,
-            RESERVED_FOR_NTP_CONTROL, RESERVED_FOR_PRIVATE_USE };
+    private static final ModeType[] values =
+        { RESERVED, SYMMETRIC_ACTIVE, RESERVED_PASSIVE, CLIENT, SERVER, BROADCAST, RESERVED_FOR_NTP_CONTROL,
+            RESERVED_FOR_PRIVATE_USE };
     // VALUES needs to be located here, otherwise illegal forward reference
     public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
 
     private final String name;
     private final int ordinal;
 
+
     /**
      * Private constructor prevents construction outside of this class.
      */
-    private ModeType( int ordinal, String name )
+    private ModeType(int ordinal, String name)
     {
         this.ordinal = ordinal;
         this.name = name;
     }
 
+
     public static ModeType getTypeByOrdinal( int type )
     {
         for ( int ii = 0; ii < values.length; ii++ )
         {
-            if ( values[ ii ].ordinal == type )
+            if ( values[ii].ordinal == type )
             {
-                return values[ ii ];
+                return values[ii];
             }
         }
         return SERVER;
     }
 
+
     public int getOrdinal()
     {
         return ordinal;
     }
 
+
     public int compareTo( Object that )
     {
-        return ordinal - ( (ModeType) that ).ordinal;
+        return ordinal - ( ( ModeType ) that ).ordinal;
     }
+
 
     public String toString()
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpMessage.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpMessage.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpMessage.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpMessage.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.directory.server.ntp.messages;
 
+
 public class NtpMessage
 {
     private LeapIndicatorType leapIndicator;
@@ -35,10 +36,11 @@
     private NtpTimeStamp receiveTimestamp;
     private NtpTimeStamp transmitTimestamp;
 
-    public NtpMessage( LeapIndicatorType leapIndicator, int versionNumber, ModeType mode, StratumType stratumType,
-            byte pollInterval, byte precision, int rootDelay, int rootDispersion,
-            ReferenceIdentifier referenceIdentifier, NtpTimeStamp referenceTimestamp, NtpTimeStamp originateTimestamp,
-            NtpTimeStamp receiveTimestamp, NtpTimeStamp transmitTimestamp )
+
+    public NtpMessage(LeapIndicatorType leapIndicator, int versionNumber, ModeType mode, StratumType stratumType,
+        byte pollInterval, byte precision, int rootDelay, int rootDispersion, ReferenceIdentifier referenceIdentifier,
+        NtpTimeStamp referenceTimestamp, NtpTimeStamp originateTimestamp, NtpTimeStamp receiveTimestamp,
+        NtpTimeStamp transmitTimestamp)
     {
         this.leapIndicator = leapIndicator;
         this.versionNumber = versionNumber;
@@ -55,6 +57,7 @@
         this.transmitTimestamp = transmitTimestamp;
     }
 
+
     /**
      * @return Returns the Leap Indicator.
      */
@@ -63,6 +66,7 @@
         return leapIndicator;
     }
 
+
     /**
      * @return Returns the Mode.
      */
@@ -71,6 +75,7 @@
         return mode;
     }
 
+
     /**
      * @return Returns the Originate Timestamp.
      */
@@ -79,6 +84,7 @@
         return originateTimestamp;
     }
 
+
     /**
      * @return Returns the Poll Interval.
      */
@@ -87,6 +93,7 @@
         return pollInterval;
     }
 
+
     /**
      * @return Returns the Precision.
      */
@@ -95,6 +102,7 @@
         return precision;
     }
 
+
     /**
      * @return Returns the Receive Timestamp.
      */
@@ -103,6 +111,7 @@
         return receiveTimestamp;
     }
 
+
     /**
      * @return Returns the Reference Identifier.
      */
@@ -111,6 +120,7 @@
         return referenceIdentifier;
     }
 
+
     /**
      * @return Returns the Reference Timestamp.
      */
@@ -119,6 +129,7 @@
         return referenceTimestamp;
     }
 
+
     /**
      * @return Returns the Root Delay.
      */
@@ -127,6 +138,7 @@
         return rootDelay;
     }
 
+
     /**
      * @return Returns the Root Dispersion.
      */
@@ -135,6 +147,7 @@
         return rootDispersion;
     }
 
+
     /**
      * @return Returns the Stratum.
      */
@@ -143,6 +156,7 @@
         return stratumType;
     }
 
+
     /**
      * @return Returns the Transmit Timestamp.
      */
@@ -150,6 +164,7 @@
     {
         return transmitTimestamp;
     }
+
 
     /**
      * @return Returns the Version Number.

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpMessageModifier.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpMessageModifier.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpMessageModifier.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpMessageModifier.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.directory.server.ntp.messages;
 
+
 public class NtpMessageModifier
 {
     private LeapIndicatorType leapIndicator;
@@ -35,13 +36,15 @@
     private NtpTimeStamp receiveTimestamp;
     private NtpTimeStamp transmitTimestamp;
 
+
     public NtpMessage getNtpMessage()
     {
         return new NtpMessage( leapIndicator, versionNumber, mode, stratumType, pollInterval, precision, rootDelay,
-                rootDispersion, referenceIdentifier, referenceTimestamp, originateTimestamp, receiveTimestamp,
-                transmitTimestamp );
+            rootDispersion, referenceIdentifier, referenceTimestamp, originateTimestamp, receiveTimestamp,
+            transmitTimestamp );
     }
 
+
     /**
      * @param leapIndicator The Leap Indicator to set.
      */
@@ -50,6 +53,7 @@
         this.leapIndicator = leapIndicator;
     }
 
+
     /**
      * @param mode The Mode to set.
      */
@@ -58,6 +62,7 @@
         this.mode = mode;
     }
 
+
     /**
      * @param originateTimestamp The Originate Timestamp to set.
      */
@@ -66,6 +71,7 @@
         this.originateTimestamp = originateTimestamp;
     }
 
+
     /**
      * @param pollInterval The Poll Interval to set.
      */
@@ -74,6 +80,7 @@
         this.pollInterval = pollInterval;
     }
 
+
     /**
      * @param precision The Precision to set.
      */
@@ -82,6 +89,7 @@
         this.precision = precision;
     }
 
+
     /**
      * @param receiveTimestamp The Receive Timestamp to set.
      */
@@ -90,6 +98,7 @@
         this.receiveTimestamp = receiveTimestamp;
     }
 
+
     /**
      * @param referenceIdentifier The Reference Identifier to set.
      */
@@ -98,6 +107,7 @@
         this.referenceIdentifier = referenceIdentifier;
     }
 
+
     /**
      * @param referenceTimestamp The Reference Timestamp to set.
      */
@@ -106,6 +116,7 @@
         this.referenceTimestamp = referenceTimestamp;
     }
 
+
     /**
      * @param rootDelay The Root Delay to set.
      */
@@ -114,6 +125,7 @@
         this.rootDelay = rootDelay;
     }
 
+
     /**
      * @param rootDispersion The Root Dispersion to set.
      */
@@ -122,6 +134,7 @@
         this.rootDispersion = rootDispersion;
     }
 
+
     /**
      * @param stratumType The Stratum to set.
      */
@@ -130,6 +143,7 @@
         this.stratumType = stratumType;
     }
 
+
     /**
      * @param transmitTimestamp The Transmit Timestamp to set.
      */
@@ -137,6 +151,7 @@
     {
         this.transmitTimestamp = transmitTimestamp;
     }
+
 
     /**
      * @param versionNumber The Version Number to set.

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpTimeStamp.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpTimeStamp.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpTimeStamp.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpTimeStamp.java Fri Feb 10 02:48:07 2006
@@ -17,11 +17,13 @@
 
 package org.apache.directory.server.ntp.messages;
 
+
 import java.nio.ByteBuffer;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.TimeZone;
 
+
 /**
  * NTP timestamps are represented as a 64-bit unsigned fixed-point number,
  * in seconds relative to 0h on 1 January 1900. The integer part is in the
@@ -47,12 +49,14 @@
     private long seconds = 0;
     private long fraction = 0;
 
+
     public NtpTimeStamp()
     {
         this( new Date() );
     }
 
-    public NtpTimeStamp( Date date )
+
+    public NtpTimeStamp(Date date)
     {
         long msSinceStartOfNtpEpoch = date.getTime() - NTP_EPOCH_DIFFERENCE;
 
@@ -60,7 +64,8 @@
         fraction = ( ( msSinceStartOfNtpEpoch % 1000 ) * 0x100000000L ) / 1000;
     }
 
-    public NtpTimeStamp( ByteBuffer data )
+
+    public NtpTimeStamp(ByteBuffer data)
     {
         for ( int ii = 0; ii < 4; ii++ )
         {
@@ -73,27 +78,29 @@
         }
     }
 
+
     public void writeTo( ByteBuffer buffer )
     {
-        byte[] bytes = new byte[ 8 ];
+        byte[] bytes = new byte[8];
 
         long temp = seconds;
         for ( int ii = 3; ii >= 0; ii-- )
         {
-            bytes[ ii ] = (byte) ( temp % 256 );
+            bytes[ii] = ( byte ) ( temp % 256 );
             temp = temp / 256;
         }
 
         temp = fraction;
         for ( int ii = 7; ii >= 4; ii-- )
         {
-            bytes[ ii ] = (byte) ( temp % 256 );
+            bytes[ii] = ( byte ) ( temp % 256 );
             temp = temp / 256;
         }
 
         buffer.put( bytes );
     }
 
+
     public String toString()
     {
         long msSinceStartOfNtpEpoch = seconds * 1000 + ( fraction * 1000 ) / 0x100000000L;
@@ -105,6 +112,7 @@
         }
     }
 
+
     public boolean equals( Object o )
     {
         if ( this == o )
@@ -117,9 +125,10 @@
             return false;
         }
 
-        NtpTimeStamp that = (NtpTimeStamp) o;
+        NtpTimeStamp that = ( NtpTimeStamp ) o;
         return ( this.seconds == that.seconds ) && ( this.fraction == that.fraction );
     }
+
 
     private int makePositive( byte b )
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java Fri Feb 10 02:48:07 2006
@@ -17,10 +17,12 @@
 
 package org.apache.directory.server.ntp.messages;
 
+
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
+
 /**
  * Reference Identifier: This is a 32-bit bitstring identifying the
  * particular reference source. In the case of NTP Version 3 or Version
@@ -37,34 +39,41 @@
  */
 public class ReferenceIdentifier implements Comparable
 {
-	/**
-	 * Enumeration elements are constructed once upon class loading.
-	 * Order of appearance here determines the order of compareTo.
-	 */
-	public static final ReferenceIdentifier INIT = new ReferenceIdentifier(0,  "INIT", "initializing");
-	public static final ReferenceIdentifier LOCL = new ReferenceIdentifier(1,  "LOCL", "uncalibrated local clock");
-	public static final ReferenceIdentifier PPS  = new ReferenceIdentifier(2,  "PPL", "pulse-per-second source");
-	public static final ReferenceIdentifier ACTS = new ReferenceIdentifier(3,  "ACTS", "NIST dialup modem service");
-	public static final ReferenceIdentifier USNO = new ReferenceIdentifier(4,  "USNO", "USNO modem service");
-	public static final ReferenceIdentifier PTB  = new ReferenceIdentifier(5,  "PTB", "PTB (Germany) modem service");
-	public static final ReferenceIdentifier TDF  = new ReferenceIdentifier(6,  "TDF", "Allouis (France) Radio 164 kHz");
-	public static final ReferenceIdentifier DCF  = new ReferenceIdentifier(7,  "DCF", "Mainflingen (Germany) Radio 77.5 kHz");
-	public static final ReferenceIdentifier MSF  = new ReferenceIdentifier(8,  "MSF", "Rugby (UK) Radio 60 kHz");
-	public static final ReferenceIdentifier WWV  = new ReferenceIdentifier(9,  "WWV", "Ft. Collins (US) Radio 2.5, 5, 10, 15, 20 MHz");
-	public static final ReferenceIdentifier WWVB = new ReferenceIdentifier(10, "WWVB", "Boulder (US) Radio 60 kHz");
-	public static final ReferenceIdentifier WWVH = new ReferenceIdentifier(11, "WWVH", "Kaui Hawaii (US) Radio 2.5, 5, 10, 15 MHz");
-	public static final ReferenceIdentifier CHU  = new ReferenceIdentifier(12, "CHU", "Ottawa (Canada) Radio 3330, 7335, 14670 kHz");
-	public static final ReferenceIdentifier LORC = new ReferenceIdentifier(13, "LORC", "LORAN-C radionavigation system");
-	public static final ReferenceIdentifier OMEG = new ReferenceIdentifier(14, "OMEG", "OMEGA radionavigation system");
-	public static final ReferenceIdentifier GPS  = new ReferenceIdentifier(15, "GPS", "Global Positioning Service");
-	public static final ReferenceIdentifier GOES = new ReferenceIdentifier(16, "GOES", "Geostationary Orbit Environment Satellite");
-	public static final ReferenceIdentifier CDMA = new ReferenceIdentifier(17, "CDMA", "CDMA mobile cellular/PCS telephone system");
+    /**
+     * Enumeration elements are constructed once upon class loading.
+     * Order of appearance here determines the order of compareTo.
+     */
+    public static final ReferenceIdentifier INIT = new ReferenceIdentifier( 0, "INIT", "initializing" );
+    public static final ReferenceIdentifier LOCL = new ReferenceIdentifier( 1, "LOCL", "uncalibrated local clock" );
+    public static final ReferenceIdentifier PPS = new ReferenceIdentifier( 2, "PPL", "pulse-per-second source" );
+    public static final ReferenceIdentifier ACTS = new ReferenceIdentifier( 3, "ACTS", "NIST dialup modem service" );
+    public static final ReferenceIdentifier USNO = new ReferenceIdentifier( 4, "USNO", "USNO modem service" );
+    public static final ReferenceIdentifier PTB = new ReferenceIdentifier( 5, "PTB", "PTB (Germany) modem service" );
+    public static final ReferenceIdentifier TDF = new ReferenceIdentifier( 6, "TDF", "Allouis (France) Radio 164 kHz" );
+    public static final ReferenceIdentifier DCF = new ReferenceIdentifier( 7, "DCF",
+        "Mainflingen (Germany) Radio 77.5 kHz" );
+    public static final ReferenceIdentifier MSF = new ReferenceIdentifier( 8, "MSF", "Rugby (UK) Radio 60 kHz" );
+    public static final ReferenceIdentifier WWV = new ReferenceIdentifier( 9, "WWV",
+        "Ft. Collins (US) Radio 2.5, 5, 10, 15, 20 MHz" );
+    public static final ReferenceIdentifier WWVB = new ReferenceIdentifier( 10, "WWVB", "Boulder (US) Radio 60 kHz" );
+    public static final ReferenceIdentifier WWVH = new ReferenceIdentifier( 11, "WWVH",
+        "Kaui Hawaii (US) Radio 2.5, 5, 10, 15 MHz" );
+    public static final ReferenceIdentifier CHU = new ReferenceIdentifier( 12, "CHU",
+        "Ottawa (Canada) Radio 3330, 7335, 14670 kHz" );
+    public static final ReferenceIdentifier LORC = new ReferenceIdentifier( 13, "LORC",
+        "LORAN-C radionavigation system" );
+    public static final ReferenceIdentifier OMEG = new ReferenceIdentifier( 14, "OMEG", "OMEGA radionavigation system" );
+    public static final ReferenceIdentifier GPS = new ReferenceIdentifier( 15, "GPS", "Global Positioning Service" );
+    public static final ReferenceIdentifier GOES = new ReferenceIdentifier( 16, "GOES",
+        "Geostationary Orbit Environment Satellite" );
+    public static final ReferenceIdentifier CDMA = new ReferenceIdentifier( 17, "CDMA",
+        "CDMA mobile cellular/PCS telephone system" );
 
     /**
      * These two lines are all that's necessary to export a List of VALUES.
      */
-    private static final ReferenceIdentifier[] values = { INIT, LOCL, PPS, ACTS, USNO, PTB, TDF, DCF, MSF, WWV, WWVB,
-            WWVH, CHU, LORC, OMEG, GPS, GOES, CDMA };
+    private static final ReferenceIdentifier[] values =
+        { INIT, LOCL, PPS, ACTS, USNO, PTB, TDF, DCF, MSF, WWV, WWVB, WWVH, CHU, LORC, OMEG, GPS, GOES, CDMA };
     // VALUES needs to be located here, otherwise illegal forward reference
     public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
 
@@ -72,56 +81,63 @@
     private final String name;
     private final String code;
 
+
     /**
      * Private constructor prevents construction outside of this class.
      */
-    private ReferenceIdentifier( int ordinal, String code, String name )
+    private ReferenceIdentifier(int ordinal, String code, String name)
     {
         this.ordinal = ordinal;
         this.code = code;
         this.name = name;
     }
 
+
     public static ReferenceIdentifier getTypeByOrdinal( int type )
     {
         for ( int ii = 0; ii < values.length; ii++ )
         {
-            if ( values[ ii ].ordinal == type )
+            if ( values[ii].ordinal == type )
             {
-                return values[ ii ];
+                return values[ii];
             }
         }
 
         return LOCL;
     }
 
+
     public static ReferenceIdentifier getTypeByName( String type )
     {
         for ( int ii = 0; ii < values.length; ii++ )
         {
-            if ( values[ ii ].code.equalsIgnoreCase( type ) )
+            if ( values[ii].code.equalsIgnoreCase( type ) )
             {
-                return values[ ii ];
+                return values[ii];
             }
         }
 
         return LOCL;
     }
 
+
     public int getOrdinal()
     {
         return ordinal;
     }
 
+
     public String getCode()
     {
         return code;
     }
 
+
     public int compareTo( Object that )
     {
-        return ordinal - ( (ReferenceIdentifier) that ).ordinal;
+        return ordinal - ( ( ReferenceIdentifier ) that ).ordinal;
     }
+
 
     public String toString()
     {



Mime
View raw message