directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r899975 - /directory/apacheds/branches/apacheds-cidit/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
Date Sat, 16 Jan 2010 15:24:26 GMT
Author: kayyagari
Date: Sat Jan 16 15:24:26 2010
New Revision: 899975

URL: http://svn.apache.org/viewvc?rev=899975&view=rev
Log:
o removed lines throwing exceptions when optional server config is not found
o added a note in the getDirectoryService() method describing why throwing an exception is
required

Modified:
    directory/apacheds/branches/apacheds-cidit/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java

Modified: directory/apacheds/branches/apacheds-cidit/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-cidit/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=899975&r1=899974&r2=899975&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-cidit/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
(original)
+++ directory/apacheds/branches/apacheds-cidit/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
Sat Jan 16 15:24:26 2010
@@ -164,7 +164,8 @@
 
         if ( !cursor.next() )
         {
-            throw new Exception( "No LDAP server was configured under the DN " + configPartition.getSuffixDn()
);
+            LOG.warn( "No LDAP server was configured under the DN {}", configPartition.getSuffixDn()
);
+            return null;
         }
 
         ForwardIndexEntry<Long, Long> forwardEntry = ( ForwardIndexEntry<Long, Long>
) cursor.get();
@@ -200,7 +201,8 @@
 
         if ( !cursor.next() )
         {
-            throw new Exception( "No kerberos server was configured under the DN " + configPartition.getSuffixDn()
);
+            LOG.warn( "No kerberos server was configured under the DN {}", configPartition.getSuffixDn()
);
+            return null;
         }
 
         ForwardIndexEntry<Long, Long> forwardEntry = ( ForwardIndexEntry<Long, Long>
) cursor.get();
@@ -325,7 +327,8 @@
 
         if ( !cursor.next() )
         {
-            throw new Exception( "No DNS server was configured under the DN " + configPartition.getSuffixDn()
);
+            LOG.warn( "No DNS server was configured under the DN {}", configPartition.getSuffixDn()
);
+            return null;
         }
 
         ForwardIndexEntry<Long, Long> forwardEntry = ( ForwardIndexEntry<Long, Long>
) cursor.get();
@@ -363,7 +366,8 @@
 
         if ( !cursor.next() )
         {
-            throw new Exception( "No DHCP server was configured under the DN " + configPartition.getSuffixDn()
);
+            LOG.warn( "No DHCP server was configured under the DN {}", configPartition.getSuffixDn()
);
+            return null;
         }
 
         ForwardIndexEntry<Long, Long> forwardEntry = ( ForwardIndexEntry<Long, Long>
) cursor.get();
@@ -394,7 +398,8 @@
 
         if ( !cursor.next() )
         {
-            throw new Exception( "No NTP server was configured under the DN " + configPartition.getSuffixDn()
);
+            LOG.warn( "No NTP server was configured under the DN {}", configPartition.getSuffixDn()
);
+            return null;
         }
 
         ForwardIndexEntry<Long, Long> forwardEntry = ( ForwardIndexEntry<Long, Long>
) cursor.get();
@@ -431,7 +436,8 @@
 
         if ( !cursor.next() )
         {
-            throw new Exception( "No HTTP server was configured under the DN " + configPartition.getSuffixDn()
);
+            LOG.warn( "No HTTP server was configured under the DN {}", configPartition.getSuffixDn()
);
+            return null;
         }
 
         ForwardIndexEntry<Long, Long> forwardEntry = ( ForwardIndexEntry<Long, Long>
) cursor.get();
@@ -490,6 +496,7 @@
 
         if ( !cursor.next() )
         {
+            // the DirectoryService is mandatory so throwing exception
             throw new Exception( "No directoryService instance was configured under the DN
"
                 + configPartition.getSuffixDn() );
         }



Mime
View raw message