directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r916982 - /directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/store/SimpleDhcpStore.java
Date Sat, 27 Feb 2010 16:27:02 GMT
Author: elecharny
Date: Sat Feb 27 16:27:01 2010
New Revision: 916982

URL: http://svn.apache.org/viewvc?rev=916982&view=rev
Log:
Removed a reference to the "cn" AT and replaced it by a reference to the associated SchemaConstants

Modified:
    directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/store/SimpleDhcpStore.java

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/store/SimpleDhcpStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/store/SimpleDhcpStore.java?rev=916982&r1=916981&r2=916982&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/store/SimpleDhcpStore.java
(original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/store/SimpleDhcpStore.java
Sat Feb 27 16:27:01 2010
@@ -43,6 +43,7 @@
 import org.apache.directory.server.dhcp.messages.HardwareAddress;
 import org.apache.directory.server.dhcp.options.OptionsField;
 import org.apache.directory.server.dhcp.service.Lease;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 
 
 /**
@@ -112,6 +113,7 @@
         try
         {
             DirContext ctx = getContext();
+            
             try
             {
                 String filter = "(&(objectclass=ipHost)(objectclass=ieee802Device)(macaddress={0}))";
@@ -126,10 +128,12 @@
                     SearchResult sr = ( SearchResult ) ne.next();
                     Attributes att = sr.getAttributes();
                     Attribute ipHostNumberAttribute = att.get( "iphostnumber" );
+                    
                     if ( ipHostNumberAttribute != null )
                     {
                         InetAddress clientAddress = InetAddress.getByName( ( String ) ipHostNumberAttribute.get()
);
-                        Attribute cnAttribute = att.get( "cn" );
+                        Attribute cnAttribute = att.get( SchemaConstants.CN_AT );
+                        
                         return new Host( cnAttribute != null ? ( String ) cnAttribute.get()
: "unknown", clientAddress,
                             hardwareAddress );
                     }



Mime
View raw message